Use different colors below buildplate.

fixes #8254
This commit is contained in:
Remco Burema 2020-09-01 13:49:34 +02:00
parent 72d31d2ae5
commit 8dbbe2bd3a
No known key found for this signature in database
GPG Key ID: 215C49431D43F98C
2 changed files with 16 additions and 0 deletions

View File

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

View File

@ -64,6 +64,10 @@ 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)
{
finalColor.rgb = vec3(1.0, 1.0, 1.0) - finalColor.rgb;
}
gl_FragColor = finalColor;
gl_FragColor.a = u_opacity;
@ -140,6 +144,10 @@ fragment41core =
finalColor += pow(NdotR, u_shininess) * u_specularColor;
frag_color = finalColor;
if (v_vertex.y < 0.0)
{
frag_color.rgb = vec3(1.0, 1.0, 1.0) - frag_color.rgb;
}
frag_color.a = u_opacity;
}