allow shadows to cast anywhere freely. this sacrifices the smooth transition that they had beforehand.

This commit is contained in:
Xonk
2025-03-10 01:11:18 -04:00
parent d31ebc8630
commit 940a202327
5 changed files with 40 additions and 48 deletions

View File

@ -140,7 +140,7 @@ float encodeVec2(float x,float y){
#ifdef OVERWORLD_SHADER
float ComputeShadowMap(inout vec3 directLightColor, vec3 playerPos, float maxDistFade){
if(maxDistFade <= 0.0) return 1.0;
// if(maxDistFade <= 0.0) return 1.0;
// setup shadow projection
vec3 projectedShadowPosition = mat3(shadowModelView) * playerPos + shadowModelView[3].xyz;
@ -191,7 +191,8 @@ float ComputeShadowMap(inout vec3 directLightColor, vec3 playerPos, float maxDis
directLightColor *= mix(vec3(1.0), translucentTint.rgb, maxDistFade);
#endif
return mix(1.0, shadowmap, maxDistFade);
return shadowmap;
// return mix(1.0, shadowmap, maxDistFade);
}
#endif
@ -417,7 +418,7 @@ void main() {
Shadows = ComputeShadowMap(directLightColor, shadowPlayerPos, shadowMapFalloff);
Shadows = mix(LM_shadowMapFallback, Shadows, shadowMapFalloff2);
Shadows *= mix(LM_shadowMapFallback, 1.0, shadowMapFalloff2);
#ifdef CLOUDS_SHADOWS
Shadows *= GetCloudShadow(feetPlayerPos+cameraPosition, WsunVec);