Spot works
This commit is contained in:
@@ -2,11 +2,34 @@
|
||||
#version 460
|
||||
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
layout(binding = 1) readonly buffer positions_buffer
|
||||
{
|
||||
mat4 model_matrix[];
|
||||
};
|
||||
|
||||
layout (std430, binding = 6) readonly buffer spot_shadow_map_sets
|
||||
{
|
||||
SpotShadowMapSet spot_shadows[];
|
||||
};
|
||||
|
||||
layout(binding = 0) uniform shadow_per_frame
|
||||
{
|
||||
vec3 camera_pos;
|
||||
uint shadow_idxs;
|
||||
};
|
||||
|
||||
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
|
||||
@@ -24,7 +47,11 @@ void main()
|
||||
{
|
||||
uint chunkid = inChunkID[0];
|
||||
mat4 model = model_matrix[chunkid];
|
||||
gl_Position = model * vec4(inPos, 1.0);
|
||||
mat4 proj = spot_shadows[shadow_idxs].light_space_proj;
|
||||
mat4 view = spot_shadows[shadow_idxs].light_space_view;
|
||||
//view = mat4(1);
|
||||
//proj = mat4(1);
|
||||
gl_Position = proj * view * model * vec4(inPos, 1.0);
|
||||
vs_out.vsUV = inUV;
|
||||
vs_out.vsMaterialID = inChunkID[1];
|
||||
}
|
||||
Reference in New Issue
Block a user