svulc/shd/triangle.vert
2025-03-20 16:46:55 +01:00

31 lines
621 B
GLSL

#version 450
layout(set = 0, binding = 0) uniform UniformBufferObject {
mat4 matrix; // do all the view matrix stuff on the cpu during queue submission
} ubo;
layout(location = 0) in vec3 pos;
layout(location = 1) in vec2 uvi;
layout(location = 0) out vec3 fragColor;
layout(location = 1) out vec2 uv;
/*
vec2 positions[3] = vec2[](
vec2(0.0, -0.5),
vec2(0.5, 0.5),
vec2(-0.5, 0.5)
);
vec3 colors[3] = vec3[](
vec3(1.0, 0.0, 0.0),
vec3(0.0, 1.0, 0.0),
vec3(0.0, 0.0, 1.0)
);
*/
void main() {
gl_Position = ubo.matrix * vec4(pos, 1.0);
fragColor = vec3(uvi, 1.0);
uv = uvi;
}