SOF/renderer/shaders/ui-pane.vert

27 lines
535 B
GLSL
Raw Normal View History

#version 460
// vertex geometry data
layout(location = 0) in vec2 inPos;
// instance data
layout(location = 1) in vec3 inInstancePos;
layout(location = 2) in vec3 inInstanceScale;
layout(location = 3) in vec4 inInstanceColor;
layout(location = 0) out vec4 fragColor;
layout(binding = 0) uniform Camera
{
mat4 view;
mat4 perspective;
mat4 orthographic;
} camera;
void main()
{
vec3 pos = vec3(inPos, 0.0) * inInstanceScale + inInstancePos;
gl_Position = camera.orthographic * vec4(pos, 1.0);
fragColor = inInstanceColor;
}