SHADE_Y3/Assets/Shaders/Trajectory_VS.glsl

36 lines
639 B
Plaintext
Raw Permalink Normal View History

2023-02-17 00:53:45 +08:00
#version 450
#extension GL_KHR_vulkan_glsl : enable
// vertex inputs
layout(location = 0) in vec3 aPos;
2023-02-17 00:53:45 +08:00
layout(location = 1) in vec2 aUV;
layout(location = 2) in vec4 aColor;
2023-02-17 00:53:45 +08:00
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;
2023-03-02 15:29:24 +08:00
gl_Position = cameraData.vpMat * aTransform * vec4(aPos, 1.0f);
2023-02-17 00:53:45 +08:00
}