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:
authorClément Foucault <foucault.clem@gmail.com>2019-04-26 19:37:17 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-04-26 19:37:24 +0300
commit1fa7d51f342a07febac102d381fd3075efc78e2b (patch)
treec2c61bd5a9710d51d40375a38f7a2f04a0f235de
parent941575b1f7ddbb981a35167c2fda29db4a41cf96 (diff)
Eevee: Noise Texture: try to fix floating point accuracy issue
Cycles check for infinity and return 0.0 otherwise.
-rw-r--r--source/blender/gpu/shaders/gpu_shader_material.glsl4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl
index 6ad93e88130..36c4138cefd 100644
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@ -2771,7 +2771,9 @@ float noise_perlin(float x, float y, float z)
noise_v[1] = noise_nerp(v, noise_u[0], noise_u[1]);
- return noise_scale3(noise_nerp(w, noise_v[0], noise_v[1]));
+ float r = noise_scale3(noise_nerp(w, noise_v[0], noise_v[1]));
+
+ return (isinf(r)) ? 0.0 : r;
}
float noise(vec3 p)