summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-04-13 18:02:28 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2023-04-13 18:02:28 +0100
commit31e2bd9b5738498be3d13dc96cc78f48825a8601 (patch)
tree686b716dc590fd64f673bd553fa2895af88ca37b /gfx
parentAdjust gl_FragDepth according to texel opacity (diff)
downloadilt-31e2bd9b5738498be3d13dc96cc78f48825a8601.tar.bz2
ilt-31e2bd9b5738498be3d13dc96cc78f48825a8601.tar.xz
ilt-31e2bd9b5738498be3d13dc96cc78f48825a8601.zip
Rename clear to opaque as its 1 for solid
Diffstat (limited to 'gfx')
-rw-r--r--gfx/gl/shaders/basicShader.fs8
1 files changed, 4 insertions, 4 deletions
diff --git a/gfx/gl/shaders/basicShader.fs b/gfx/gl/shaders/basicShader.fs
index ff1c822..8a72e6d 100644
--- a/gfx/gl/shaders/basicShader.fs
+++ b/gfx/gl/shaders/basicShader.fs
@@ -21,9 +21,9 @@ void
main()
{
vec4 textureColour = getTextureColour(Material, TexCoords);
- float clear = round(mix(textureColour.a, 1, Colour.a));
- gPosition = vec4(FragPos, clear);
- gNormal = vec4(Normal, clear);
- gl_FragDepth = mix(1.0, gl_FragCoord.z, clear);
+ float opaque = step(0.5, mix(textureColour.a, 1, Colour.a));
+ gPosition = vec4(FragPos, opaque);
+ gNormal = vec4(Normal, opaque);
+ gl_FragDepth = mix(1.0, gl_FragCoord.z, opaque);
gAlbedoSpec = mix(textureColour, vec4(Colour.rgb, 1), Colour.a);
}