[Bf-blender-cvs] [6ef5bc1b99b] blender2.8: Cleanup: node_tex_checker: Vectorize operation in GLSL

Clément Foucault noreply at git.blender.org
Thu Oct 18 15:30:20 CEST 2018


Commit: 6ef5bc1b99be97e60225fd643d4faff102063414
Author: Clément Foucault
Date:   Thu Oct 18 15:17:21 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB6ef5bc1b99be97e60225fd643d4faff102063414

Cleanup: node_tex_checker: Vectorize operation in GLSL

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

M	source/blender/gpu/shaders/gpu_shader_material.glsl

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

diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl
index 64f04e5b1fe..7b4748056a7 100644
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@ -1859,9 +1859,7 @@ void node_tex_checker(vec3 co, vec4 color1, vec4 color2, float scale, out vec4 c
 	vec3 p = co * scale;
 
 	/* Prevent precision issues on unit coordinates. */
-	p.x = (p.x + 0.000001) * 0.999999;
-	p.y = (p.y + 0.000001) * 0.999999;
-	p.z = (p.z + 0.000001) * 0.999999;
+	p = (p + 0.000001) * 0.999999;
 
 	int xi = int(abs(floor(p.x)));
 	int yi = int(abs(floor(p.y)));



More information about the Bf-blender-cvs mailing list