Spot works
This commit is contained in:
@@ -3,10 +3,10 @@
|
||||
layout(triangles, invocations = 6) in;
|
||||
layout(triangle_strip, max_vertices = 3) out;
|
||||
|
||||
struct ShadowMapSet
|
||||
struct DirectionalShadowMapSet
|
||||
{
|
||||
uint entity_id;
|
||||
uint cascade_count;
|
||||
uint shadow_id;
|
||||
uint shadow_texture_id;
|
||||
uint frame_buffer_id;
|
||||
float near_plane[8];
|
||||
@@ -14,7 +14,8 @@ struct ShadowMapSet
|
||||
mat4 light_space_proj[6];
|
||||
mat4 light_space_view[6];
|
||||
};
|
||||
|
||||
|
||||
|
||||
//Push constants updated for each light
|
||||
layout(binding = 0) uniform shadow_per_frame
|
||||
{
|
||||
@@ -22,12 +23,13 @@ layout(binding = 0) uniform shadow_per_frame
|
||||
uint shadow_idxs;
|
||||
};
|
||||
|
||||
layout(std430, binding = 5) readonly buffer shadow_map_sets
|
||||
layout (std430, binding = 5) readonly buffer directional_shadow_map_sets
|
||||
{
|
||||
ShadowMapSet shadows[10];
|
||||
DirectionalShadowMapSet directional_shadows[];
|
||||
};
|
||||
|
||||
|
||||
|
||||
layout (location=0) in VS_OUT
|
||||
{
|
||||
vec2 vsUV;
|
||||
@@ -42,8 +44,8 @@ layout (location=0) out GEOM_OUT
|
||||
|
||||
void main()
|
||||
{
|
||||
mat4 view = shadows[shadow_idxs].light_space_view[gl_InvocationID];
|
||||
mat4 proj = shadows[shadow_idxs].light_space_proj[gl_InvocationID];
|
||||
mat4 view = directional_shadows[shadow_idxs].light_space_view[gl_InvocationID];
|
||||
mat4 proj = directional_shadows[shadow_idxs].light_space_proj[gl_InvocationID];
|
||||
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user