|
|
|
@ -168,20 +168,26 @@ void main(void)
|
|
|
|
|
|
|
|
|
|
#if SHADOWS
|
|
|
|
|
float shadowing = 1.0;
|
|
|
|
|
bool doneShadows = false;
|
|
|
|
|
@foreach shadow_texture_unit_index @shadow_texture_unit_list
|
|
|
|
|
if (!doneShadows)
|
|
|
|
|
{
|
|
|
|
|
vec2 shadowXY = shadowSpaceCoords@shadow_texture_unit_index.xy / shadowSpaceCoords@shadow_texture_unit_index.w;
|
|
|
|
|
if (all(lessThan(shadowXY, vec2(1.0, 1.0))) && all(greaterThan(shadowXY, vec2(0.0, 0.0))))
|
|
|
|
|
#if @shadowMapsOverlap
|
|
|
|
|
bool doneShadows = false;
|
|
|
|
|
@foreach shadow_texture_unit_index @shadow_texture_unit_list
|
|
|
|
|
if (!doneShadows)
|
|
|
|
|
{
|
|
|
|
|
shadowing *= shadow2DProj(shadowTexture@shadow_texture_unit_index, shadowSpaceCoords@shadow_texture_unit_index).r;
|
|
|
|
|
|
|
|
|
|
if (all(lessThan(shadowXY, vec2(0.95, 0.95))) && all(greaterThan(shadowXY, vec2(0.05, 0.05))))
|
|
|
|
|
doneShadows = true;
|
|
|
|
|
vec2 shadowXY = shadowSpaceCoords@shadow_texture_unit_index.xy / shadowSpaceCoords@shadow_texture_unit_index.w;
|
|
|
|
|
if (all(lessThan(shadowXY, vec2(1.0, 1.0))) && all(greaterThan(shadowXY, vec2(0.0, 0.0))))
|
|
|
|
|
{
|
|
|
|
|
shadowing *= shadow2DProj(shadowTexture@shadow_texture_unit_index, shadowSpaceCoords@shadow_texture_unit_index).r;
|
|
|
|
|
|
|
|
|
|
if (all(lessThan(shadowXY, vec2(0.95, 0.95))) && all(greaterThan(shadowXY, vec2(0.05, 0.05))))
|
|
|
|
|
doneShadows = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@endforeach
|
|
|
|
|
@endforeach
|
|
|
|
|
#else
|
|
|
|
|
@foreach shadow_texture_unit_index @shadow_texture_unit_list
|
|
|
|
|
shadowing *= shadow2DProj(shadowTexture@shadow_texture_unit_index, shadowSpaceCoords@shadow_texture_unit_index).r;
|
|
|
|
|
@endforeach
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
float shadow = shadowing;
|
|
|
|
|
#else // NOT SHADOWS
|
|
|
|
|