Commit before fully removing uniforms other than the matrix
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user