Cleanup: node_tex_checker: Vectorize operation in GLSL
authorClément Foucault <foucault.clem@gmail.com>
Thu, 18 Oct 2018 13:17:21 +0000 (15:17 +0200)
committerClément Foucault <foucault.clem@gmail.com>
Thu, 18 Oct 2018 13:30:16 +0000 (15:30 +0200)
source/blender/gpu/shaders/gpu_shader_material.glsl

index 64f04e5b1fe5f64495b09400877002743e43f73d..7b4748056a79c2f8c74b8bf3d7c776b0f170547d 100644 (file)
@@ -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)));