Work on geometry shader based shadows
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#version 450 core
|
||||
layout (points) in;
|
||||
layout (triangle_strip, max_vertices = 4) out;
|
||||
layout (invocations = 20) in;
|
||||
layout (std140, binding = 1) uniform LightsBlock
|
||||
{
|
||||
vec4 posBool[20];
|
||||
vec4 colRad[20];
|
||||
} ;
|
||||
out vec3 gTexPos;
|
||||
float theBool = posBool[gl_InvocationID].w;
|
||||
float l = gl_InvocationID;
|
||||
void main()
|
||||
{
|
||||
if (theBool == 1){
|
||||
gTexPos = vec3(0,1,l);
|
||||
gl_Position = vec4(-1,1,0,1) ;
|
||||
EmitVertex();
|
||||
gTexPos = vec3(0,0,l);
|
||||
gl_Position = vec4(-1,-1,0,1) ;
|
||||
EmitVertex();
|
||||
gTexPos = vec3(1,1,l);
|
||||
gl_Position = vec4(1,1,0,1) ;
|
||||
EmitVertex();
|
||||
gTexPos = vec3(1,0,l);
|
||||
gl_Position = vec4(1,-1,0,1) ;
|
||||
EmitVertex();
|
||||
EndPrimitive();
|
||||
}else {}
|
||||
}
|
||||
Reference in New Issue
Block a user