43 lines
767 B
GLSL
43 lines
767 B
GLSL
layout(triangles) in;
|
|
|
|
#ifdef POINT_LIGHT
|
|
|
|
// inspired from
|
|
// http://learnopengl.com/#!Advanced-Lighting/Shadows/Point-Shadows
|
|
|
|
layout(triangle_strip, max_vertices = 18) out;
|
|
|
|
uniform mat4 layerTransform[6];
|
|
|
|
out vec4 fragPos;
|
|
|
|
// debug parameter
|
|
flat out int fcolor_idx;
|
|
|
|
void main(void){
|
|
for (int layerId = 0; layerId < 6; ++layerId)
|
|
{
|
|
gl_Layer = layerId;
|
|
fcolor_idx = layerId;
|
|
for (int i = 0; i < 3; ++i)
|
|
{
|
|
gl_Position = layerTransform[layerId] * gl_in[i].gl_Position;
|
|
EmitVertex();
|
|
}
|
|
EndPrimitive();
|
|
}
|
|
}
|
|
|
|
#elif defined CASCADED
|
|
|
|
layout(triangle_strip, max_vertices = 9) out;
|
|
|
|
uniform mat4 frontShadowMVP;
|
|
uniform mat4 midShadowMVP;
|
|
uniform mat4 backShadowMVP;
|
|
|
|
// TODO
|
|
|
|
#endif
|
|
|