From 425add81fc8718f1ac4fde48a71344cd332d5a58 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 7 Jul 2024 20:10:24 +0100 Subject: Add shadow shader which takes into account texture transparency --- gfx/gl/shaders/shadowDynamicPointInstWithTextures.fs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 gfx/gl/shaders/shadowDynamicPointInstWithTextures.fs (limited to 'gfx/gl/shaders/shadowDynamicPointInstWithTextures.fs') diff --git a/gfx/gl/shaders/shadowDynamicPointInstWithTextures.fs b/gfx/gl/shaders/shadowDynamicPointInstWithTextures.fs new file mode 100644 index 0000000..90519e3 --- /dev/null +++ b/gfx/gl/shaders/shadowDynamicPointInstWithTextures.fs @@ -0,0 +1,15 @@ +#version 330 core +#extension GL_ARB_shading_language_420pack : enable + +layout(binding = 3) uniform sampler2D texture0; + +in vec2 texCoord; + +void +main() +{ + if (texture(texture0, texCoord).a < 0.5) { + discard; + } + gl_FragDepth = gl_FragCoord.z; +} -- cgit v1.2.3