[Bf-blender-cvs] [dfe22a53bb8] master: Fix T95003: Shader issue using voronoi noise.

Jeroen Bakker noreply at git.blender.org
Tue Jan 18 14:32:30 CET 2022


Commit: dfe22a53bb8d3d2b94f4c80ec4030d28028e9ca6
Author: Jeroen Bakker
Date:   Tue Jan 18 14:29:46 2022 +0100
Branches: master
https://developer.blender.org/rBdfe22a53bb8d3d2b94f4c80ec4030d28028e9ca6

Fix T95003: Shader issue using voronoi noise.

Cause of the issue isn't that clear, but the NVIDIA GLSL compiler
complained that it couldn't find an overloaded function when the second
parameter is an interger. This change fixes it by using a float.

===================================================================

M	source/blender/gpu/shaders/material/gpu_shader_material_tex_voronoi.glsl

===================================================================

diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_tex_voronoi.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_tex_voronoi.glsl
index 0f69a4b9aa0..c8219848e29 100644
--- a/source/blender/gpu/shaders/material/gpu_shader_material_tex_voronoi.glsl
+++ b/source/blender/gpu/shaders/material/gpu_shader_material_tex_voronoi.glsl
@@ -72,7 +72,7 @@ void node_tex_voronoi_smooth_f1_1d(vec3 coord,
                                    out float outRadius)
 {
   randomness = clamp(randomness, 0.0, 1.0);
-  smoothness = clamp(smoothness / 2.0, 0, 0.5);
+  smoothness = clamp(smoothness / 2.0, 0.0, 0.5);
 
   float scaledCoord = w * scale;
   float cellPosition = floor(scaledCoord);
@@ -301,7 +301,7 @@ void node_tex_voronoi_smooth_f1_2d(vec3 coord,
                                    out float outRadius)
 {
   randomness = clamp(randomness, 0.0, 1.0);
-  smoothness = clamp(smoothness / 2.0, 0, 0.5);
+  smoothness = clamp(smoothness / 2.0, 0.0, 0.5);
 
   vec2 scaledCoord = coord.xy * scale;
   vec2 cellPosition = floor(scaledCoord);
@@ -565,7 +565,7 @@ void node_tex_voronoi_smooth_f1_3d(vec3 coord,
                                    out float outRadius)
 {
   randomness = clamp(randomness, 0.0, 1.0);
-  smoothness = clamp(smoothness / 2.0, 0, 0.5);
+  smoothness = clamp(smoothness / 2.0, 0.0, 0.5);
 
   vec3 scaledCoord = coord * scale;
   vec3 cellPosition = floor(scaledCoord);
@@ -852,7 +852,7 @@ void node_tex_voronoi_smooth_f1_4d(vec3 coord,
                                    out float outRadius)
 {
   randomness = clamp(randomness, 0.0, 1.0);
-  smoothness = clamp(smoothness / 2.0, 0, 0.5);
+  smoothness = clamp(smoothness / 2.0, 0.0, 0.5);
 
   vec4 scaledCoord = vec4(coord, w) * scale;
   vec4 cellPosition = floor(scaledCoord);



More information about the Bf-blender-cvs mailing list