56 {
59
60
61
62
63
64
67
68 constexpr int GRID = 16;
69 constexpr float STEP_F = 0.05f;
70
72
73
74 {
75 float ax = 0.0f, ay = 0.0f;
78 for (int it = 0; it < iters; it++) {
79
80
81
82 ax += 0.011f;
83 ay += 0.013f;
84 for (int row = 0; row < GRID; row++) {
85 float y = ay + row * STEP_F;
86 for (int col = 0; col < GRID; col++) {
87 float x = ax + col * STEP_F;
89
90
91 sink +=
static_cast<int32_t>(n * 127.0f);
92 }
93 }
94 }
98 }
99
100
101 {
103
104 constexpr int32_t DRIFT_X =
static_cast<int32_t>(0.011f * 65536.0f);
105 constexpr int32_t DRIFT_Y =
static_cast<int32_t>(0.013f * 65536.0f);
108 for (int it = 0; it < iters; it++) {
109 ax_i += DRIFT_X;
110 ay_i += DRIFT_Y;
111 for (int row = 0; row < GRID; row++) {
112 int32_t y_i = ay_i + row * STEP_I;
113 for (int col = 0; col < GRID; col++) {
114 int32_t x_i = ax_i + col * STEP_I;
115
116
117
119 x_i, y_i, fade_lut, fl::PERLIN_NOISE);
120 sink += n >> 9;
121
122 }
123 }
124 }
128 }
129
130 return r;
131}
PerlinBenchState & perlinBenchState()
FASTLED_FORCE_INLINE float pnoise(float x, float y, float z) FL_NO_EXCEPT
fl::u32 micros() FL_NO_EXCEPT
Universal microsecond timer - returns microseconds since system startup.
static fl::i32 pnoise2d_raw(fl::i32 fx_raw, fl::i32 fy_raw, const fl::i32 *fade_lut, const fl::u8 *perm) FL_NO_EXCEPT