Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2021-11-02 20:27:54 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-11-02 20:56:25 +0300
commit48e2a15160d276c8080cd8d4f6dc0ba752dbb410 (patch)
tree5552f66d7fa217a12bbdd4fbe0c1e9691c4fb36e
parent978f2cb900b75110a3bc9dbcec9d4aeae5df4565 (diff)
Fix T77681, T92634: noise texture artifacts with high detail
We run into float precision issues here, clamp the number of octaves to one less, which has little to no visual difference. This was empirically determined to work up to 16 before, but with additional inputs like roughness only 15 appears to work. Also adds misisng clamp for the geometry nodes implementation.
-rw-r--r--intern/cycles/kernel/osl/shaders/node_musgrave_texture.osl2
-rw-r--r--intern/cycles/kernel/osl/shaders/node_noise.h8
-rw-r--r--intern/cycles/kernel/svm/fractal_noise.h8
-rw-r--r--intern/cycles/kernel/svm/musgrave.h2
-rw-r--r--source/blender/blenlib/intern/noise.cc94
-rw-r--r--source/blender/gpu/shaders/material/gpu_shader_material_fractal_noise.glsl8
-rw-r--r--source/blender/gpu/shaders/material/gpu_shader_material_tex_musgrave.glsl40
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_musgrave.cc2
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_noise.cc2
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_wave.cc2
10 files changed, 109 insertions, 59 deletions
diff --git a/intern/cycles/kernel/osl/shaders/node_musgrave_texture.osl b/intern/cycles/kernel/osl/shaders/node_musgrave_texture.osl
index 0e71ce74c29..6a688d654c9 100644
--- a/intern/cycles/kernel/osl/shaders/node_musgrave_texture.osl
+++ b/intern/cycles/kernel/osl/shaders/node_musgrave_texture.osl
@@ -697,7 +697,7 @@ shader node_musgrave_texture(
output float Fac = 0.0)
{
float dimension = max(Dimension, 1e-5);
- float octaves = clamp(Detail, 0.0, 16.0);
+ float octaves = clamp(Detail, 0.0, 15.0);
float lacunarity = max(Lacunarity, 1e-5);
vector3 s = Vector;
diff --git a/intern/cycles/kernel/osl/shaders/node_noise.h b/intern/cycles/kernel/osl/shaders/node_noise.h
index ab4cd7792cc..e8a71032171 100644
--- a/intern/cycles/kernel/osl/shaders/node_noise.h
+++ b/intern/cycles/kernel/osl/shaders/node_noise.h
@@ -90,7 +90,7 @@ float fractal_noise(float p, float details, float roughness)
float amp = 1.0;
float maxamp = 0.0;
float sum = 0.0;
- float octaves = clamp(details, 0.0, 16.0);
+ float octaves = clamp(details, 0.0, 15.0);
int n = (int)octaves;
for (int i = 0; i <= n; i++) {
float t = safe_noise(fscale * p);
@@ -119,7 +119,7 @@ float fractal_noise(vector2 p, float details, float roughness)
float amp = 1.0;
float maxamp = 0.0;
float sum = 0.0;
- float octaves = clamp(details, 0.0, 16.0);
+ float octaves = clamp(details, 0.0, 15.0);
int n = (int)octaves;
for (int i = 0; i <= n; i++) {
float t = safe_noise(fscale * p);
@@ -148,7 +148,7 @@ float fractal_noise(vector3 p, float details, float roughness)
float amp = 1.0;
float maxamp = 0.0;
float sum = 0.0;
- float octaves = clamp(details, 0.0, 16.0);
+ float octaves = clamp(details, 0.0, 15.0);
int n = (int)octaves;
for (int i = 0; i <= n; i++) {
float t = safe_noise(fscale * p);
@@ -177,7 +177,7 @@ float fractal_noise(vector4 p, float details, float roughness)
float amp = 1.0;
float maxamp = 0.0;
float sum = 0.0;
- float octaves = clamp(details, 0.0, 16.0);
+ float octaves = clamp(details, 0.0, 15.0);
int n = (int)octaves;
for (int i = 0; i <= n; i++) {
float t = safe_noise(fscale * p);
diff --git a/intern/cycles/kernel/svm/fractal_noise.h b/intern/cycles/kernel/svm/fractal_noise.h
index b955d626dde..8256a24c751 100644
--- a/intern/cycles/kernel/svm/fractal_noise.h
+++ b/intern/cycles/kernel/svm/fractal_noise.h
@@ -27,7 +27,7 @@ ccl_device_noinline float fractal_noise_1d(float p, float octaves, float roughne
float amp = 1.0f;
float maxamp = 0.0f;
float sum = 0.0f;
- octaves = clamp(octaves, 0.0f, 16.0f);
+ octaves = clamp(octaves, 0.0f, 15.0f);
int n = float_to_int(octaves);
for (int i = 0; i <= n; i++) {
float t = noise_1d(fscale * p);
@@ -56,7 +56,7 @@ ccl_device_noinline float fractal_noise_2d(float2 p, float octaves, float roughn
float amp = 1.0f;
float maxamp = 0.0f;
float sum = 0.0f;
- octaves = clamp(octaves, 0.0f, 16.0f);
+ octaves = clamp(octaves, 0.0f, 15.0f);
int n = float_to_int(octaves);
for (int i = 0; i <= n; i++) {
float t = noise_2d(fscale * p);
@@ -85,7 +85,7 @@ ccl_device_noinline float fractal_noise_3d(float3 p, float octaves, float roughn
float amp = 1.0f;
float maxamp = 0.0f;
float sum = 0.0f;
- octaves = clamp(octaves, 0.0f, 16.0f);
+ octaves = clamp(octaves, 0.0f, 15.0f);
int n = float_to_int(octaves);
for (int i = 0; i <= n; i++) {
float t = noise_3d(fscale * p);
@@ -114,7 +114,7 @@ ccl_device_noinline float fractal_noise_4d(float4 p, float octaves, float roughn
float amp = 1.0f;
float maxamp = 0.0f;
float sum = 0.0f;
- octaves = clamp(octaves, 0.0f, 16.0f);
+ octaves = clamp(octaves, 0.0f, 15.0f);
int n = float_to_int(octaves);
for (int i = 0; i <= n; i++) {
float t = noise_4d(fscale * p);
diff --git a/intern/cycles/kernel/svm/musgrave.h b/intern/cycles/kernel/svm/musgrave.h
index 85e32eee638..a37ca9eb8eb 100644
--- a/intern/cycles/kernel/svm/musgrave.h
+++ b/intern/cycles/kernel/svm/musgrave.h
@@ -737,7 +737,7 @@ ccl_device_noinline int svm_node_tex_musgrave(KernelGlobals kg,
float gain = stack_load_float_default(stack, gain_stack_offset, defaults2.z);
dimension = fmaxf(dimension, 1e-5f);
- detail = clamp(detail, 0.0f, 16.0f);
+ detail = clamp(detail, 0.0f, 15.0f);
lacunarity = fmaxf(lacunarity, 1e-5f);
float fac;
diff --git a/source/blender/blenlib/intern/noise.cc b/source/blender/blenlib/intern/noise.cc
index bc78ded63a0..959385bff31 100644
--- a/source/blender/blenlib/intern/noise.cc
+++ b/source/blender/blenlib/intern/noise.cc
@@ -582,7 +582,7 @@ template<typename T> float perlin_fractal_template(T position, float octaves, fl
float amp = 1.0f;
float maxamp = 0.0f;
float sum = 0.0f;
- octaves = CLAMPIS(octaves, 0.0f, 16.0f);
+ octaves = CLAMPIS(octaves, 0.0f, 15.0f);
int n = static_cast<int>(octaves);
for (int i = 0; i <= n; i++) {
float t = perlin(fscale * position);
@@ -771,12 +771,16 @@ float3 perlin_float3_fractal_distorted(float4 position,
* from "Texturing and Modelling: A procedural approach"
*/
-float musgrave_fBm(const float co, const float H, const float lacunarity, const float octaves)
+float musgrave_fBm(const float co,
+ const float H,
+ const float lacunarity,
+ const float octaves_unclamped)
{
float p = co;
float value = 0.0f;
float pwr = 1.0f;
const float pwHL = powf(lacunarity, -H);
+ const float octaves = CLAMPIS(octaves_unclamped, 0.0f, 15.0f);
for (int i = 0; i < (int)octaves; i++) {
value += perlin_signed(p) * pwr;
@@ -802,12 +806,13 @@ float musgrave_fBm(const float co, const float H, const float lacunarity, const
float musgrave_multi_fractal(const float co,
const float H,
const float lacunarity,
- const float octaves)
+ const float octaves_unclamped)
{
float p = co;
float value = 1.0f;
float pwr = 1.0f;
const float pwHL = powf(lacunarity, -H);
+ const float octaves = CLAMPIS(octaves_unclamped, 0.0f, 15.0f);
for (int i = 0; i < (int)octaves; i++) {
value *= (pwr * perlin_signed(p) + 1.0f);
@@ -831,12 +836,16 @@ float musgrave_multi_fractal(const float co,
* offset: raises the terrain from `sea level'
*/
-float musgrave_hetero_terrain(
- const float co, const float H, const float lacunarity, const float octaves, const float offset)
+float musgrave_hetero_terrain(const float co,
+ const float H,
+ const float lacunarity,
+ const float octaves_unclamped,
+ const float offset)
{
float p = co;
const float pwHL = powf(lacunarity, -H);
float pwr = pwHL;
+ const float octaves = CLAMPIS(octaves_unclamped, 0.0f, 15.0f);
/* first unscaled octave of function; later octaves are scaled */
float value = offset + perlin_signed(p);
@@ -869,7 +878,7 @@ float musgrave_hetero_terrain(
float musgrave_hybrid_multi_fractal(const float co,
const float H,
const float lacunarity,
- const float octaves,
+ const float octaves_unclamped,
const float offset,
const float gain)
{
@@ -881,6 +890,8 @@ float musgrave_hybrid_multi_fractal(const float co,
float weight = gain * value;
p *= lacunarity;
+ const float octaves = CLAMPIS(octaves_unclamped, 0.0f, 15.0f);
+
for (int i = 1; (weight > 0.001f) && (i < (int)octaves); i++) {
if (weight > 1.0f) {
weight = 1.0f;
@@ -912,7 +923,7 @@ float musgrave_hybrid_multi_fractal(const float co,
float musgrave_ridged_multi_fractal(const float co,
const float H,
const float lacunarity,
- const float octaves,
+ const float octaves_unclamped,
const float offset,
const float gain)
{
@@ -925,6 +936,8 @@ float musgrave_ridged_multi_fractal(const float co,
float value = signal;
float weight = 1.0f;
+ const float octaves = CLAMPIS(octaves_unclamped, 0.0f, 15.0f);
+
for (int i = 1; i < (int)octaves; i++) {
p *= lacunarity;
weight = CLAMPIS(signal * gain, 0.0f, 1.0f);
@@ -947,12 +960,16 @@ float musgrave_ridged_multi_fractal(const float co,
* from "Texturing and Modelling: A procedural approach"
*/
-float musgrave_fBm(const float2 co, const float H, const float lacunarity, const float octaves)
+float musgrave_fBm(const float2 co,
+ const float H,
+ const float lacunarity,
+ const float octaves_unclamped)
{
float2 p = co;
float value = 0.0f;
float pwr = 1.0f;
const float pwHL = powf(lacunarity, -H);
+ const float octaves = CLAMPIS(octaves_unclamped, 0.0f, 15.0f);
for (int i = 0; i < (int)octaves; i++) {
value += perlin_signed(p) * pwr;
@@ -978,12 +995,13 @@ float musgrave_fBm(const float2 co, const float H, const float lacunarity, const
float musgrave_multi_fractal(const float2 co,
const float H,
const float lacunarity,
- const float octaves)
+ const float octaves_unclamped)
{
float2 p = co;
float value = 1.0f;
float pwr = 1.0f;
const float pwHL = powf(lacunarity, -H);
+ const float octaves = CLAMPIS(octaves_unclamped, 0.0f, 15.0f);
for (int i = 0; i < (int)octaves; i++) {
value *= (pwr * perlin_signed(p) + 1.0f);
@@ -1010,7 +1028,7 @@ float musgrave_multi_fractal(const float2 co,
float musgrave_hetero_terrain(const float2 co,
const float H,
const float lacunarity,
- const float octaves,
+ const float octaves_unclamped,
const float offset)
{
float2 p = co;
@@ -1021,6 +1039,8 @@ float musgrave_hetero_terrain(const float2 co,
float value = offset + perlin_signed(p);
p *= lacunarity;
+ const float octaves = CLAMPIS(octaves_unclamped, 0.0f, 15.0f);
+
for (int i = 1; i < (int)octaves; i++) {
float increment = (perlin_signed(p) + offset) * pwr * value;
value += increment;
@@ -1048,7 +1068,7 @@ float musgrave_hetero_terrain(const float2 co,
float musgrave_hybrid_multi_fractal(const float2 co,
const float H,
const float lacunarity,
- const float octaves,
+ const float octaves_unclamped,
const float offset,
const float gain)
{
@@ -1060,6 +1080,8 @@ float musgrave_hybrid_multi_fractal(const float2 co,
float weight = gain * value;
p *= lacunarity;
+ const float octaves = CLAMPIS(octaves_unclamped, 0.0f, 15.0f);
+
for (int i = 1; (weight > 0.001f) && (i < (int)octaves); i++) {
if (weight > 1.0f) {
weight = 1.0f;
@@ -1091,7 +1113,7 @@ float musgrave_hybrid_multi_fractal(const float2 co,
float musgrave_ridged_multi_fractal(const float2 co,
const float H,
const float lacunarity,
- const float octaves,
+ const float octaves_unclamped,
const float offset,
const float gain)
{
@@ -1104,6 +1126,8 @@ float musgrave_ridged_multi_fractal(const float2 co,
float value = signal;
float weight = 1.0f;
+ const float octaves = CLAMPIS(octaves_unclamped, 0.0f, 15.0f);
+
for (int i = 1; i < (int)octaves; i++) {
p *= lacunarity;
weight = CLAMPIS(signal * gain, 0.0f, 1.0f);
@@ -1126,13 +1150,18 @@ float musgrave_ridged_multi_fractal(const float2 co,
* from "Texturing and Modelling: A procedural approach"
*/
-float musgrave_fBm(const float3 co, const float H, const float lacunarity, const float octaves)
+float musgrave_fBm(const float3 co,
+ const float H,
+ const float lacunarity,
+ const float octaves_unclamped)
{
float3 p = co;
float value = 0.0f;
float pwr = 1.0f;
const float pwHL = powf(lacunarity, -H);
+ const float octaves = CLAMPIS(octaves_unclamped, 0.0f, 15.0f);
+
for (int i = 0; i < (int)octaves; i++) {
value += perlin_signed(p) * pwr;
pwr *= pwHL;
@@ -1157,13 +1186,15 @@ float musgrave_fBm(const float3 co, const float H, const float lacunarity, const
float musgrave_multi_fractal(const float3 co,
const float H,
const float lacunarity,
- const float octaves)
+ const float octaves_unclamped)
{
float3 p = co;
float value = 1.0f;
float pwr = 1.0f;
const float pwHL = powf(lacunarity, -H);
+ const float octaves = CLAMPIS(octaves_unclamped, 0.0f, 15.0f);
+
for (int i = 0; i < (int)octaves; i++) {
value *= (pwr * perlin_signed(p) + 1.0f);
pwr *= pwHL;
@@ -1189,7 +1220,7 @@ float musgrave_multi_fractal(const float3 co,
float musgrave_hetero_terrain(const float3 co,
const float H,
const float lacunarity,
- const float octaves,
+ const float octaves_unclamped,
const float offset)
{
float3 p = co;
@@ -1200,6 +1231,8 @@ float musgrave_hetero_terrain(const float3 co,
float value = offset + perlin_signed(p);
p *= lacunarity;
+ const float octaves = CLAMPIS(octaves_unclamped, 0.0f, 15.0f);
+
for (int i = 1; i < (int)octaves; i++) {
float increment = (perlin_signed(p) + offset) * pwr * value;
value += increment;
@@ -1227,7 +1260,7 @@ float musgrave_hetero_terrain(const float3 co,
float musgrave_hybrid_multi_fractal(const float3 co,
const float H,
const float lacunarity,
- const float octaves,
+ const float octaves_unclamped,
const float offset,
const float gain)
{
@@ -1239,6 +1272,8 @@ float musgrave_hybrid_multi_fractal(const float3 co,
float weight = gain * value;
p *= lacunarity;
+ const float octaves = CLAMPIS(octaves_unclamped, 0.0f, 15.0f);
+
for (int i = 1; (weight > 0.001f) && (i < (int)octaves); i++) {
if (weight > 1.0f) {
weight = 1.0f;
@@ -1270,7 +1305,7 @@ float musgrave_hybrid_multi_fractal(const float3 co,
float musgrave_ridged_multi_fractal(const float3 co,
const float H,
const float lacunarity,
- const float octaves,
+ const float octaves_unclamped,
const float offset,
const float gain)
{
@@ -1283,6 +1318,8 @@ float musgrave_ridged_multi_fractal(const float3 co,
float value = signal;
float weight = 1.0f;
+ const float octaves = CLAMPIS(octaves_unclamped, 0.0f, 15.0f);
+
for (int i = 1; i < (int)octaves; i++) {
p *= lacunarity;
weight = CLAMPIS(signal * gain, 0.0f, 1.0f);
@@ -1305,13 +1342,18 @@ float musgrave_ridged_multi_fractal(const float3 co,
* from "Texturing and Modelling: A procedural approach"
*/
-float musgrave_fBm(const float4 co, const float H, const float lacunarity, const float octaves)
+float musgrave_fBm(const float4 co,
+ const float H,
+ const float lacunarity,
+ const float octaves_unclamped)
{
float4 p = co;
float value = 0.0f;
float pwr = 1.0f;
const float pwHL = powf(lacunarity, -H);
+ const float octaves = CLAMPIS(octaves_unclamped, 0.0f, 15.0f);
+
for (int i = 0; i < (int)octaves; i++) {
value += perlin_signed(p) * pwr;
pwr *= pwHL;
@@ -1336,13 +1378,15 @@ float musgrave_fBm(const float4 co, const float H, const float lacunarity, const
float musgrave_multi_fractal(const float4 co,
const float H,
const float lacunarity,
- const float octaves)
+ const float octaves_unclamped)
{
float4 p = co;
float value = 1.0f;
float pwr = 1.0f;
const float pwHL = powf(lacunarity, -H);
+ const float octaves = CLAMPIS(octaves_unclamped, 0.0f, 15.0f);
+
for (int i = 0; i < (int)octaves; i++) {
value *= (pwr * perlin_signed(p) + 1.0f);
pwr *= pwHL;
@@ -1368,7 +1412,7 @@ float musgrave_multi_fractal(const float4 co,
float musgrave_hetero_terrain(const float4 co,
const float H,
const float lacunarity,
- const float octaves,
+ const float octaves_unclamped,
const float offset)
{
float4 p = co;
@@ -1379,6 +1423,8 @@ float musgrave_hetero_terrain(const float4 co,
float value = offset + perlin_signed(p);
p *= lacunarity;
+ const float octaves = CLAMPIS(octaves_unclamped, 0.0f, 15.0f);
+
for (int i = 1; i < (int)octaves; i++) {
float increment = (perlin_signed(p) + offset) * pwr * value;
value += increment;
@@ -1406,7 +1452,7 @@ float musgrave_hetero_terrain(const float4 co,
float musgrave_hybrid_multi_fractal(const float4 co,
const float H,
const float lacunarity,
- const float octaves,
+ const float octaves_unclamped,
const float offset,
const float gain)
{
@@ -1418,6 +1464,8 @@ float musgrave_hybrid_multi_fractal(const float4 co,
float weight = gain * value;
p *= lacunarity;
+ const float octaves = CLAMPIS(octaves_unclamped, 0.0f, 15.0f);
+
for (int i = 1; (weight > 0.001f) && (i < (int)octaves); i++) {
if (weight > 1.0f) {
weight = 1.0f;
@@ -1449,7 +1497,7 @@ float musgrave_hybrid_multi_fractal(const float4 co,
float musgrave_ridged_multi_fractal(const float4 co,
const float H,
const float lacunarity,
- const float octaves,
+ const float octaves_unclamped,
const float offset,
const float gain)
{
@@ -1462,6 +1510,8 @@ float musgrave_ridged_multi_fractal(const float4 co,
float value = signal;
float weight = 1.0f;
+ const float octaves = CLAMPIS(octaves_unclamped, 0.0f, 15.0f);
+
for (int i = 1; i < (int)octaves; i++) {
p *= lacunarity;
weight = CLAMPIS(signal * gain, 0.0f, 1.0f);
diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_fractal_noise.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_fractal_noise.glsl
index f25691c1a83..95f2be4bd44 100644
--- a/source/blender/gpu/shaders/material/gpu_shader_material_fractal_noise.glsl
+++ b/source/blender/gpu/shaders/material/gpu_shader_material_fractal_noise.glsl
@@ -5,7 +5,7 @@ float fractal_noise(float p, float octaves, float roughness)
float amp = 1.0;
float maxamp = 0.0;
float sum = 0.0;
- octaves = clamp(octaves, 0.0, 16.0);
+ octaves = clamp(octaves, 0.0, 15.0);
int n = int(octaves);
for (int i = 0; i <= n; i++) {
float t = noise(fscale * p);
@@ -34,7 +34,7 @@ float fractal_noise(vec2 p, float octaves, float roughness)
float amp = 1.0;
float maxamp = 0.0;
float sum = 0.0;
- octaves = clamp(octaves, 0.0, 16.0);
+ octaves = clamp(octaves, 0.0, 15.0);
int n = int(octaves);
for (int i = 0; i <= n; i++) {
float t = noise(fscale * p);
@@ -63,7 +63,7 @@ float fractal_noise(vec3 p, float octaves, float roughness)
float amp = 1.0;
float maxamp = 0.0;
float sum = 0.0;
- octaves = clamp(octaves, 0.0, 16.0);
+ octaves = clamp(octaves, 0.0, 15.0);
int n = int(octaves);
for (int i = 0; i <= n; i++) {
float t = noise(fscale * p);
@@ -92,7 +92,7 @@ float fractal_noise(vec4 p, float octaves, float roughness)
float amp = 1.0;
float maxamp = 0.0;
float sum = 0.0;
- octaves = clamp(octaves, 0.0, 16.0);
+ octaves = clamp(octaves, 0.0, 15.0);
int n = int(octaves);
for (int i = 0; i <= n; i++) {
float t = noise(fscale * p);
diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_tex_musgrave.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_tex_musgrave.glsl
index 7ecca286acd..586385b7e86 100644
--- a/source/blender/gpu/shaders/material/gpu_shader_material_tex_musgrave.glsl
+++ b/source/blender/gpu/shaders/material/gpu_shader_material_tex_musgrave.glsl
@@ -19,7 +19,7 @@ void node_tex_musgrave_fBm_1d(vec3 co,
{
float p = w * scale;
float H = max(dimension, 1e-5);
- float octaves = clamp(detail, 0.0, 16.0);
+ float octaves = clamp(detail, 0.0, 15.0);
float lacunarity = max(lac, 1e-5);
float value = 0.0;
@@ -59,7 +59,7 @@ void node_tex_musgrave_multi_fractal_1d(vec3 co,
{
float p = w * scale;
float H = max(dimension, 1e-5);
- float octaves = clamp(detail, 0.0, 16.0);
+ float octaves = clamp(detail, 0.0, 15.0);
float lacunarity = max(lac, 1e-5);
float value = 1.0;
@@ -100,7 +100,7 @@ void node_tex_musgrave_hetero_terrain_1d(vec3 co,
{
float p = w * scale;
float H = max(dimension, 1e-5);
- float octaves = clamp(detail, 0.0, 16.0);
+ float octaves = clamp(detail, 0.0, 15.0);
float lacunarity = max(lac, 1e-5);
float pwHL = pow(lacunarity, -H);
@@ -146,7 +146,7 @@ void node_tex_musgrave_hybrid_multi_fractal_1d(vec3 co,
{
float p = w * scale;
float H = max(dimension, 1e-5);
- float octaves = clamp(detail, 0.0, 16.0);
+ float octaves = clamp(detail, 0.0, 15.0);
float lacunarity = max(lac, 1e-5);
float pwHL = pow(lacunarity, -H);
@@ -196,7 +196,7 @@ void node_tex_musgrave_ridged_multi_fractal_1d(vec3 co,
{
float p = w * scale;
float H = max(dimension, 1e-5);
- float octaves = clamp(detail, 0.0, 16.0);
+ float octaves = clamp(detail, 0.0, 15.0);
float lacunarity = max(lac, 1e-5);
float pwHL = pow(lacunarity, -H);
@@ -241,7 +241,7 @@ void node_tex_musgrave_fBm_2d(vec3 co,
{
vec2 p = co.xy * scale;
float H = max(dimension, 1e-5);
- float octaves = clamp(detail, 0.0, 16.0);
+ float octaves = clamp(detail, 0.0, 15.0);
float lacunarity = max(lac, 1e-5);
float value = 0.0;
@@ -281,7 +281,7 @@ void node_tex_musgrave_multi_fractal_2d(vec3 co,
{
vec2 p = co.xy * scale;
float H = max(dimension, 1e-5);
- float octaves = clamp(detail, 0.0, 16.0);
+ float octaves = clamp(detail, 0.0, 15.0);
float lacunarity = max(lac, 1e-5);
float value = 1.0;
@@ -322,7 +322,7 @@ void node_tex_musgrave_hetero_terrain_2d(vec3 co,
{
vec2 p = co.xy * scale;
float H = max(dimension, 1e-5);
- float octaves = clamp(detail, 0.0, 16.0);
+ float octaves = clamp(detail, 0.0, 15.0);
float lacunarity = max(lac, 1e-5);
float pwHL = pow(lacunarity, -H);
@@ -368,7 +368,7 @@ void node_tex_musgrave_hybrid_multi_fractal_2d(vec3 co,
{
vec2 p = co.xy * scale;
float H = max(dimension, 1e-5);
- float octaves = clamp(detail, 0.0, 16.0);
+ float octaves = clamp(detail, 0.0, 15.0);
float lacunarity = max(lac, 1e-5);
float pwHL = pow(lacunarity, -H);
@@ -418,7 +418,7 @@ void node_tex_musgrave_ridged_multi_fractal_2d(vec3 co,
{
vec2 p = co.xy * scale;
float H = max(dimension, 1e-5);
- float octaves = clamp(detail, 0.0, 16.0);
+ float octaves = clamp(detail, 0.0, 15.0);
float lacunarity = max(lac, 1e-5);
float pwHL = pow(lacunarity, -H);
@@ -463,7 +463,7 @@ void node_tex_musgrave_fBm_3d(vec3 co,
{
vec3 p = co * scale;
float H = max(dimension, 1e-5);
- float octaves = clamp(detail, 0.0, 16.0);
+ float octaves = clamp(detail, 0.0, 15.0);
float lacunarity = max(lac, 1e-5);
float value = 0.0;
@@ -503,7 +503,7 @@ void node_tex_musgrave_multi_fractal_3d(vec3 co,
{
vec3 p = co * scale;
float H = max(dimension, 1e-5);
- float octaves = clamp(detail, 0.0, 16.0);
+ float octaves = clamp(detail, 0.0, 15.0);
float lacunarity = max(lac, 1e-5);
float value = 1.0;
@@ -544,7 +544,7 @@ void node_tex_musgrave_hetero_terrain_3d(vec3 co,
{
vec3 p = co * scale;
float H = max(dimension, 1e-5);
- float octaves = clamp(detail, 0.0, 16.0);
+ float octaves = clamp(detail, 0.0, 15.0);
float lacunarity = max(lac, 1e-5);
float pwHL = pow(lacunarity, -H);
@@ -590,7 +590,7 @@ void node_tex_musgrave_hybrid_multi_fractal_3d(vec3 co,
{
vec3 p = co * scale;
float H = max(dimension, 1e-5);
- float octaves = clamp(detail, 0.0, 16.0);
+ float octaves = clamp(detail, 0.0, 15.0);
float lacunarity = max(lac, 1e-5);
float pwHL = pow(lacunarity, -H);
@@ -640,7 +640,7 @@ void node_tex_musgrave_ridged_multi_fractal_3d(vec3 co,
{
vec3 p = co * scale;
float H = max(dimension, 1e-5);
- float octaves = clamp(detail, 0.0, 16.0);
+ float octaves = clamp(detail, 0.0, 15.0);
float lacunarity = max(lac, 1e-5);
float pwHL = pow(lacunarity, -H);
@@ -685,7 +685,7 @@ void node_tex_musgrave_fBm_4d(vec3 co,
{
vec4 p = vec4(co, w) * scale;
float H = max(dimension, 1e-5);
- float octaves = clamp(detail, 0.0, 16.0);
+ float octaves = clamp(detail, 0.0, 15.0);
float lacunarity = max(lac, 1e-5);
float value = 0.0;
@@ -725,7 +725,7 @@ void node_tex_musgrave_multi_fractal_4d(vec3 co,
{
vec4 p = vec4(co, w) * scale;
float H = max(dimension, 1e-5);
- float octaves = clamp(detail, 0.0, 16.0);
+ float octaves = clamp(detail, 0.0, 15.0);
float lacunarity = max(lac, 1e-5);
float value = 1.0;
@@ -766,7 +766,7 @@ void node_tex_musgrave_hetero_terrain_4d(vec3 co,
{
vec4 p = vec4(co, w) * scale;
float H = max(dimension, 1e-5);
- float octaves = clamp(detail, 0.0, 16.0);
+ float octaves = clamp(detail, 0.0, 15.0);
float lacunarity = max(lac, 1e-5);
float pwHL = pow(lacunarity, -H);
@@ -812,7 +812,7 @@ void node_tex_musgrave_hybrid_multi_fractal_4d(vec3 co,
{
vec4 p = vec4(co, w) * scale;
float H = max(dimension, 1e-5);
- float octaves = clamp(detail, 0.0, 16.0);
+ float octaves = clamp(detail, 0.0, 15.0);
float lacunarity = max(lac, 1e-5);
float pwHL = pow(lacunarity, -H);
@@ -862,7 +862,7 @@ void node_tex_musgrave_ridged_multi_fractal_4d(vec3 co,
{
vec4 p = vec4(co, w) * scale;
float H = max(dimension, 1e-5);
- float octaves = clamp(detail, 0.0, 16.0);
+ float octaves = clamp(detail, 0.0, 15.0);
float lacunarity = max(lac, 1e-5);
float pwHL = pow(lacunarity, -H);
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.cc b/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.cc
index 3bf4e24ed53..81f9cd735eb 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.cc
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.cc
@@ -29,7 +29,7 @@ static void sh_node_tex_musgrave_declare(NodeDeclarationBuilder &b)
b.add_input<decl::Vector>(N_("Vector")).hide_value().implicit_field();
b.add_input<decl::Float>(N_("W")).min(-1000.0f).max(1000.0f);
b.add_input<decl::Float>(N_("Scale")).min(-1000.0f).max(1000.0f).default_value(5.0f);
- b.add_input<decl::Float>(N_("Detail")).min(0.0f).max(16.0f).default_value(2.0f);
+ b.add_input<decl::Float>(N_("Detail")).min(0.0f).max(15.0f).default_value(2.0f);
b.add_input<decl::Float>(N_("Dimension")).min(0.0f).max(1000.0f).default_value(2.0f);
b.add_input<decl::Float>(N_("Lacunarity")).min(0.0f).max(1000.0f).default_value(2.0f);
b.add_input<decl::Float>(N_("Offset")).min(-1000.0f).max(1000.0f);
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc b/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc
index 72892c32795..d28095edb96 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc
@@ -29,7 +29,7 @@ static void sh_node_tex_noise_declare(NodeDeclarationBuilder &b)
b.add_input<decl::Vector>(N_("Vector")).implicit_field();
b.add_input<decl::Float>(N_("W")).min(-1000.0f).max(1000.0f);
b.add_input<decl::Float>(N_("Scale")).min(-1000.0f).max(1000.0f).default_value(5.0f);
- b.add_input<decl::Float>(N_("Detail")).min(0.0f).max(16.0f).default_value(2.0f);
+ b.add_input<decl::Float>(N_("Detail")).min(0.0f).max(15.0f).default_value(2.0f);
b.add_input<decl::Float>(N_("Roughness"))
.min(0.0f)
.max(1.0f)
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_wave.cc b/source/blender/nodes/shader/nodes/node_shader_tex_wave.cc
index 144aa1885bd..fe534c605e9 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_wave.cc
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_wave.cc
@@ -29,7 +29,7 @@ static void sh_node_tex_wave_declare(NodeDeclarationBuilder &b)
b.add_input<decl::Vector>(N_("Vector")).implicit_field();
b.add_input<decl::Float>(N_("Scale")).min(-1000.0f).max(1000.0f).default_value(5.0f);
b.add_input<decl::Float>(N_("Distortion")).min(-1000.0f).max(1000.0f).default_value(0.0f);
- b.add_input<decl::Float>(N_("Detail")).min(0.0f).max(16.0f).default_value(2.0f);
+ b.add_input<decl::Float>(N_("Detail")).min(0.0f).max(15.0f).default_value(2.0f);
b.add_input<decl::Float>(N_("Detail Scale")).min(-1000.0f).max(1000.0f).default_value(1.0f);
b.add_input<decl::Float>(N_("Detail Roughness"))
.min(0.0f)