2026-07-28 00:26:04 +01:00
|
|
|
//*VERTEX*
|
2026-08-03 22:34:52 +01:00
|
|
|
#version 460
|
2026-07-28 00:26:04 +01:00
|
|
|
|
2026-08-06 21:11:33 +01:00
|
|
|
struct ShadowMapSet
|
|
|
|
|
{
|
|
|
|
|
uint entity_id;
|
|
|
|
|
uint shadow_id;
|
|
|
|
|
uint shadow_texture_id;
|
|
|
|
|
uint frame_buffer_id;
|
|
|
|
|
float near_plane[8];
|
|
|
|
|
float far_plane[8];
|
|
|
|
|
mat4 light_space_proj[6];
|
|
|
|
|
mat4 light_space_view[6];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct SpotShadowMapSet
|
|
|
|
|
{
|
|
|
|
|
uint entity_id;
|
|
|
|
|
uint shadow_id;
|
|
|
|
|
uint shadow_texture_id;
|
|
|
|
|
uint frame_buffer_id;
|
|
|
|
|
float far_plane;
|
|
|
|
|
uint padding[3];
|
|
|
|
|
mat4 light_space_proj;
|
|
|
|
|
mat4 light_space_view;
|
|
|
|
|
};
|
2026-08-03 22:34:52 +01:00
|
|
|
|
|
|
|
|
layout(binding = 1) readonly buffer positions_buffer
|
2026-07-28 00:26:04 +01:00
|
|
|
{
|
|
|
|
|
mat4 model_matrix[];
|
|
|
|
|
};
|
|
|
|
|
|
2026-08-06 21:11:33 +01:00
|
|
|
|
|
|
|
|
|
2026-07-28 00:26:04 +01:00
|
|
|
layout (location = 0) in vec3 inPos; //12 bytes : 0
|
|
|
|
|
layout (location = 1) in vec2 inUV; //8 Bytes : 12
|
|
|
|
|
layout (location = 2) in uvec3 inChunkID; //12 Bytes : 20
|
|
|
|
|
layout (location = 3) in vec3 inNormal; //8 Bytes : 12
|
|
|
|
|
layout (location = 4) in vec3 inBiTangent;
|
|
|
|
|
layout (location = 5) in vec3 inTangent;
|
|
|
|
|
|
2026-08-03 22:34:52 +01:00
|
|
|
layout (location=0) out VS_OUT
|
|
|
|
|
{
|
|
|
|
|
vec2 vsUV;
|
|
|
|
|
flat uint vsMaterialID;
|
|
|
|
|
}vs_out;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-07-28 00:26:04 +01:00
|
|
|
void main()
|
2026-08-03 22:34:52 +01:00
|
|
|
{
|
2026-07-28 00:26:04 +01:00
|
|
|
uint chunkid = inChunkID[0];
|
|
|
|
|
mat4 model = model_matrix[chunkid];
|
|
|
|
|
gl_Position = model * vec4(inPos, 1.0);
|
2026-08-03 22:34:52 +01:00
|
|
|
vs_out.vsUV = inUV;
|
|
|
|
|
vs_out.vsMaterialID = inChunkID[1];
|
2026-07-28 00:26:04 +01:00
|
|
|
}
|