ADD: CSM half-working
This commit is contained in:
@@ -18,12 +18,14 @@ layout(buffer_reference, std430) readonly buffer VertexBuffer{
|
||||
layout(push_constant) uniform PushConsts {
|
||||
mat4 render_matrix;
|
||||
VertexBuffer vertexBuffer;
|
||||
uint cascadeIndex;
|
||||
} PC;
|
||||
|
||||
void main()
|
||||
{
|
||||
Vertex v = PC.vertexBuffer.vertices[gl_VertexIndex];
|
||||
vec4 worldPos = PC.render_matrix * vec4(v.position, 1.0);
|
||||
gl_Position = sceneData.lightViewProj * worldPos;
|
||||
uint ci = min(PC.cascadeIndex, uint(MAX_CASCADES-1));
|
||||
gl_Position = sceneData.lightViewProjCascades[ci] * worldPos;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user