2022-10-02 04:41:09 -04:00
|
|
|
#ifdef BIND_MESH_TEXTURES_AT_ONCE
|
|
|
|
#extension GL_ARB_shader_draw_parameters : enable
|
|
|
|
#endif
|
|
|
|
|
2022-07-21 00:26:06 -04:00
|
|
|
layout(std140, set = 1, binding = 0) uniform CameraBuffer
|
2022-07-19 03:56:08 -04:00
|
|
|
{
|
|
|
|
mat4 m_view_matrix;
|
|
|
|
mat4 m_projection_matrix;
|
|
|
|
mat4 m_inverse_view_matrix;
|
|
|
|
mat4 m_inverse_projection_matrix;
|
|
|
|
mat4 m_projection_view_matrix;
|
2022-08-21 02:09:56 -04:00
|
|
|
mat4 m_inverse_projection_view_matrix;
|
2022-07-19 03:56:08 -04:00
|
|
|
} u_camera;
|
|
|
|
|
|
|
|
struct ObjectData
|
|
|
|
{
|
2022-09-10 23:05:33 -04:00
|
|
|
vec3 m_translation;
|
|
|
|
float m_hue_change;
|
2022-08-25 21:36:30 -04:00
|
|
|
vec4 m_rotation;
|
2022-09-11 23:07:22 -04:00
|
|
|
vec3 m_scale;
|
|
|
|
uint m_custom_vertex_color;
|
2022-09-27 03:21:08 -04:00
|
|
|
int m_skinning_offset;
|
2022-07-21 00:26:06 -04:00
|
|
|
int m_material_id;
|
|
|
|
vec2 m_texture_trans;
|
2022-07-19 03:56:08 -04:00
|
|
|
};
|
|
|
|
|
2022-07-21 00:26:06 -04:00
|
|
|
layout(std140, set = 1, binding = 1) readonly buffer ObjectBuffer
|
2022-07-19 03:56:08 -04:00
|
|
|
{
|
|
|
|
ObjectData m_objects[];
|
|
|
|
} u_object_buffer;
|
|
|
|
|
2022-07-26 00:47:31 -04:00
|
|
|
layout(std140, set = 1, binding = 2) readonly buffer SkinningMatrices
|
|
|
|
{
|
|
|
|
mat4 m_mat[];
|
|
|
|
} u_skinning_matrices;
|
|
|
|
|
2022-10-02 04:41:09 -04:00
|
|
|
#ifdef BIND_MESH_TEXTURES_AT_ONCE
|
|
|
|
layout(std430, set = 1, binding = 3) readonly buffer MaterialIDs
|
|
|
|
{
|
|
|
|
int m_material_id[];
|
|
|
|
} u_material_ids;
|
|
|
|
#endif
|
|
|
|
|
2022-07-19 03:56:08 -04:00
|
|
|
layout(location = 0) in vec3 v_position;
|
|
|
|
layout(location = 1) in vec4 v_normal;
|
|
|
|
layout(location = 2) in vec4 v_color;
|
|
|
|
layout(location = 3) in vec2 v_uv;
|
|
|
|
layout(location = 4) in vec2 v_uv_two;
|
|
|
|
layout(location = 5) in vec4 v_tangent;
|
|
|
|
layout(location = 6) in ivec4 v_joint;
|
|
|
|
layout(location = 7) in vec4 v_weight;
|
|
|
|
|
|
|
|
layout(location = 0) out vec4 f_vertex_color;
|
2022-07-21 00:26:06 -04:00
|
|
|
layout(location = 1) out vec2 f_uv;
|
2022-07-28 01:37:09 -04:00
|
|
|
layout(location = 2) out vec2 f_uv_two;
|
|
|
|
layout(location = 3) flat out int f_material_id;
|
2022-09-10 23:05:33 -04:00
|
|
|
layout(location = 4) out float f_hue_change;
|