vec2 bias;
};
-uniform ShadowMap
+layout(set=0) uniform ShadowMap
{
ShadowParameters shadows[max_lights];
mat4 shd_world_matrix[max_lights*4];
};
-uniform sampler2DShadow shadow_map;
+layout(set=0) uniform sampler2DShadow shadow_map;
layout(constant_id=auto) const bool use_shadow_map = false;
return 1.0;
vec4 region = shadows[index].region;
- float shadow_sample = texture(shadow_map, vec3(shadow_coord.xy*region.zw+region.xy, shadow_coord.z));
+ float shadow_sample = texture(shadow_map, vec3(shadow_coord.xy*region.zw+region.xy, min(shadow_coord.z, 1.0)));
return mix(1.0, shadow_sample, shadows[index].darkness);
}
else