… | |
… | |
173 | |
173 | |
174 | // modelled after 2d/3d kensler noise without projection |
174 | // modelled after 2d/3d kensler noise without projection |
175 | struct noise2d |
175 | struct noise2d |
176 | { |
176 | { |
177 | permutation<256, uint8_t> rvmap[2]; |
177 | permutation<256, uint8_t> rvmap[2]; |
178 | float rvec [256][2]; // random unit vectors |
178 | vec2d rvec[256]; // random unit vectors |
179 | |
179 | |
180 | noise2d (uint32_t seed); |
180 | noise2d (uint32_t seed); |
181 | float noise (float x, float y); |
181 | float noise (float x, float y); |
182 | }; |
182 | }; |
183 | |
183 | |
184 | struct noise3d |
184 | struct noise3d |
185 | { |
185 | { |
186 | permutation<256, uint8_t> rvmap[3]; |
186 | permutation<256, uint8_t> rvmap[3]; |
187 | float rvec [256][3]; // random unit vectors |
187 | float rvec[256][3]; // random unit vectors |
188 | |
188 | |
189 | noise3d (uint32_t seed); |
189 | noise3d (uint32_t seed); |
190 | float noise (float x, float y, float z); |
190 | float noise (float x, float y, float z); |
191 | |
191 | |
192 | // noise projected on a surface with normal n |
192 | // noise projected on a surface with normal n |