14 float p,
const float detail,
const float roughness,
const float lacunarity,
bool normalize)
31 const float sum2 = sum + t * amp;
32 return normalize ?
mix(0.5f * sum / maxamp + 0.5f, 0.5f * sum2 / (maxamp + amp) + 0.5f, rmd) :
35 return normalize ? 0.5f * sum / maxamp + 0.5f : sum;
56 const float sum2 = sum + t * amp;
57 return normalize ?
mix(0.5f * sum / maxamp + 0.5f, 0.5f * sum2 / (maxamp + amp) + 0.5f, rmd) :
60 return normalize ? 0.5f * sum / maxamp + 0.5f : sum;
81 const float sum2 = sum + t * amp;
82 return normalize ?
mix(0.5f * sum / maxamp + 0.5f, 0.5f * sum2 / (maxamp + amp) + 0.5f, rmd) :
85 return normalize ? 0.5f * sum / maxamp + 0.5f : sum;
101 fscale *= lacunarity;
106 const float sum2 = sum + t * amp;
107 return normalize ?
mix(0.5f * sum / maxamp + 0.5f, 0.5f * sum2 / (maxamp + amp) + 0.5f, rmd) :
110 return normalize ? 0.5f * sum / maxamp + 0.5f : sum;
117 const float roughness,
118 const float lacunarity)
131 value *= (rmd * pwr *
snoise_1d(p) + 1.0f);
139 const float roughness,
140 const float lacunarity)
153 value *= (rmd * pwr *
snoise_2d(p) + 1.0f);
161 const float roughness,
162 const float lacunarity)
175 value *= (rmd * pwr *
snoise_3d(p) + 1.0f);
183 const float roughness,
184 const float lacunarity)
197 value *= (rmd * pwr *
snoise_4d(p) + 1.0f);
206 float p,
const float detail,
const float roughness,
const float lacunarity,
const float offset)
208 float pwr = roughness;
215 const float increment = (
snoise_1d(p) + offset) * pwr * value;
223 const float increment = (
snoise_1d(p) + offset) * pwr * value;
224 value += rmd * increment;
232 const float roughness,
233 const float lacunarity,
236 float pwr = roughness;
243 const float increment = (
snoise_2d(p) + offset) * pwr * value;
251 const float increment = (
snoise_2d(p) + offset) * pwr * value;
252 value += rmd * increment;
260 const float roughness,
261 const float lacunarity,
264 float pwr = roughness;
271 const float increment = (
snoise_3d(p) + offset) * pwr * value;
279 const float increment = (
snoise_3d(p) + offset) * pwr * value;
280 value += rmd * increment;
288 const float roughness,
289 const float lacunarity,
292 float pwr = roughness;
299 const float increment = (
snoise_4d(p) + offset) * pwr * value;
307 const float increment = (
snoise_4d(p) + offset) * pwr * value;
308 value += rmd * increment;
318 const float roughness,
319 const float lacunarity,
328 weight =
fminf(weight, 1.0f);
330 const float signal = (
snoise_1d(p) + offset) * pwr;
332 value += weight * signal;
333 weight *= gain * signal;
338 if ((rmd != 0.0f) && (weight > 0.001f)) {
339 weight =
fminf(weight, 1.0f);
340 const float signal = (
snoise_1d(p) + offset) * pwr;
341 value += rmd * weight * signal;
349 const float roughness,
350 const float lacunarity,
359 weight =
fminf(weight, 1.0f);
361 const float signal = (
snoise_2d(p) + offset) * pwr;
363 value += weight * signal;
364 weight *= gain * signal;
369 if ((rmd != 0.0f) && (weight > 0.001f)) {
370 weight =
fminf(weight, 1.0f);
371 const float signal = (
snoise_2d(p) + offset) * pwr;
372 value += rmd * weight * signal;
380 const float roughness,
381 const float lacunarity,
390 weight =
fminf(weight, 1.0f);
392 const float signal = (
snoise_3d(p) + offset) * pwr;
394 value += weight * signal;
395 weight *= gain * signal;
400 if ((rmd != 0.0f) && (weight > 0.001f)) {
401 weight =
fminf(weight, 1.0f);
402 const float signal = (
snoise_3d(p) + offset) * pwr;
403 value += rmd * weight * signal;
411 const float roughness,
412 const float lacunarity,
421 weight =
fminf(weight, 1.0f);
423 const float signal = (
snoise_4d(p) + offset) * pwr;
425 value += weight * signal;
426 weight *= gain * signal;
431 if ((rmd != 0.0f) && (weight > 0.001f)) {
432 weight =
fminf(weight, 1.0f);
433 const float signal = (
snoise_4d(p) + offset) * pwr;
434 value += rmd * weight * signal;
444 const float roughness,
445 const float lacunarity,
449 float pwr = roughness;
453 float value = signal;
462 value += signal * pwr;
471 const float roughness,
472 const float lacunarity,
476 float pwr = roughness;
480 float value = signal;
489 value += signal * pwr;
498 const float roughness,
499 const float lacunarity,
503 float pwr = roughness;
507 float value = signal;
516 value += signal * pwr;
525 const float roughness,
526 const float lacunarity,
530 float pwr = roughness;
534 float value = signal;
543 value += signal * pwr;
#define ccl_device_noinline
#define CCL_NAMESPACE_END
VecBase< float, D > normalize(VecOp< float, D >) RET
float noise_fbm(T co, float detail, float roughness, float lacunarity, float, float, bool normalize)
float noise_multi_fractal(T co, float detail, float roughness, float lacunarity, float, float, bool)
float noise_hybrid_multi_fractal(T co, float detail, float roughness, float lacunarity, float offset, float gain, bool)
float noise_ridged_multi_fractal(T co, float detail, float roughness, float lacunarity, float offset, float gain, bool)
float noise_hetero_terrain(T co, float detail, float roughness, float lacunarity, float offset, float, bool)
ccl_device_inline int float_to_int(const float f)
ccl_device_inline float snoise_1d(float p)
ccl_device_inline float snoise_2d(float2 p)
ccl_device_inline float snoise_3d(float3 p)
ccl_device_inline float snoise_4d(float4 p)