Commit before fully removing uniforms other than the matrix

This commit is contained in:
2021-06-10 15:45:52 +02:00
parent aa30f6b969
commit 0a8370c7c6
9 changed files with 25 additions and 151 deletions
-28
View File
@@ -1,43 +1,15 @@
#version 430 core
layout (points) in;
layout (triangle_strip, max_vertices = 4) out;
in vec4 vParams [];
in vec2 vWinSize [];
out vec2 gTexPos;
uniform vec2 winSize;
uniform vec2 translation;
uniform float zoom;
uniform float rotation;
vec2 rotBy( float rot, vec2 v)
{
return vec2 ( v.x * cos(rot) - v.y * sin(rot)
, v.x * sin(rot) + v.y * cos(rot)
);
}
void main()
{
vec2 cPos = vec2(translation.x / 250 , translation.y /250 );
// float zoom = vParams[0].w;
float rot = 0 - rotation;
float x = winSize.x / (500*zoom) ;
float y = winSize.y / (500*zoom) ;
gTexPos = cPos + rotBy(-rot , vec2(x,y));
gl_Position = vec4 (1,1,0.9,1);
EmitVertex();
gTexPos = cPos + rotBy(-rot , vec2(x,-y));
gl_Position = vec4 (1,-1,0.9,1);
EmitVertex();
gTexPos = cPos + rotBy(-rot , vec2(-x,y));
gl_Position = vec4 (-1,1,0.9,1);
EmitVertex();
gTexPos = cPos + rotBy(-rot , vec2(-x,-y));
gl_Position = vec4 (-1,-1,0.9,1);
EmitVertex();
EndPrimitive();
}