Work towards doing transformations using uniforms

This commit is contained in:
jgk
2021-02-25 03:41:19 +01:00
parent 1969aa4f4a
commit 32bfab2e02
14 changed files with 310 additions and 205 deletions
+3 -1
View File
@@ -5,6 +5,8 @@ in vec4 vParams [];
in vec2 vWinSize [];
out vec2 gTexPos;
uniform vec2 translation;
vec2 rotBy( float rot, vec2 v)
{
return vec2 ( v.x * cos(rot) - v.y * sin(rot)
@@ -15,7 +17,7 @@ vec2 rotBy( float rot, vec2 v)
void main()
{
vec2 cPos = vec2(vParams[0].x / 250 , vParams[0].y /250 );
vec2 cPos = vec2(translation.x / 250 , translation.y /250 );
float zoom = vParams[0].w;
float rot = 0 - vParams[0].z;