70f89a8bce
Now that we use GS and textures array it's easier to add a cascade. 4 is still not optimal but I'd like to avoid cascade count inflation as much as possible ; 4 x 1024x1024 has the bandwidth requirement of the single 2048x2048 shadowmaps we previously had.
25 lines
404 B
GLSL
25 lines
404 B
GLSL
#version 330 core
|
|
uniform mat4 ModelViewProjectionMatrix[4];
|
|
|
|
layout(triangles) in;
|
|
layout(triangle_strip, max_vertices=12) out;
|
|
|
|
in vec2 tc[3];
|
|
|
|
out vec2 uv;
|
|
|
|
void main(void)
|
|
{
|
|
for (int j = 0; j<4; j++)
|
|
{
|
|
gl_Layer = j;
|
|
for(int i=0; i<3; i++)
|
|
{
|
|
uv = tc[i];
|
|
gl_Position = ModelViewProjectionMatrix[j] * gl_in[i].gl_Position;
|
|
EmitVertex();
|
|
}
|
|
EndPrimitive();
|
|
}
|
|
}
|