SOF/renderer/shaders/ui-pane-tex.vert

30 lines
628 B
GLSL
Raw Normal View History

#version 460
// vertex geometry data
layout(location = 0) in vec2 inPos;
layout(location = 1) in vec2 inTex;
// instance data
layout(location = 2) in vec3 inInstancePos;
layout(location = 3) in vec3 inInstanceScale;
layout(location = 4) in vec4 inInstanceColor;
layout(location = 0) out vec4 fragColor;
layout(location = 1) out vec2 fragTex;
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;
fragTex = inTex;
}