Add alternate shadow volume rendering pathway (layered geo)

This commit is contained in:
2023-03-12 09:29:36 +00:00
parent 184df01ff8
commit b88a8d5776
7 changed files with 52 additions and 53 deletions
+16 -8
View File
@@ -1,6 +1,6 @@
#version 450 core
layout (triangles) in;
layout (triangle_strip, max_vertices = 3) out;
layout (points) in;
layout (triangle_strip, max_vertices = 4) out;
layout (invocations = 20) in;
layout (std140, binding = 1) uniform LightsBlock
{
@@ -8,18 +8,26 @@ layout (std140, binding = 1) uniform LightsBlock
vec4 colRad[20];
} ;
float theBool = posBool[gl_InvocationID].w;
in vec2 vTexPos[];
out vec2 gTexPos;
void main()
{
if (theBool == 1){
for (int i = 0; i < 3; i++)
{
gTexPos = vTexPos[i];
gTexPos = vec2(0,1);
gl_Position = vec4(-1,1,0,1) ;
gl_Layer = gl_InvocationID;
EmitVertex();
gTexPos = vec2(0,0);
gl_Position = vec4(-1,-1,0,1) ;
gl_Layer = gl_InvocationID;
EmitVertex();
gTexPos = vec2(1,1);
gl_Position = vec4(1,1,0,1) ;
gl_Layer = gl_InvocationID;
EmitVertex();
gTexPos = vec2(1,0);
gl_Position = vec4(1,-1,0,1) ;
gl_Layer = gl_InvocationID;
gl_Position = gl_in[i].gl_Position;
EmitVertex();
}
EndPrimitive();
}else {}
}