Couple loop with preload to allow for time "profiling"

This commit is contained in:
2021-02-26 00:05:27 +01:00
parent 9575eab230
commit 4fc6917741
4 changed files with 27 additions and 33 deletions
+1 -19
View File
@@ -11,27 +11,9 @@ uniform vec2 translation;
uniform float rotation;
uniform mat4 worldMat;
mat4 tranMat = mat4
( 1.0, 0.0, 0.0, 0.0
, 0.0, 1.0, 0.0, 0.0
, 0.0, 0.0, 1.0, 0.0
, -translation.x, -translation.y, 0.0, 1.0
) ;
mat4 rotMat = mat4
( cos(rotation), sin(-rotation), 0.0, 0.0
, sin(rotation), cos(rotation), 0.0, 0.0
, 0.0, 0.0, 1.0, 0.0
, 0.0, 0.0, 0.0, 1.0
) ;
mat4 scalMat = mat4
( 2*zoom/winSize.x, 0.0, 0.0, 0.0
, 0.0, 2*zoom/winSize.y, 0.0, 0.0
, 0.0, 0.0, 1.0, 0.0
, 0.0, 0.0, 0.0, 1.0
) ;
void main()
{
gl_Position = scalMat * rotMat * tranMat * vec4(position.xyz,1);
gl_Position = worldMat * vec4(position.xyz,1);
vColor = color;
vRad = rad;
}