diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-13 17:53:38 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-13 17:53:38 +0100 |
commit | 2f5a53d9dfec54bd33609dbe5a0af44c565d8069 (patch) | |
tree | 400beb176df2d2abd7104fdb0f58d4e139ab9cd5 | |
parent | Use texture atlas for asset factory (diff) | |
download | ilt-2f5a53d9dfec54bd33609dbe5a0af44c565d8069.tar.bz2 ilt-2f5a53d9dfec54bd33609dbe5a0af44c565d8069.tar.xz ilt-2f5a53d9dfec54bd33609dbe5a0af44c565d8069.zip |
Adjust gl_FragDepth according to texel opacity
-rw-r--r-- | gfx/gl/shaders/basicShader.fs | 1 |
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); } |