33 lines
573 B
GLSL
33 lines
573 B
GLSL
|
#version 460
|
||
|
|
||
|
// vertex geometry data
|
||
|
layout(location = 0) in vec2 inPos;
|
||
|
layout(location = 1) in vec2 inTex;
|
||
|
|
||
|
// instance data
|
||
|
layout(push_constant, std430) uniform UniformPushConstant
|
||
|
{
|
||
|
vec2 pos;
|
||
|
vec2 scale;
|
||
|
vec4 color;
|
||
|
|
||
|
} upc;
|
||
|
|
||
|
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()
|
||
|
{
|
||
|
vec2 pos = inPos * upc.scale + upc.pos;
|
||
|
gl_Position = camera.orthographic * vec4(pos, -1.0, 1.0);
|
||
|
fragColor = upc.color;
|
||
|
fragTex = inTex;
|
||
|
}
|