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

◆ drawDigitalRain()

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

Definition at line 304 of file FxNoiseRing.h.

304 {
305 float vertical_pos = sin(coord.angle) * 0.5f + 0.5f;
306 float cascade_speed = 0.002f;
307 float time_offset = time_ms * cascade_speed;
308
309 int stream_id = (int)(coord.angle * 10) % 8;
310 float stream_phase = fmod(vertical_pos + time_offset + stream_id * 0.125f, 1.0f);
311
312 uint16_t noise = inoise16(stream_id * 1000, stream_phase * 10000, time_ms / 4);
313 uint8_t digital_value = (noise >> 8) > 128 ? 255 : 0;
314
315 if (digital_value > 0) {
316 float intensity = 1.0f - stream_phase * 0.8f; // Fade trailing
317 return palette.mapColor(0.4f, intensity); // Matrix green area
318 } else {
319 return CRGB::Black;
320 }
321}
uint8_t noise[NUM_LAYERS][WIDTH][HEIGHT]
Definition Fire2023.h:98
UINumberField palette("Palette", 0, 0, 2)
float angle
Definition FxNoiseRing.h:47
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
@ Black
<div style='background:#000000;width:4em;height:4em;'></div>
Definition crgb.h:567

References RingCoord::angle, CRGB::Black, inoise16(), noise, and palette().

Referenced by NoiseVariantManager::renderVariant().

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