245 {
246 float time_factor = time_ms * 0.0008f;
247
248
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]
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.