Couple loop with preload to allow for time "profiling"

This commit is contained in:
jgk
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;
}
-9
View File
@@ -26,14 +26,5 @@ void main()
gl_Position = vec4 (cenPos.x - gRad/winSize.x, cenPos.y - gRad/winSize.y, 0.9 , 1);
EmitVertex();
// gl_Position = vec4 (0.5,0.5,0 , 1);
// EmitVertex();
// gl_Position = vec4 (0,0.5,0 , 1);
// EmitVertex();
// gl_Position = vec4 (0.5,0,0 , 1);
// EmitVertex();
// gl_Position = vec4 (0,0,0 , 1);
// EmitVertex();
EndPrimitive();
}