2023-06-24 15:59:27 +03:00
|
|
|
#version 450
|
|
|
|
|
|
2024-09-25 16:00:55 +03:00
|
|
|
layout (triangles, invocations = 1) in;
|
2023-06-24 15:59:27 +03:00
|
|
|
layout (triangle_strip, max_vertices = 4) out;
|
|
|
|
|
|
|
|
|
|
void main(void)
|
|
|
|
|
{
|
|
|
|
|
vec4 topLeft = gl_in[0].gl_Position;
|
|
|
|
|
vec4 right = gl_in[1].gl_Position;
|
|
|
|
|
vec4 bottomLeft = gl_in[2].gl_Position;
|
|
|
|
|
|
|
|
|
|
vec4 topRight = vec4(
|
|
|
|
|
right.x,
|
|
|
|
|
topLeft.y,
|
|
|
|
|
topLeft.z,
|
|
|
|
|
topLeft.w
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
vec4 bottomRight = vec4(
|
|
|
|
|
right.x,
|
|
|
|
|
bottomLeft.y,
|
|
|
|
|
topLeft.z,
|
|
|
|
|
topLeft.w
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gl_Position = topLeft;
|
|
|
|
|
EmitVertex();
|
|
|
|
|
|
|
|
|
|
gl_Position = bottomLeft;
|
|
|
|
|
EmitVertex();
|
|
|
|
|
|
|
|
|
|
gl_Position = topRight;
|
|
|
|
|
EmitVertex();
|
|
|
|
|
|
|
|
|
|
gl_Position = bottomRight;
|
|
|
|
|
EmitVertex();
|
|
|
|
|
|
|
|
|
|
EndPrimitive();
|
|
|
|
|
}
|