quakeforge/libs/video/renderer/vulkan/shader/shadow.geom
Bill Currie 8c03ed8be5 [vulkan] Start work on shadows
This gets the shaders needed for creating shadow maps, and the changes
to the lighting pipeline for binding the shadow maps, but no generation
or reading is done yet. It feels like parts of various systems are
getting a little big for their britches and I need to do an audit of
various things.
2021-04-24 10:40:39 +09:00

25 lines
465 B
GLSL

#version 450
layout (triangles) in;
layout (triangle_strip, max_vertices = 3) out;
layout (constant_id = 0) const int MaxLights = 128;
layout (set = 0, binding = 0) uniform UBO {
mat4 vp[MaxLights];
} ubo;
layout (location = 0) in int InstanceIndex[];
void
main (void)
{
int index = InstanceIndex[0];
for (int i = 0; i < gl_in.length(); i++) {
gl_Layer = index;
gl_Position = ubo.vp[index] * gl_in[i].gl_Position;
EmitVertex();
}
EndPrimitive();
}