2024-05-09 17:39:50 -04:00
|
|
|
#version 460
|
|
|
|
|
|
|
|
// vertex geometry data
|
|
|
|
layout(location = 0) in vec2 inPos;
|
|
|
|
|
|
|
|
// instance data
|
2024-05-16 00:04:51 -04:00
|
|
|
layout(location = 1) in vec3 inInstancePos;
|
|
|
|
layout(location = 2) in vec3 inInstanceScale;
|
2024-05-09 17:39:50 -04:00
|
|
|
layout(location = 3) in vec4 inInstanceColor;
|
|
|
|
|
|
|
|
layout(location = 0) out vec4 fragColor;
|
|
|
|
|
2024-05-16 00:04:51 -04:00
|
|
|
layout(binding = 0) uniform Camera
|
|
|
|
{
|
|
|
|
mat4 view;
|
|
|
|
mat4 perspective;
|
|
|
|
mat4 orthographic;
|
|
|
|
|
|
|
|
} camera;
|
|
|
|
|
2024-05-09 17:39:50 -04:00
|
|
|
void main()
|
|
|
|
{
|
2024-05-16 00:04:51 -04:00
|
|
|
vec3 pos = vec3(inPos, 0.0) * inInstanceScale + inInstancePos;
|
|
|
|
gl_Position = camera.orthographic * vec4(pos, 1.0);
|
2024-05-09 17:39:50 -04:00
|
|
|
fragColor = inInstanceColor;
|
|
|
|
}
|