Reorganise shaders

This commit is contained in:
2021-03-21 12:50:27 +01:00
parent a8ebf2f7f1
commit cf5a8b3e1b
32 changed files with 22 additions and 60 deletions
+37
View File
@@ -0,0 +1,37 @@
#version 430 core
layout (points) in;
layout (triangle_strip, max_vertices = 4) out;
in vec4 vColor [];
in vec4 vparams [];
out vec4 gColor;
out float gRadIn;
out float gRadOut;
out vec2 cenPosT;
out vec2 angles;
uniform vec2 winSize;
uniform float zoom;
void main()
{
angles = vparams[0].xy;
vec3 cenPos = gl_in[0].gl_Position.xyz;
gColor = vColor[0];
float width = vparams[0].w * 0.5;
float rad = vparams[0].z;
gRadOut = (rad + width) * zoom * 2;
gRadIn = (rad - width) * zoom * 2;
cenPosT = vec2 ( (cenPos.x + 1) * 0.5 * winSize.x , (cenPos.y + 1) * 0.5 * winSize.y);
gl_Position = vec4 (cenPos.x + gRadOut/winSize.x, cenPos.y + gRadOut/winSize.y, cenPos.z , 1);
EmitVertex();
gl_Position = vec4 (cenPos.x - gRadOut/winSize.x, cenPos.y + gRadOut/winSize.y, cenPos.z , 1);
EmitVertex();
gl_Position = vec4 (cenPos.x + gRadOut/winSize.x, cenPos.y - gRadOut/winSize.y, cenPos.z , 1);
EmitVertex();
gl_Position = vec4 (cenPos.x - gRadOut/winSize.x, cenPos.y - gRadOut/winSize.y, cenPos.z , 1);
EmitVertex();
EndPrimitive();
}