FastLED 3.9.15
Loading...
Searching...
No Matches

◆ drawGlitchCity()

CRGB drawGlitchCity ( const RingCoord & coord,
uint32_t time_ms,
ColorPaletteManager & palette )

Definition at line 323 of file FxNoiseRing.h.

323 {
324 uint32_t glitch_time = (time_ms / 100) * 100; // Quantize time
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; // XOR for harsh digital effects
330
331 if ((glitch_value & 0xF000) == 0xF000) {
332 return CRGB(255, 255, 255); // Full-bright glitch flash
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]
Definition Fire2023.h:99
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.
Definition noise.cpp:420
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:86

References inoise16(), noise2, palette(), RingCoord::x, and RingCoord::y.

Referenced by NoiseVariantManager::renderVariant().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: