From 2f5a53d9dfec54bd33609dbe5a0af44c565d8069 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 13 Apr 2023 17:53:38 +0100 Subject: Adjust gl_FragDepth according to texel opacity --- gfx/gl/shaders/basicShader.fs | 1 + 1 file changed, 1 insertion(+) (limited to 'gfx/gl') 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); } -- cgit v1.2.3