Browse Source

Also change color _on_ the buildplate.

Remco Burema 4 years ago
parent
commit
d7325be39f
2 changed files with 4 additions and 4 deletions
  1. 2 2
      resources/shaders/overhang.shader
  2. 2 2
      resources/shaders/striped.shader

+ 2 - 2
resources/shaders/overhang.shader

@@ -65,7 +65,7 @@ fragment =
 
         highp 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 = (u_renderError > 0.5) && dot(grid, grid) < 0.245 ? 0.667 : 1.0;
-        if (f_vertex.y < 0.0)
+        if (f_vertex.y <= 0.0)
         {
             finalColor.rgb = vec3(1.0, 1.0, 1.0) - finalColor.rgb;
         }
@@ -141,7 +141,7 @@ fragment41core =
         finalColor = (u_faceId != gl_PrimitiveID) ? ((-normal.y > u_overhangAngle) ? u_overhangColor : finalColor) : u_faceColor;
 
         frag_color = finalColor;
-        if (f_vertex.y < 0.0)
+        if (f_vertex.y <= 0.0)
         {
             frag_color.rgb = vec3(1.0, 1.0, 1.0) - frag_color.rgb;
         }

+ 2 - 2
resources/shaders/striped.shader

@@ -64,7 +64,7 @@ fragment =
         highp vec3 viewVector = normalize(u_viewPosition - v_vertex);
         highp float NdotR = clamp(dot(viewVector, reflectedLight), 0.0, 1.0);
         finalColor += pow(NdotR, u_shininess) * u_specularColor;
-        if (v_vertex.y < 0.0)
+        if (v_vertex.y <= 0.0)
         {
             finalColor.rgb = vec3(1.0, 1.0, 1.0) - finalColor.rgb;
         }
@@ -144,7 +144,7 @@ fragment41core =
         finalColor += pow(NdotR, u_shininess) * u_specularColor;
 
         frag_color = finalColor;
-        if (v_vertex.y < 0.0)
+        if (v_vertex.y <= 0.0)
         {
             frag_color.rgb = vec3(1.0, 1.0, 1.0) - frag_color.rgb;
         }