diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-08-28 03:48:19 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-08-28 03:48:19 +0100 |
commit | ae9087aea7aa2b19bf78daa6593d14dfba98183d (patch) | |
tree | 0263fd2580239c9ac55a4cc775b2a3c3e3f14eb7 /gfx/gl/shaders/shadowDynamicPointStencil.fs | |
parent | Set stencil texture min/mag filters (diff) | |
download | ilt-ae9087aea7aa2b19bf78daa6593d14dfba98183d.tar.bz2 ilt-ae9087aea7aa2b19bf78daa6593d14dfba98183d.tar.xz ilt-ae9087aea7aa2b19bf78daa6593d14dfba98183d.zip |
Initial cut of shadow map creation with support for billboard shadows
Diffstat (limited to 'gfx/gl/shaders/shadowDynamicPointStencil.fs')
-rw-r--r-- | gfx/gl/shaders/shadowDynamicPointStencil.fs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gfx/gl/shaders/shadowDynamicPointStencil.fs b/gfx/gl/shaders/shadowDynamicPointStencil.fs new file mode 100644 index 0000000..57b8aa3 --- /dev/null +++ b/gfx/gl/shaders/shadowDynamicPointStencil.fs @@ -0,0 +1,16 @@ +#version 330 core +#extension GL_ARB_shading_language_420pack : enable + +layout(binding = 0) uniform sampler2D stencilDepth; +flat in vec3 scale; +in vec2 texCoord; + +void +main() +{ + float stDepth = texture(stencilDepth, texCoord).r; + if (stDepth >= 1) { + discard; + } + gl_FragDepth = gl_FragCoord.z + (stDepth * scale.z); +} |