#version 430 core
layout (triangles) in;
layout (triangle_strip, max_vertices = 4) out;

in vec4 vParams[];

uniform mat4 worldMat;

vec2 lightPos = gl_in[0].gl_Position.xy;
vec2 cornerA  = gl_in[1].gl_Position.xy;
vec2 cornerB  = gl_in[2].gl_Position.xy;

void main()
{
    gl_Position = worldMat * vec4(cornerA, 1, 1 );
    EmitVertex();

    gl_Position = worldMat * (vec4(cornerA, 10, 1 ) + (20,20,0,0));
    gl_Position = vec4(1,0, 10, 1 );
    EmitVertex();

    gl_Position = worldMat * vec4(cornerB, 0, 1 );
    gl_Position = vec4(0,1, -10, 1 );
    EmitVertex();

    gl_Position = worldMat * (vec4(cornerB, 0, 1 ) + (20,20,0,0));
    gl_Position = vec4(1,1, 10, 1 );
    EmitVertex();

    EndPrimitive();
}
