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

◆ drawCosmicSwirl()

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

Definition at line 245 of file FxNoiseRing.h.

245 {
246 float time_factor = time_ms * 0.0008f;
247
248 // Multi-octave noise for organic complexity
249 float noise1 = inoise16(coord.x * 2000, coord.y * 2000, time_factor * 1000) / 65536.0f;
250 float noise2 = inoise16(coord.x * 1000, coord.y * 1000, time_factor * 2000) / 65536.0f * 0.5f;
251 float noise3 = inoise16(coord.x * 4000, coord.y * 4000, time_factor * 500) / 65536.0f * 0.25f;
252
253 float combined_noise = noise1 + noise2 + noise3;
254 float hue_norm = (combined_noise + coord.angle / (2*M_PI) + 1.0f) * 0.5f;
255 float intensity = (combined_noise + 1.0f) * 0.5f;
256
257 return palette.mapColor(hue_norm, intensity);
258}
uint8_t noise2[NUM_LAYERS][WIDTH][HEIGHT]
Definition Fire2023.h:99
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
#define M_PI
Definition math_macros.h:93

References RingCoord::angle, inoise16(), M_PI, 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: