Make seasonal snow only in winter - early spring, make rain less when not under a cloud

This commit is contained in:
Xonk
2023-06-15 17:25:01 -04:00
parent fa9608c859
commit 35ee91b5d0
9 changed files with 105 additions and 54 deletions

View File

@ -391,5 +391,24 @@ float GetCloudShadow_VLFOG(vec3 WorldPos){
// do not allow it to exist above the lowest cloud plane
// shadow *= clamp(((MaxCumulusHeight + CumulusHeight)*0.435 - WorldPos.y)/100,0.0,1.0) ;
return shadow;
}
float GetCloudSkyOcclusion(vec3 WorldPos){
float shadow = 0.0;
vec3 shadowDir = vec3(0,1,0);
// assume a flat layer of cloud, and stretch the sampled density along the sunvector, starting from some vertical layer in the cloud.
#ifdef Cumulus
vec3 lowShadowStart = WorldPos + shadowDir/abs(shadowDir.y) * max((MaxCumulusHeight - 60) - WorldPos.y,0.0) ;
shadow += GetCumulusDensity(lowShadowStart,0)*Cumulus_density;
#endif
shadow = clamp(exp(-shadow*25.0) ,0.0,1.0);
return shadow;
}