FroggyGreen
1ec76f56c8
The renderer now allows instancing. The way this works is by having to vertex buffers. One contains the normal vertex geometry data, the other contains per-instance data.
19 lines
406 B
GLSL
19 lines
406 B
GLSL
#version 460
|
|
|
|
// vertex geometry data
|
|
layout(location = 0) in vec2 inPos;
|
|
|
|
// instance data
|
|
layout(location = 1) in vec2 inInstancePos;
|
|
layout(location = 2) in vec2 inInstanceScale;
|
|
layout(location = 3) in vec4 inInstanceColor;
|
|
|
|
layout(location = 0) out vec4 fragColor;
|
|
|
|
void main()
|
|
{
|
|
vec2 pos = inPos * inInstanceScale + inInstancePos;
|
|
gl_Position = vec4(pos, 0.0, 1.0);
|
|
fragColor = inInstanceColor;
|
|
}
|