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
This commit is contained in:
Remco Burema 2020-04-22 11:49:27 +02:00
parent 888937d03b
commit 7ed59503d6
No known key found for this signature in database
GPG key ID: 215C49431D43F98C

View file

@ -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;