summaryrefslogtreecommitdiff
path: root/gfx/gl/shaders
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-09-02 21:00:41 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-09-02 21:00:41 +0100
commit052b2b49d9bfdaaa7f7c5603fa7c47b881df93c2 (patch)
treee1ee5476434ae0855a4970c10e7e8fc88744b30b /gfx/gl/shaders
parentUpdate Texture::getSize and ::size to account for the third texture dimension (diff)
downloadilt-052b2b49d9bfdaaa7f7c5603fa7c47b881df93c2.tar.bz2
ilt-052b2b49d9bfdaaa7f7c5603fa7c47b881df93c2.tar.xz
ilt-052b2b49d9bfdaaa7f7c5603fa7c47b881df93c2.zip
Update stencil texture to 2d array
Diffstat (limited to 'gfx/gl/shaders')
-rw-r--r--gfx/gl/shaders/shadowDynamicPointStencil.fs4
-rw-r--r--gfx/gl/shaders/shadowDynamicPointStencil.gs4
2 files changed, 4 insertions, 4 deletions
diff --git a/gfx/gl/shaders/shadowDynamicPointStencil.fs b/gfx/gl/shaders/shadowDynamicPointStencil.fs
index 57b8aa3..e612691 100644
--- a/gfx/gl/shaders/shadowDynamicPointStencil.fs
+++ b/gfx/gl/shaders/shadowDynamicPointStencil.fs
@@ -1,9 +1,9 @@
#version 330 core
#extension GL_ARB_shading_language_420pack : enable
-layout(binding = 0) uniform sampler2D stencilDepth;
+layout(binding = 0) uniform sampler2DArray stencilDepth;
flat in vec3 scale;
-in vec2 texCoord;
+in vec3 texCoord;
void
main()
diff --git a/gfx/gl/shaders/shadowDynamicPointStencil.gs b/gfx/gl/shaders/shadowDynamicPointStencil.gs
index 2873691..b91937d 100644
--- a/gfx/gl/shaders/shadowDynamicPointStencil.gs
+++ b/gfx/gl/shaders/shadowDynamicPointStencil.gs
@@ -11,7 +11,7 @@ uniform float size;
in ivec3 vworldPos[];
flat out vec3 scale;
-out vec2 texCoord;
+out vec3 texCoord;
layout(points) in;
layout(triangle_strip, max_vertices = 16) out;
@@ -25,7 +25,7 @@ main()
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;
+ texCoord = vec3((corners[c] * 0.5) + 0.5, 0);
EmitVertex();
}
EndPrimitive();