summaryrefslogtreecommitdiff
path: root/gfx/gl/shaders/basicShader.fs
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-03-14 01:00:08 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-03-14 01:00:08 +0000
commit14e1b0def33339f2221f1101e115d0aff69727ad (patch)
tree6df7a8c9a9bd57f7582565562e21bc3684fbd177 /gfx/gl/shaders/basicShader.fs
parentDedupe applying style to a face (diff)
downloadilt-14e1b0def33339f2221f1101e115d0aff69727ad.tar.bz2
ilt-14e1b0def33339f2221f1101e115d0aff69727ad.tar.xz
ilt-14e1b0def33339f2221f1101e115d0aff69727ad.zip
Basic fragment ahader should use final colour to determine clear flag
Diffstat (limited to 'gfx/gl/shaders/basicShader.fs')
-rw-r--r--gfx/gl/shaders/basicShader.fs5
1 files changed, 3 insertions, 2 deletions
diff --git a/gfx/gl/shaders/basicShader.fs b/gfx/gl/shaders/basicShader.fs
index 93f0a3f..24b2791 100644
--- a/gfx/gl/shaders/basicShader.fs
+++ b/gfx/gl/shaders/basicShader.fs
@@ -14,8 +14,9 @@ uniform sampler2D texture0;
void
main()
{
- float clear = round(texture(texture0, TexCoords).a);
+ vec4 textureColour = texture(texture0, TexCoords);
+ float clear = round(mix(textureColour.a, 1, Colour.a));
gPosition = vec4(FragPos, clear);
gNormal = vec4(Normal, clear);
- gAlbedoSpec = mix(texture(texture0, TexCoords), vec4(Colour.rgb, 1), Colour.a);
+ gAlbedoSpec = mix(textureColour, vec4(Colour.rgb, 1), Colour.a);
}