17 lines
375 B
GLSL
17 lines
375 B
GLSL
#version 330 core
|
|
layout (location = 0) in vec2 vertex; // <vec2 pos>
|
|
|
|
out VS_OUT {
|
|
vec2 texuv;
|
|
flat int index;
|
|
} vs_out;
|
|
|
|
uniform mat4 transforms[400];
|
|
uniform mat4 projection;
|
|
|
|
void main()
|
|
{
|
|
gl_Position = projection * transforms[gl_InstanceID] * vec4(vertex.xy, 0.0, 1.0);
|
|
vs_out.index = gl_InstanceID;
|
|
vs_out.texuv = vec2(vertex.x, 1.0f - vertex.y);
|
|
}
|