move transformations to the gpu
This commit is contained in:
parent
187d62edd3
commit
bc7db2106a
2 changed files with 102 additions and 48 deletions
|
@ -3,6 +3,10 @@
|
|||
// x -> -1 (left) 1(right)
|
||||
// y -> -1 (top) 1(bottom)
|
||||
|
||||
layout(binding = 0) uniform un{
|
||||
mat4 transform;
|
||||
} trans;
|
||||
|
||||
layout(location = 0) in vec2 in_position;
|
||||
layout(location = 1) in vec3 in_color;
|
||||
|
||||
|
@ -10,6 +14,6 @@ layout(location = 0) out vec3 frag_color;
|
|||
|
||||
void main()
|
||||
{
|
||||
gl_Position = vec4(in_position, 0.0, 1.0);
|
||||
gl_Position = trans.transform * vec4(in_position, 0.0, 1.0);
|
||||
frag_color = in_color;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue