#version 150 core layout (points) in; layout (triangle_strip, max_vertices=4) out; in VertexData { vec4 color; } VertexIn[]; out VertexData { vec4 color; vec2 uv; } VertexOut; layout (std140) uniform Locals { float u_Aspect; }; #define PARTICLE_RADIUS 0.05 void main() { gl_Position = gl_in[0].gl_Position + vec4(-PARTICLE_RADIUS*u_Aspect, -PARTICLE_RADIUS, 0, 0); VertexOut.color = VertexIn[0].color; VertexOut.uv = vec2(-1, -1); EmitVertex(); gl_Position = gl_in[0].gl_Position + vec4(PARTICLE_RADIUS*u_Aspect, -PARTICLE_RADIUS, 0, 0); VertexOut.color = VertexIn[0].color; VertexOut.uv = vec2(1, -1); EmitVertex(); gl_Position = gl_in[0].gl_Position + vec4(-PARTICLE_RADIUS*u_Aspect, PARTICLE_RADIUS, 0, 0); VertexOut.color = VertexIn[0].color; VertexOut.uv = vec2(-1, 1); EmitVertex(); gl_Position = gl_in[0].gl_Position + vec4(PARTICLE_RADIUS*u_Aspect, PARTICLE_RADIUS, 0, 0); VertexOut.color = VertexIn[0].color; VertexOut.uv = vec2(1, 1); EmitVertex(); }