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

◆ drawOceanDepths()

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

Definition at line 341 of file FxNoiseRing.h.

341 {
342 float ocean_time = time_ms * 0.0005f;
343
344 float current1 = inoise16(coord.x * 1200, coord.y * 1200, ocean_time * 800) / 65536.0f;
345 float current2 = inoise16(coord.x * 2400, coord.y * 2400, ocean_time * 600) / 65536.0f * 0.5f;
346 float current3 = inoise16(coord.x * 600, coord.y * 600, ocean_time * 1000) / 65536.0f * 0.3f;
347
348 float depth_factor = (current1 + current2 + current3 + 1.5f) / 3.0f;
349 float hue_variation = (current2 + 0.5f);
350
351 return palette.mapColor(hue_variation, depth_factor);
352}
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

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