118 {
119 float time_scaled = time_ms * params.
time_scale * 0.001f;
120
121
122 float wave_sum = 0.0f;
123 for (int i = 0; i < 4; i++) {
126 float distance = sqrt(dx*dx + dy*dy);
127
128 float wave_phase = distance *
sources[i].frequency + time_scaled *
sources[i].phase_speed;
129 wave_sum += sin(wave_phase) *
sources[i].amplitude;
130 }
131
132
134 float noise_x = coord.
x * 0xffff * noise_scale;
135 float noise_y = coord.
y * 0xffff * noise_scale;
137
138 float noise_mod = (
inoise16(noise_x, noise_y, noise_time) - 32768) / 65536.0f;
140
141
143 }
CRGB mapWaveToColor(float wave_value, const PlasmaParams ¶ms)
uint16_t inoise16(uint32_t x, uint32_t y, uint32_t z, uint32_t t)
16-bit, fixed point implementation of Perlin's noise.