summaryrefslogtreecommitdiff
path: root/gfx/gl/shaders/shadowDynamicPointStencil.gs
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-09-01 18:42:27 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-09-01 18:42:27 +0100
commit7299b08977acafe7eeba620f229a7169256f23cf (patch)
tree6c5bf1879720feecfb1d9ee0dcfcb95a1b80b3e2 /gfx/gl/shaders/shadowDynamicPointStencil.gs
parentUse billboard shadows for foliage (diff)
downloadilt-7299b08977acafe7eeba620f229a7169256f23cf.tar.bz2
ilt-7299b08977acafe7eeba620f229a7169256f23cf.tar.xz
ilt-7299b08977acafe7eeba620f229a7169256f23cf.zip
Extend depth of shadow box 10m to allow for depth offsets and clamp stencil to it
Diffstat (limited to 'gfx/gl/shaders/shadowDynamicPointStencil.gs')
-rw-r--r--gfx/gl/shaders/shadowDynamicPointStencil.gs1
1 files changed, 1 insertions, 0 deletions
diff --git a/gfx/gl/shaders/shadowDynamicPointStencil.gs b/gfx/gl/shaders/shadowDynamicPointStencil.gs
index 6d707ae..2873691 100644
--- a/gfx/gl/shaders/shadowDynamicPointStencil.gs
+++ b/gfx/gl/shaders/shadowDynamicPointStencil.gs
@@ -24,6 +24,7 @@ main()
vec4 pos = viewProjection[gl_Layer] * vec4(vworldPos[0], 1);
for (int c = 0; c < corners.length(); ++c) {
gl_Position = pos + vec4(scale.xy * corners[c], 0, 0);
+ gl_Position.z = max(gl_Position.z, -1);
texCoord = (corners[c] * 0.5) + 0.5;
EmitVertex();
}