2022-01-05 19:43:11 +00:00
|
|
|
#version 450
|
|
|
|
|
|
|
|
layout(location = 0) in vec3 Vertex_Position;
|
|
|
|
layout(location = 1) in vec3 Vertex_Normal;
|
|
|
|
layout(location = 2) in vec2 Vertex_Uv;
|
|
|
|
|
2022-07-08 01:14:22 +00:00
|
|
|
layout(location = 0) out vec2 v_Uv;
|
|
|
|
|
2022-01-05 19:43:11 +00:00
|
|
|
layout(set = 0, binding = 0) uniform CameraViewProj {
|
|
|
|
mat4 ViewProj;
|
2022-02-16 22:57:15 +00:00
|
|
|
mat4 View;
|
2022-01-05 19:43:11 +00:00
|
|
|
mat4 InverseView;
|
|
|
|
mat4 Projection;
|
|
|
|
vec3 WorldPosition;
|
|
|
|
float width;
|
|
|
|
float height;
|
|
|
|
};
|
|
|
|
|
2023-07-31 13:14:40 +00:00
|
|
|
struct Mesh {
|
2022-01-05 19:43:11 +00:00
|
|
|
mat4 Model;
|
|
|
|
mat4 InverseTransposeModel;
|
|
|
|
uint flags;
|
|
|
|
};
|
|
|
|
|
2023-07-31 13:14:40 +00:00
|
|
|
#ifdef PER_OBJECT_BUFFER_BATCH_SIZE
|
|
|
|
layout(set = 2, binding = 0) uniform Mesh Meshes[#{PER_OBJECT_BUFFER_BATCH_SIZE}];
|
|
|
|
#else
|
|
|
|
layout(set = 2, binding = 0) readonly buffer _Meshes {
|
|
|
|
Mesh Meshes[];
|
|
|
|
};
|
|
|
|
#endif // PER_OBJECT_BUFFER_BATCH_SIZE
|
|
|
|
|
2022-01-05 19:43:11 +00:00
|
|
|
void main() {
|
2022-07-08 01:14:22 +00:00
|
|
|
v_Uv = Vertex_Uv;
|
2023-07-31 13:14:40 +00:00
|
|
|
gl_Position = ViewProj
|
|
|
|
* Meshes[gl_BaseInstance + gl_InstanceIndex].Model
|
|
|
|
* vec4(Vertex_Position, 1.0);
|
2022-01-05 19:43:11 +00:00
|
|
|
}
|