Browse Source

Round doesn't work for OpenGL 2.1 because it was only added in glsl 130.

So mad at myself right now >:-(
Part of the further fallout of CURA-7147
Remco Burema 4 years ago
parent
commit
7ed59503d6
1 changed files with 1 additions and 1 deletions
  1. 1 1
      resources/shaders/overhang.shader

+ 1 - 1
resources/shaders/overhang.shader

@@ -70,7 +70,7 @@ fragment =
 
         if(u_renderError > 0.5)
         {
-            vec3 grid = vec3(f_vertex.x - round(f_vertex.x), f_vertex.y - round(f_vertex.y), f_vertex.z - round(f_vertex.z));
+            vec3 grid = vec3(f_vertex.x - floor(f_vertex.x - 0.5), f_vertex.y - floor(f_vertex.y - 0.5), f_vertex.z - floor(f_vertex.z - 0.5));
             finalColor.a = dot(grid, grid) < 0.245 ? 0.667 : 1.0;
         }
         gl_FragColor = finalColor;