fix mishandling of cloud shadow related toggles. fix clouds not appearing behind translucent things. remove random spaces from shaders.properties

This commit is contained in:
Xonk
2025-03-17 00:47:19 -04:00
parent 294ee8b6f3
commit 7581c510b9
9 changed files with 90 additions and 95 deletions

View File

@ -134,25 +134,27 @@ float GetCloudShadow(vec3 playerPos, vec3 sunVector){
vec3 startPosition = playerPos;
float cloudShadows = 0.0;
#ifdef CLOUDS_SHADOWS
float cloudShadows = 0.0;
#ifdef CloudLayer0
startPosition = playerPos + sunVector / abs(sunVector.y) * max((CloudLayer0_height + 20.0) - playerPos.y, 0.0);
cloudShadows = getCloudShape(SMALLCUMULUS_LAYER, 0, startPosition, CloudLayer0_height, CloudLayer0_height+90.0)*dailyWeatherParams1.x;
#endif
#ifdef CloudLayer1
startPosition = playerPos + sunVector / abs(sunVector.y) * max((CloudLayer1_height + 20.0) - playerPos.y, 0.0);
cloudShadows += getCloudShape(LARGECUMULUS_LAYER, 0, startPosition, CloudLayer1_height, CloudLayer1_height+90.0)*dailyWeatherParams1.y;
#endif
#ifdef CloudLayer2
startPosition = playerPos + sunVector / abs(sunVector.y) * max(CloudLayer2_height - playerPos.y, 0.0);
cloudShadows += getCloudShape(ALTOSTRATUS_LAYER, 0, startPosition, CloudLayer2_height, CloudLayer2_height)*dailyWeatherParams1.z * (1.0-abs(WsunVec.y));
#endif
cloudShadows *= CLOUD_SHADOW_STRENGTH;
#ifdef CloudLayer0
startPosition = playerPos + sunVector / abs(sunVector.y) * max((CloudLayer0_height + 20.0) - playerPos.y, 0.0);
cloudShadows = getCloudShape(SMALLCUMULUS_LAYER, 0, startPosition, CloudLayer0_height, CloudLayer0_height+90.0)*dailyWeatherParams1.x;
#endif
#ifdef CloudLayer1
startPosition = playerPos + sunVector / abs(sunVector.y) * max((CloudLayer1_height + 20.0) - playerPos.y, 0.0);
cloudShadows += getCloudShape(LARGECUMULUS_LAYER, 0, startPosition, CloudLayer1_height, CloudLayer1_height+90.0)*dailyWeatherParams1.y;
#endif
#ifdef CloudLayer2
startPosition = playerPos + sunVector / abs(sunVector.y) * max(CloudLayer2_height - playerPos.y, 0.0);
cloudShadows += getCloudShape(ALTOSTRATUS_LAYER, 0, startPosition, CloudLayer2_height, CloudLayer2_height)*dailyWeatherParams1.z * (1.0-abs(WsunVec.y));
#endif
#if defined CloudLayer0 || defined CloudLayer1 || defined CloudLayer2
totalShadow *= exp((cloudShadows*cloudShadows) * -200.0);
cloudShadows *= CLOUD_SHADOW_STRENGTH;
#if defined CloudLayer0 || defined CloudLayer1 || defined CloudLayer2
totalShadow *= exp((cloudShadows*cloudShadows) * -200.0);
#endif
#endif
return totalShadow;