Replace explicit matrix uniforms with single ubo

This commit is contained in:
2021-06-24 17:58:15 +02:00
parent 7ab932db93
commit 97598bc171
26 changed files with 39 additions and 174 deletions
+5 -7
View File
@@ -1,11 +1,9 @@
#version 430 core
layout (points) in;
layout (triangle_strip, max_vertices = 4) out;
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
out float lum;
out vec2 dField;
uniform mat4 worldMat;
void main()
{
lum = gl_in[0].gl_Position.w;
@@ -13,16 +11,16 @@ void main()
float gRad = gl_in[0].gl_Position.z;
dField = vec2 ( 1, 1);
gl_Position = worldMat * vec4 (cenPos.x + gRad, cenPos.y + gRad, -0 , 1);
gl_Position = theMat * vec4 (cenPos.x + gRad, cenPos.y + gRad, -0 , 1);
EmitVertex();
dField = vec2 (-1, 1);
gl_Position = worldMat * vec4 (cenPos.x - gRad, cenPos.y + gRad, -0 , 1);
gl_Position = theMat * vec4 (cenPos.x - gRad, cenPos.y + gRad, -0 , 1);
EmitVertex();
dField = vec2 ( 1,-1);
gl_Position = worldMat * vec4 (cenPos.x + gRad, cenPos.y - gRad, -0 , 1);
gl_Position = theMat * vec4 (cenPos.x + gRad, cenPos.y - gRad, -0 , 1);
EmitVertex();
dField = vec2 (-1,-1);
gl_Position = worldMat * vec4 (cenPos.x - gRad, cenPos.y - gRad, -0 , 1);
gl_Position = theMat * vec4 (cenPos.x - gRad, cenPos.y - gRad, -0 , 1);
EmitVertex();
EndPrimitive();