summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-04-13 17:53:38 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2023-04-13 17:53:38 +0100
commit2f5a53d9dfec54bd33609dbe5a0af44c565d8069 (patch)
tree400beb176df2d2abd7104fdb0f58d4e139ab9cd5 /gfx
parentUse texture atlas for asset factory (diff)
downloadilt-2f5a53d9dfec54bd33609dbe5a0af44c565d8069.tar.bz2
ilt-2f5a53d9dfec54bd33609dbe5a0af44c565d8069.tar.xz
ilt-2f5a53d9dfec54bd33609dbe5a0af44c565d8069.zip
Adjust gl_FragDepth according to texel opacity
Diffstat (limited to 'gfx')
-rw-r--r--gfx/gl/shaders/basicShader.fs1
1 files changed, 1 insertions, 0 deletions
diff --git a/gfx/gl/shaders/basicShader.fs b/gfx/gl/shaders/basicShader.fs
index ab5e58b..ff1c822 100644
--- a/gfx/gl/shaders/basicShader.fs
+++ b/gfx/gl/shaders/basicShader.fs
@@ -24,5 +24,6 @@ main()
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);
gAlbedoSpec = mix(textureColour, vec4(Colour.rgb, 1), Colour.a);
}