ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/noise.h
(Generate patch)

Comparing deliantra/server/include/noise.h (file contents):
Revision 1.20 by root, Wed Nov 16 23:42:00 2016 UTC vs.
Revision 1.21 by root, Sat Nov 17 23:33:18 2018 UTC

173{ 173{
174 T pmap[N]; 174 T pmap[N];
175 175
176 void seed (seedable_rand_gen &rng); 176 void seed (seedable_rand_gen &rng);
177 177
178 T operator ()(T v) func_pure 178 ecb_pure T operator ()(T v)
179 { 179 {
180 return pmap[v & T(N - 1)]; 180 return pmap[v & T(N - 1)];
181 } 181 }
182}; 182};
183 183
191 typedef typename vec_t::T_numtype value_t; 191 typedef typename vec_t::T_numtype value_t;
192 192
193 void seed (seedable_rand_gen &rng); 193 void seed (seedable_rand_gen &rng);
194 void seed (seed_t seed); 194 void seed (seed_t seed);
195 195
196 value_t operator ()(vec_t P, uint32_t seed = 0) func_pure; 196 ecb_pure value_t operator ()(vec_t P, uint32_t seed = 0);
197}; 197};
198 198
199template<class vec_t> 199template<class vec_t>
200struct noise_gen; 200struct noise_gen;
201 201
214 static vec3d::T_numtype abs_avg() { return 0.415; } // avg(abs(noise)) 214 static vec3d::T_numtype abs_avg() { return 0.415; } // avg(abs(noise))
215 215
216 using noise_gen_base<vec3d>::operator (); 216 using noise_gen_base<vec3d>::operator ();
217 217
218 // noise projected on a surface with normal n 218 // noise projected on a surface with normal n
219 vec2d::T_numtype operator() (vec3d P, vec3d N, uint32_t seed = 0) func_pure; 219 ecb_pure vec2d::T_numtype operator() (vec3d P, vec3d N, uint32_t seed = 0);
220}; 220};
221 221
222typedef noise_gen<vec2d> noise2d; 222typedef noise_gen<vec2d> noise2d;
223typedef noise_gen<vec3d> noise3d; 223typedef noise_gen<vec3d> noise3d;
224 224
237 value_t fbm_mul[MAX_OCTAVES]; 237 value_t fbm_mul[MAX_OCTAVES];
238 rotate_xy<vec_t> rot[MAX_OCTAVES]; 238 rotate_xy<vec_t> rot[MAX_OCTAVES];
239 239
240 frac_gen (int octaves = 3, value_t lacunarity = 2, value_t hurst_expo = .5, uint32_t seed = 0); 240 frac_gen (int octaves = 3, value_t lacunarity = 2, value_t hurst_expo = .5, uint32_t seed = 0);
241 241
242 value_t noise (vec_t P, uint32_t seed = 0) func_pure 242 ecb_pure value_t noise (vec_t P, uint32_t seed = 0)
243 { 243 {
244 return this->operator() (P, seed); 244 return this->operator() (P, seed);
245 } 245 }
246 246
247 value_t fBm (vec_t P) func_pure; 247 ecb_pure value_t fBm (vec_t P);
248 value_t turbulence (vec_t P) func_pure; 248 ecb_pure value_t turbulence (vec_t P);
249 value_t multifractal (vec_t P, value_t offset = 1) func_pure; 249 ecb_pure value_t multifractal (vec_t P, value_t offset = 1);
250 value_t heterofractal (vec_t P, value_t offset = 1) func_pure; 250 ecb_pure value_t heterofractal (vec_t P, value_t offset = 1);
251 value_t hybridfractal (vec_t P, value_t offset = 1, value_t gain = 1) func_pure; 251 ecb_pure value_t hybridfractal (vec_t P, value_t offset = 1, value_t gain = 1);
252 value_t ridgedmultifractal (vec_t P, value_t offset = 1, value_t gain = 8) func_pure; 252 ecb_pure value_t ridgedmultifractal (vec_t P, value_t offset = 1, value_t gain = 8);
253 value_t billowfractal (vec_t P, value_t offset = 1, value_t gain = 2) func_pure; 253 ecb_pure value_t billowfractal (vec_t P, value_t offset = 1, value_t gain = 2);
254 value_t terrain (vec_t P) func_pure; 254 ecb_pure value_t terrain (vec_t P);
255 value_t terrain2 (vec_t P) func_pure; 255 ecb_pure value_t terrain2 (vec_t P);
256}; 256};
257 257
258typedef frac_gen<vec2d> frac2d; 258typedef frac_gen<vec2d> frac2d;
259typedef frac_gen<vec3d> frac3d; 259typedef frac_gen<vec3d> frac3d;
260 260

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines