ToyEngine/Demo/Engine/Shaders/model_shadow.geom

24 lines
473 B
GLSL

#version 450 core
layout(triangles, invocations = 5) in;
layout(triangle_strip, max_vertices = 3) out;
layout (std140, binding = 0) uniform LightSpaceMatrices
{
mat4 lightSpaceMatrices[16];
};
in vec2 vTexCoords[];
out vec2 TexCoords;
void main()
{
for (int i = 0; i < 3; ++i)
{
TexCoords = vTexCoords[i];
gl_Position = lightSpaceMatrices[gl_InvocationID] * gl_in[i].gl_Position;
gl_Layer = gl_InvocationID;
EmitVertex();
}
EndPrimitive();
}