summaryrefslogtreecommitdiff
path: root/gfx/gl/shaders
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-09-07 12:35:03 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-09-07 12:35:03 +0100
commit5ec74c35fb1f2524add7fd03ace78667f93edb2e (patch)
treee8c560b6713aac68cc97bd957b5ffa8015ab75a0 /gfx/gl/shaders
parentPopulate all layers of the stencil texture (diff)
downloadilt-5ec74c35fb1f2524add7fd03ace78667f93edb2e.tar.bz2
ilt-5ec74c35fb1f2524add7fd03ace78667f93edb2e.tar.xz
ilt-5ec74c35fb1f2524add7fd03ace78667f93edb2e.zip
Populate all layers of shadow stencil with view from all around
Diffstat (limited to 'gfx/gl/shaders')
-rw-r--r--gfx/gl/shaders/shadowStencil.gs6
1 files changed, 3 insertions, 3 deletions
diff --git a/gfx/gl/shaders/shadowStencil.gs b/gfx/gl/shaders/shadowStencil.gs
index eea4643..2c3f9bd 100644
--- a/gfx/gl/shaders/shadowStencil.gs
+++ b/gfx/gl/shaders/shadowStencil.gs
@@ -6,7 +6,7 @@ include(`materialDetail.glsl')
layout(triangles) in;
layout(triangle_strip, max_vertices = 24) out;
-uniform mat4 viewProjection;
+uniform mat4 viewProjection[8];
in vec3 FragPos[];
in vec2 TexCoords[];
flat in MaterialDetail Material[];
@@ -16,9 +16,9 @@ flat out MaterialDetail gMaterial;
void
main()
{
- for (gl_Layer = 0; gl_Layer < 8; ++gl_Layer) {
+ for (gl_Layer = 0; gl_Layer < viewProjection.length(); ++gl_Layer) {
for (int v = 0; v < FragPos.length(); ++v) {
- gl_Position = viewProjection * vec4(FragPos[v], 1);
+ gl_Position = viewProjection[gl_Layer] * vec4(FragPos[v], 1);
gTexCoords = TexCoords[v];
gMaterial = Material[v];
EmitVertex();