36 lines
639 B
GLSL
36 lines
639 B
GLSL
#version 450
|
|
#extension GL_KHR_vulkan_glsl : enable
|
|
|
|
// vertex inputs
|
|
layout(location = 0) in vec3 aPos;
|
|
layout(location = 1) in vec2 aUV;
|
|
layout(location = 2) in vec4 aColor;
|
|
layout(location = 3) in mat4 aTransform;
|
|
|
|
// between shader stages
|
|
layout(location = 0) out struct
|
|
{
|
|
vec4 vertPos; // location 0
|
|
vec2 uv; // location = 1
|
|
vec4 color; // location = 2
|
|
|
|
} Out;
|
|
|
|
|
|
// Camera data
|
|
layout(set = 1, binding = 0) uniform CameraData
|
|
{
|
|
vec4 position;
|
|
mat4 vpMat;
|
|
mat4 viewMat;
|
|
mat4 projMat;
|
|
} cameraData;
|
|
|
|
|
|
void main()
|
|
{
|
|
Out.uv = aUV;
|
|
Out.color = aColor;
|
|
|
|
gl_Position = cameraData.vpMat * aTransform * vec4(aPos, 1.0f);
|
|
} |