diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-07-07 20:10:24 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-07-07 20:10:24 +0100 |
commit | 425add81fc8718f1ac4fde48a71344cd332d5a58 (patch) | |
tree | 7f4bcbd89342b07d2faee1eb00f3f9b804ed5ac2 /gfx/gl/shaders/shadowDynamicPointInstWithTextures.fs | |
parent | Merge branch 'imgui' (diff) | |
download | ilt-425add81fc8718f1ac4fde48a71344cd332d5a58.tar.bz2 ilt-425add81fc8718f1ac4fde48a71344cd332d5a58.tar.xz ilt-425add81fc8718f1ac4fde48a71344cd332d5a58.zip |
Add shadow shader which takes into account texture transparency
Diffstat (limited to 'gfx/gl/shaders/shadowDynamicPointInstWithTextures.fs')
-rw-r--r-- | gfx/gl/shaders/shadowDynamicPointInstWithTextures.fs | 15 |
1 files changed, 15 insertions, 0 deletions
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; +} |