From dfe22a53bb8d3d2b94f4c80ec4030d28028e9ca6 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Tue, 18 Jan 2022 14:29:46 +0100 Subject: 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. --- .../gpu/shaders/material/gpu_shader_material_tex_voronoi.glsl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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); -- cgit v1.2.3