73 {
74 double angle_offset = double(now) / 32000.0 * 2 *
M_PI;
76
78
79
80
84 x *= 0xffff *
scale.as<
double>();
85 y *= 0xffff *
scale.as<
double>();
88 uint16_t noise3 =
inoise16(
x,
y, 0xffff + now);
89 noise3 = noise3 >> 8;
90 int16_t noise4 =
map(noise3, 0, 255, -64, 255);
91 if (noise4 < 0) {
92 noise4 = 0;
93 }
94
96 }
97}
UISlider scale("Scale", 1.0f, 0.0f, 1.0f, 0.01f)
uint8_t noise[NUM_LAYERS][WIDTH][HEIGHT]
uint8_t noise2[NUM_LAYERS][WIDTH][HEIGHT]
UISlider timescale("Time Scale", 1,.1, 10,.1)
UISlider timeBitshift("Time Bitshift", 5, 0, 16, 1)
uint16_t inoise16(uint32_t x, uint32_t y, uint32_t z, uint32_t t)
16-bit, fixed point implementation of Perlin's noise.
long map(long x, long in_min, long in_max, long out_min, long out_max)
Representation of an HSV pixel (hue, saturation, value (aka brightness)).