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

@ -29,7 +29,8 @@
void YearCycleColor (
inout vec3 FinalColor,
vec3 glcolor
vec3 glcolor,
inout float SnowySeason
){
// colors for things that arent leaves and using the tint index.
vec3 SummerCol = vec3(Summer_R, Summer_G, Summer_B);
@ -79,6 +80,15 @@
// multiply final color by the final lerped color, because it contains all the other colors.
if(IsTintIndex) FinalColor = SpringToSummer;
#ifdef Snowy_Winter
// this is to make snow only exist in winter
float FallToWinter_snowfall = mix(0.0, 1.0, AutumnTime);
float WinterToSpring_snowfall = mix(FallToWinter_snowfall, 0.0, WinterTime);
SnowySeason = WinterToSpring_snowfall;
#else
SnowySeason = 0.0;
#endif
}
#endif
#endif

View File

@ -216,7 +216,8 @@
#define Seasons
#define Season_Length 24 // how long each season lasts in minecraft days. 91 is roughly how long each season is in reality. 1 will make a year last 4 days [ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91]
// #define Snowy_Winter // snow in the winter, yes or no?
#define Snowy_Winter // snow in the winter, yes or no?
#define Summer_R 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
#define Summer_G 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
#define Summer_B 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]

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;
}