vulkan-tutorial/shadersrc/mesh.vert

27 lines
568 B
GLSL
Raw Permalink Normal View History

2022-12-02 20:34:12 +01:00
#version 450
layout (location = 0) in vec3 vPosition;
layout (location = 1) in vec3 vNormal;
2023-01-16 01:10:23 +01:00
layout (location = 2) in vec4 vColor;
2023-01-06 20:02:17 +01:00
2023-01-16 01:10:23 +01:00
layout (location = 0) out vec4 outColor;
2022-12-02 20:34:12 +01:00
2023-01-06 20:02:17 +01:00
layout(set = 0, binding = 0) uniform CameraBuffer{
mat4 view;
mat4 proj;
mat4 viewproj;
} cameraData;
2022-12-02 20:34:12 +01:00
2022-12-11 09:02:17 +01:00
//push constants block
layout( push_constant ) uniform constants
{
2023-01-06 20:02:17 +01:00
vec4 data;
mat4 render_matrix;
2022-12-11 09:02:17 +01:00
} PushConstants;
2022-12-02 20:34:12 +01:00
void main()
{
2023-01-06 20:02:17 +01:00
mat4 transformMatrix = (cameraData.viewproj * PushConstants.render_matrix);
gl_Position = transformMatrix * vec4(vPosition, 1.0f);
2022-12-02 20:34:12 +01:00
outColor = vColor;
}