323 {
324 uint32_t glitch_time = (time_ms / 100) * 100;
325
326 uint16_t noise1 =
inoise16(coord.
x * 3000, coord.
y * 3000, glitch_time);
327 uint16_t
noise2 =
inoise16(coord.
x * 5000, coord.
y * 5000, glitch_time + 1000);
328
329 uint16_t glitch_value = noise1 ^
noise2;
330
331 if ((glitch_value & 0xF000) == 0xF000) {
332 return CRGB(255, 255, 255);
333 }
334
335 float intensity = (glitch_value & 0xFF) / 255.0f;
336 float hue_chaos = ((glitch_value >> 8) & 0xFF) / 255.0f;
337
338 return palette.mapColor(hue_chaos, intensity, 0.5f);
339}
uint8_t noise2[NUM_LAYERS][WIDTH][HEIGHT]
UINumberField palette("Palette", 0, 0, 2)
uint16_t inoise16(uint32_t x, uint32_t y, uint32_t z, uint32_t t)
16-bit, fixed point implementation of Perlin's noise.
Representation of an RGB pixel (Red, Green, Blue)