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

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