Balance cloud lighting. remake altocumulus shapes. Add daily weather profiles. Add rainy weather. clean vl fog code and fix atmospheric haze contribution to bloomy fog. add motion blur. add new composite pass dedicated to post processing effects (damage effects, motion blur, whatever). fix waving for tall plants. fix broken lighting when HQ ambient light is enabled. improve screenspace SSS on DH chunks. add more DH settings. add "large waves" setting for water. make moonlight slightly darker. improve cave fog. remade cave detection. fix upscaling scaling issues

This commit is contained in:
Xonk
2024-06-10 23:26:19 -04:00
parent 9a66781d0f
commit a7ab9f971f
53 changed files with 1305 additions and 854 deletions

View File

@ -128,7 +128,7 @@ vec3 calculateAtmosphere(vec3 background, vec3 viewVector, vec3 upVector, vec3 s
transmittance = vec3(1.0);
float high_sun = clamp(pow(sunVector.y+0.6,5),0.0,1.0) * 3.0; // make sunrise less blue, and allow sunset to be bluer
float low_sun = clamp(((1.0-abs(sunVector.y))*3.) - high_sun,1.0,2.0) ;
float low_sun = clamp(((1.0-abs(sunVector.y))*3.) - high_sun,1.0,1.8) ;
for (int i = 0; i < iSteps; ++i, position += increment) {

View File

@ -153,22 +153,6 @@
FinalFogColor = mix(FinalFogColor, BiomeColors, Inbiome);
}
// void BiomeSunlightColor(
// inout vec3 FinalSunlightColor
// ){
// // this is a little complicated? lmao
// vec3 BiomeColors = vec3(0.0);
// BiomeColors.r = isSwamps*SWAMP_R + isJungles*JUNGLE_R + isDarkForests*DARKFOREST_R + sandStorm*1.0 + snowStorm*0.6;
// BiomeColors.g = isSwamps*SWAMP_G + isJungles*JUNGLE_G + isDarkForests*DARKFOREST_G + sandStorm*0.5 + snowStorm*0.8;
// BiomeColors.b = isSwamps*SWAMP_B + isJungles*JUNGLE_B + isDarkForests*DARKFOREST_B + sandStorm*0.3 + snowStorm*1.0;
// // these range 0.0-1.0. they will never overlap.
// float Inbiome = isJungles+isSwamps+isDarkForests+sandStorm+snowStorm;
// // interpoloate between normal fog colors and biome colors. the transition speeds are conrolled by the biome uniforms.
// FinalSunlightColor = mix(FinalSunlightColor, FinalSunlightColor * (BiomeColors*0.8+0.2), Inbiome);
// }
void BiomeFogDensity(
inout vec4 UniformDensity,
inout vec4 CloudyDensity,
@ -178,8 +162,11 @@
float Inbiome = isJungles+isSwamps+isDarkForests+sandStorm+snowStorm;
vec2 BiomeFogDensity = vec2(0.0); // x = uniform || y = cloudy
BiomeFogDensity.x = isSwamps*SWAMP_UNIFORM_DENSITY + isJungles*JUNGLE_UNIFORM_DENSITY + isDarkForests*DARKFOREST_UNIFORM_DENSITY + sandStorm*15 + snowStorm*150;
BiomeFogDensity.y = isSwamps*SWAMP_CLOUDY_DENSITY + isJungles*JUNGLE_CLOUDY_DENSITY + isDarkForests*DARKFOREST_CLOUDY_DENSITY + sandStorm*255 + snowStorm*255;
// BiomeFogDensity.x = isSwamps*SWAMP_UNIFORM_DENSITY + isJungles*JUNGLE_UNIFORM_DENSITY + isDarkForests*DARKFOREST_UNIFORM_DENSITY + sandStorm*15 + snowStorm*150;
// BiomeFogDensity.y = isSwamps*SWAMP_CLOUDY_DENSITY + isJungles*JUNGLE_CLOUDY_DENSITY + isDarkForests*DARKFOREST_CLOUDY_DENSITY + sandStorm*255 + snowStorm*255;
BiomeFogDensity.x = isSwamps*SWAMP_UNIFORM_DENSITY + isJungles*JUNGLE_UNIFORM_DENSITY + isDarkForests*DARKFOREST_UNIFORM_DENSITY + sandStorm*0.0 + snowStorm*0.01;
BiomeFogDensity.y = isSwamps*SWAMP_CLOUDY_DENSITY + isJungles*JUNGLE_CLOUDY_DENSITY + isDarkForests*DARKFOREST_CLOUDY_DENSITY + sandStorm*0.5 + snowStorm*0.5;
UniformDensity = mix(UniformDensity, vec4(BiomeFogDensity.x), Inbiome*maxDistance);
CloudyDensity = mix(CloudyDensity, vec4(BiomeFogDensity.y), Inbiome*maxDistance);
@ -190,12 +177,14 @@
// this is a little complicated? lmao
vec3 BiomeColors = vec3(0.0);
BiomeColors.r = isSwamps*SWAMP_R + isJungles*JUNGLE_R + isDarkForests*DARKFOREST_R + sandStorm*1.0 + snowStorm*0.6;
BiomeColors.g = isSwamps*SWAMP_G + isJungles*JUNGLE_G + isDarkForests*DARKFOREST_G + sandStorm*0.5 + snowStorm*0.8;
BiomeColors.b = isSwamps*SWAMP_B + isJungles*JUNGLE_B + isDarkForests*DARKFOREST_B + sandStorm*0.3 + snowStorm*1.0;
BiomeColors.g = isSwamps*SWAMP_G + isJungles*JUNGLE_G + isDarkForests*DARKFOREST_G + sandStorm*0.3 + snowStorm*0.8;
BiomeColors.b = isSwamps*SWAMP_B + isJungles*JUNGLE_B + isDarkForests*DARKFOREST_B + sandStorm*0.1 + snowStorm*1.0;
// insure the biome colors are locked to the fog shape and lighting, but not its orignal color.
DirectLightCol = BiomeColors * max(dot(DirectLightCol,vec3(0.33333)), MIN_LIGHT_AMOUNT*0.025 + nightVision*0.2);
// DirectLightCol = BiomeColors * max(dot(DirectLightCol,vec3(0.33333)), MIN_LIGHT_AMOUNT*0.025 + nightVision*0.2);
// IndirectLightCol = BiomeColors * max(dot(IndirectLightCol,vec3(0.33333)), MIN_LIGHT_AMOUNT*0.025 + nightVision*0.2);
DirectLightCol = BiomeColors * max(dot(DirectLightCol,vec3(0.33333)), MIN_LIGHT_AMOUNT*0.025 + nightVision*0.2);
IndirectLightCol = BiomeColors * max(dot(IndirectLightCol,vec3(0.33333)), MIN_LIGHT_AMOUNT*0.025 + nightVision*0.2);
// these range 0.0-1.0. they will never overlap.
@ -212,27 +201,28 @@
#ifdef TIMEOFDAYFOG
// uniform int worldTime;
void TimeOfDayFog(
inout float Uniform, inout float Cloudy, float maxDistance, float DailyWeather_UniformFogDensity, float DailyWeather_CloudyFogDensity
void FogDensities(
inout float Uniform, inout float Cloudy, inout float Rainy, float maxDistance, float DailyWeather_UniformFogDensity, float DailyWeather_CloudyFogDensity
) {
float Time = worldTime%24000;
// set schedules for fog to appear at specific ranges of time in the day.
float Morning = clamp((Time-22000)/2000,0,1) + clamp((2000-Time)/2000,0,1);
float Noon = clamp(Time/2000,0,1) * clamp((12000-Time)/2000,0,1);
float Evening = clamp((Time-10000)/2000,0,1) * clamp((14000-Time)/2000,0,1) ;
float Night = clamp((Time-13000)/2000,0,1) * clamp((23000-Time)/2000,0,1) ;
float Morning = clamp((Time-22000.0)/2000.0,0.0,1.0) + clamp((2000.0-Time)/2000.0,0.0,1.0);
float Noon = clamp(Time/2000.0,0.0,1.0) * clamp((12000.0-Time)/2000.0,0.0,1.0);
float Evening = clamp((Time-10000.0)/2000.0,0.0,1.0) * clamp((14000.0-Time)/2000.0,0.0,1.0);
float Night = clamp((Time-13000.0)/2000.0,0.0,1.0) * clamp((23000.0-Time)/2000.0,0.0,1.0);
// set densities. morn, noon, even, night
vec4 UniformDensity = TOD_Fog_mult * vec4(Morning_Uniform_Fog, Noon_Uniform_Fog, Evening_Uniform_Fog, Night_Uniform_Fog);
vec4 CloudyDensity = TOD_Fog_mult * vec4(Morning_Cloudy_Fog, Noon_Cloudy_Fog, Evening_Cloudy_Fog, Night_Cloudy_Fog);
Rainy = Rainy*RainFog_amount;
#ifdef Daily_Weather
// let daily weather influence fog densities.
UniformDensity = max(UniformDensity, DailyWeather_UniformFogDensity * 50.0);
CloudyDensity = max(CloudyDensity, DailyWeather_CloudyFogDensity * 50.0);
// DailyWeather_FogDensity(UniformDensity, CloudyDensity);
UniformDensity = max(UniformDensity, DailyWeather_UniformFogDensity);
CloudyDensity = max(CloudyDensity, DailyWeather_CloudyFogDensity);
#endif
#ifdef PER_BIOME_ENVIRONMENT

View File

@ -31,12 +31,11 @@ vec3 DoAmbientLightColor(
float Exposure
){
// Lightmap = vec2(0.0,1.0);
float LightLevelZero = clamp(pow(eyeBrightnessSmooth.y/240. + Lightmap.y,2.0) ,0.0,1.0);
// float LightLevelZero = clamp(pow(eyeBrightnessSmooth.y/240. + Lightmap.y,2.0) ,0.0,1.0);
// do sky lighting.
float skyLM = (pow(Lightmap.y,15.0)*2.0 + pow(Lightmap.y,2.5))*0.5;
vec3 MinimumLight = MinimumColor * (MIN_LIGHT_AMOUNT*0.01 + nightVision);
vec3 MinimumLight = MinimumColor * max(MIN_LIGHT_AMOUNT*0.01, nightVision * 0.1);
vec3 IndirectLight = max(SkyColor * ambient_brightness * skyLM * 0.7, MinimumLight);
// do torch lighting

View File

@ -57,7 +57,7 @@ void applyGameplayEffects(inout vec3 color, in vec2 texcoord, float noise){
damageDistortion = mix(damageDistortion, vignette * (0.5 + noise), CriticalDamageTaken) * MOTION_AMOUNT;
// apply death distortion effect
distortmask = isDead ? noise*0.7 : damageDistortion;
distortmask = isDead ? vignette * (0.7 + noise*0.3) : damageDistortion;
#endif
//////////////////////// WATER DISTORTION /////////////////////
#if defined WATER_ON_CAMERA_EFFECT
@ -81,14 +81,6 @@ void applyGameplayEffects(inout vec3 color, in vec2 texcoord, float noise){
vec2 zoomUV = 0.5 + (texcoord - 0.5) * (1.0 - distortmask);
vec3 distortedColor = texture2D(colortex7, zoomUV).rgb;
#ifdef TONE_CURVE
distortedColor = toneCurve(distortedColor);
#endif
#ifdef COLOR_GRADING_ENABLED
distortedColor = colorGrading(distortedColor);
#endif
applyContrast(distortedColor, CONTRAST);
#ifdef WATER_ON_CAMERA_EFFECT
// apply the distorted water color to the scene, but revert back to before when it ends
if(exitWater > 0.01) color = distortedColor;
@ -108,11 +100,10 @@ void applyGameplayEffects(inout vec3 color, in vec2 texcoord, float noise){
#endif
#ifdef DAMAGE_TAKEN_EFFECT
color = mix(color, distortedColorLuma, vignette * sqrt(MinorDamageTaken));
color = mix(color, distortedColorLuma, vignette * sqrt(min(MinorDamageTaken,1.0)));
color = mix(color, distortedColorLuma, sqrt(CriticalDamageTaken));
#endif
if(isDead) color = distortedColorLuma * 0.3;
if(isDead) color = distortedColorLuma * 0.35;
#endif
}

View File

@ -339,10 +339,9 @@ void ApplySSRT(
if(isGrass) rayDir.y = clamp(rayDir.y + 0.5,-1,1);
// rayDir.y = mix(-1.0, rayDir.y, lightmaps.y*lightmaps.y);
skycontribution = ((skyCloudsFromTexLOD(rayDir, colortex4, 0).rgb / 30.0) * 2.5 * ambient_brightness) * Lighting.a + skylightcolor*(1-Lighting.a) + Lighting.rgb;
skycontribution = pow(skyCloudsFromTexLOD(rayDir, colortex4, 0).rgb/30, vec3(0.7)) *2.5 * ambient_brightness * Lighting.a + Lighting.rgb;
#else
skycontribution = ((skyCloudsFromTexLOD2(rayDir, colortex4, 6).rgb / 30.0) * 2.5 * ambient_brightness) * Lighting.a + skylightcolor*(1-Lighting.a) + Lighting.rgb;
skycontribution = (pow(skyCloudsFromTexLOD2(rayDir, colortex4, 6).rgb / 30.0,vec3(0.7)) * 2.5 * ambient_brightness) * Lighting.a + skylightcolor*(1-Lighting.a) + Lighting.rgb;
#endif
#else

View File

@ -15,45 +15,37 @@ float densityAtPosFog(in vec3 pos){
float cloudVol(in vec3 pos, float maxDistance ){
float fogYstart = FOG_START_HEIGHT+3;
vec3 samplePos = pos*vec3(1.0,1./24.,1.0);
vec3 samplePos2 = pos*vec3(1.0,1./48.,1.0);
float fogYstart = FOG_START_HEIGHT+3;
float mult = exp( -max((pos.y - fogYstart) / 35.,0.0));
float fog_shape = 1.0 - densityAtPosFog(samplePos * 24.0 );
float fog_eroded = 1.0 - densityAtPosFog(samplePos2 * 200.0 );
// float CloudyFog = max( (fog_shape*2.0 - fog_eroded*0.5) - 1.2, max(fog_shape-0.8,0.0)) * mult;
float heightlimit = exp2( -max((pos.y - fogYstart * (1.0+snowStorm)) / 25.,0.0));
float CloudyFog = max((fog_shape*1.2 - fog_eroded*0.2) - 0.75,0.0) * heightlimit ;
float UniformFog = exp( max(pos.y - fogYstart,0.0) / -25);
// UniformFog = 1.0;
float RainFog = ((2 + max(fog_shape*10. - 7.0,0.5)*2.0)) *UniformFog* rainStrength * noPuddleAreas * RainFog_amount;
// float RainFog = (CloudyFog*255) * rainStrength * noPuddleAreas * RainFog_amount;
float uniformFog = 0.0;
float low_gradientFog = exp2(-0.3 * max(pos.y - fogYstart,0.0));
float medium_gradientFog = exp2(-0.15 * max(pos.y - fogYstart,0.0));
float high_gradientFog = exp2(-0.06 * max(pos.y - fogYstart,0.0));
#ifdef PER_BIOME_ENVIRONMENT
// sandstorms and snowstorms
if(sandStorm > 0 || snowStorm > 0) CloudyFog = mix(CloudyFog, max(densityAtPosFog((samplePos2 - vec3(frameTimeCounter,0,frameTimeCounter)*10) * 100.0 ) - 0.2,0.0) * heightlimit, sandStorm+snowStorm);
#endif
TimeOfDayFog(UniformFog, CloudyFog, maxDistance, dailyWeatherParams0.a, dailyWeatherParams1.a);
float noise = densityAtPosFog(samplePos * 12.0);
float erosion = 1.0-densityAtPosFog(samplePos2 * (125 - (1-pow(1-noise,5))*25));
// float clumpyFog = max(exp(noise * -5)*2 - (erosion*erosion), 0.0);
// float testfogshapes = clumpyFog*30;
// return testfogshapes;
// return max(exp( max(pos.y - 90,0.0) / -1), 0.0) * 100;
return CloudyFog + UniformFog + RainFog;
float fog_shape = 0.0;
float fog_erosion = 0.0;
if(sandStorm < 1.0 && snowStorm < 1.0){
fog_shape = 1.0 - densityAtPosFog(samplePos * 24.0);
fog_erosion = 1.0 - densityAtPosFog(samplePos2 * 200.0 - vec3(min(max(fog_shape - 0.6 ,0.0) * 2.0 ,1.0)*200.0));
}
float cloudyFog = max(min(max(fog_shape - 0.6 ,0.0) * 2.0 ,1.0) - fog_erosion * 0.4 , 0.0) * exp(-0.05 * max(pos.y - (fogYstart+20),0.0));
float rainyFog = (low_gradientFog * 0.5 + exp2(-0.06 * max(pos.y - fogYstart,0.0))) * rainStrength * noPuddleAreas;
if(sandStorm > 0.0 || snowStorm > 0.0){
float IntenseFogs = pow(1.0 - densityAtPosFog( (samplePos2 - vec3(frameTimeCounter,0,frameTimeCounter)*15.0) * 100.0),2.0) * mix(1.0, high_gradientFog, snowStorm);
cloudyFog = mix(cloudyFog, IntenseFogs, sandStorm+snowStorm);
medium_gradientFog = 1.0;
}
FogDensities(medium_gradientFog, cloudyFog, rainyFog, maxDistance, dailyWeatherParams0.a, dailyWeatherParams1.a);
// return medium_gradientFog;
return uniformFog + medium_gradientFog + cloudyFog + rainyFog;
}
float phaseRayleigh(float cosTheta) {
@ -70,17 +62,26 @@ float fogPhase(float lightPoint){
return exponential;
}
uniform ivec2 eyeBrightness;
uniform int dhRenderDistance;
vec4 GetVolumetricFog(
vec3 viewPosition,
vec2 dither,
vec3 LightColor,
vec3 AmbientColor
vec3 AmbientColor,
vec3 AveragedAmbientColor
){
#ifndef TOGGLE_VL_FOG
return vec4(0.0,0.0,0.0,1.0);
#endif
int SAMPLECOUNT = VL_SAMPLES;
vec3 color = vec3(0.0);
float absorbance = 1.0;
float lightleakfix = 1.0 - caveDetection;
float lightleakfix2 = pow(clamp(eyeBrightnessSmooth.y/240. ,0.0,1.0),3.0);
/// ------------- RAYMARCHING STUFF ------------- \\\
//project pixel position into projected shadowmap space
@ -99,8 +100,7 @@ vec4 GetVolumetricFog(
vec3 dVWorld = (wpos-gbufferModelViewInverse[3].xyz);
#ifdef DISTANT_HORIZONS
float maxLength = min(length(dVWorld), max(dhFarPlane-1000,0.0))/length(dVWorld);
SAMPLECOUNT += SAMPLECOUNT;
float maxLength = min(length(dVWorld), max(far, dhRenderDistance))/length(dVWorld);
#else
float maxLength = min(length(dVWorld), far)/length(dVWorld);
#endif
@ -108,32 +108,32 @@ vec4 GetVolumetricFog(
dV *= maxLength;
dVWorld *= maxLength;
float dL = length(dVWorld);
float mult = length(dVWorld)/25;
// why 8.0? i dunno it looked nice
float dL = length(dVWorld)/8.0;
float dL_alternate = length(dVWorld);
vec3 progress = start.xyz;
vec3 progressW = gbufferModelViewInverse[3].xyz + cameraPosition;
vec3 WsunVec = mat3(gbufferModelViewInverse) * sunVec * lightCol.a;
vec3 WsunVec = mat3(gbufferModelViewInverse) * sunVec ;
float SdotV = dot(sunVec,normalize(viewPosition))*lightCol.a;
/// ------------- COLOR/LIGHTING STUFF ------------- \\\
vec3 color = vec3(0.0);
vec3 absorbance = vec3(1.0);
///// ----- fog lighting
//Mie phase + somewhat simulates multiple scattering (Horizon zero down cloud approx)
float mie = fogPhase(SdotV) * 5.0;
float sunPhase = fogPhase(SdotV) * 5.0;
float skyPhase = pow(clamp(normalize(wpos).y*0.5+0.5,0.0,1.0),4.0)*5.0;
float rayL = phaseRayleigh(SdotV);
vec3 rC = vec3(sky_coefficientRayleighR*1e-6, sky_coefficientRayleighG*1e-5, sky_coefficientRayleighB*1e-5);
vec3 rC = vec3(sky_coefficientRayleighR*1e-6, sky_coefficientRayleighG*1e-5, sky_coefficientRayleighB*1e-5) ;
vec3 mC = vec3(fog_coefficientMieR*1e-6, fog_coefficientMieG*1e-6, fog_coefficientMieB*1e-6);
vec3 skyLightPhased = AmbientColor;
vec3 LightSourcePhased = LightColor;
skyLightPhased *= 1.0 + skyPhase;
LightSourcePhased *= sunPhase;
#ifdef ambientLight_only
LightSourcePhased = vec3(0.0);
#endif
@ -142,81 +142,47 @@ vec4 GetVolumetricFog(
vec3 biomeIndirect = skyLightPhased;
float inBiome = BiomeVLFogColors(biomeDirect, biomeIndirect);
#endif
skyLightPhased = max(skyLightPhased + skyLightPhased*(normalize(wpos).y*0.9+0.1),0.0);
LightSourcePhased *= mie;
float lightleakfix = clamp(pow(eyeBrightnessSmooth.y/240.,2) ,0.0,1.0);
#ifdef RAYMARCH_CLOUDS_WITH_FOG
vec3 SkyLightColor = AmbientColor;
vec3 LightSourceColor = LightColor;
#ifdef ambientLight_only
LightSourceColor = vec3(0.0);
#endif
float shadowStep = 200.0;
vec3 dV_Sun = WsunVec*shadowStep;
float mieDay = phaseg(SdotV, 0.75);
float mieDayMulti = (phaseg(SdotV, 0.35) + phaseg(-SdotV, 0.35) * 0.5) ;
vec3 directScattering = LightSourceColor * mieDay * 3.14;
vec3 directMultiScattering = LightSourceColor * mieDayMulti * 3.14;
vec3 sunIndirectScattering = LightSourceColor * phaseg(dot(mat3(gbufferModelView)*vec3(0,1,0),normalize(viewPosition)), 0.5) * 3.14;
#endif
#ifdef DISTANT_HORIZONS
float atmosphereMult = 1.0;
#else
float atmosphereMult = 1.5;
float atmosphereMult = 1.5;
#endif
float expFactor = 11.0;
for (int i=0;i<SAMPLECOUNT;i++) {
float d = (pow(expFactor, float(i+dither.x)/float(SAMPLECOUNT))/expFactor - 1.0/expFactor)/(1-1.0/expFactor);
float dd = pow(expFactor, float(i+dither.x)/float(SAMPLECOUNT)) * log(expFactor) / float(SAMPLECOUNT)/(expFactor-1.0);
progress = start.xyz + d*dV;
progressW = gbufferModelViewInverse[3].xyz+cameraPosition + d*dVWorld;
// float curvature = 1-exp(-25*pow(clamp(1.0 - length(progressW - cameraPosition)/(32*80),0.0,1.0),2));
//project into biased shadowmap space
#ifdef DISTORT_SHADOWMAP
float distortFactor = calcDistort(progress.xy);
#else
float distortFactor = 1.0;
#endif
vec3 pos = vec3(progress.xy*distortFactor, progress.z);
vec3 shadowPos = vec3(progress.xy*distortFactor, progress.z);
vec3 sh = vec3(1.0);
if (abs(pos.x) < 1.0-0.5/2048. && abs(pos.y) < 1.0-0.5/2048){
pos = pos*vec3(0.5,0.5,0.5/6.0)+0.5;
if (abs(shadowPos.x) < 1.0-0.5/2048. && abs(shadowPos.y) < 1.0-0.5/2048){
shadowPos = shadowPos*vec3(0.5,0.5,0.5/6.0)+0.5;
#ifdef TRANSLUCENT_COLORED_SHADOWS
sh = vec3(shadow2D(shadowtex0, pos).x);
sh = vec3(shadow2D(shadowtex0, shadowPos).x);
if(shadow2D(shadowtex1, pos).x > pos.z && sh.x < 1.0){
vec4 translucentShadow = texture2D(shadowcolor0, pos.xy);
if(shadow2D(shadowtex1, shadowPos).x > shadowPos.z && sh.x < 1.0){
vec4 translucentShadow = texture2D(shadowcolor0, shadowPos.xy);
if(translucentShadow.a < 0.9) sh = normalize(translucentShadow.rgb+0.0001);
}
#else
sh = vec3(shadow2D(shadow, pos).x);
sh = vec3(shadow2D(shadow, shadowPos).x);
#endif
}
vec3 sh2 = sh;
#ifdef VL_CLOUDS_SHADOWS
// if(clamp(progressW.y - CloudLayer1_height,0.0,1.0) < 1.0 && clamp(progressW.y-50,0.0,1.0) > 0.0)
sh *= GetCloudShadow_VLFOG(progressW, WsunVec);
sh *= GetCloudShadow_VLFOG(progressW, WsunVec * lightCol.a);
#endif
#ifdef PER_BIOME_ENVIRONMENT
float maxDistance = inBiome * min(max(1.0 - length(d*dVWorld.xz)/(32*8),0.0)*2.0,1.0);
@ -224,89 +190,303 @@ vec4 GetVolumetricFog(
#else
float densityVol = cloudVol(progressW, 0.0) * lightleakfix;
#endif
//Water droplets(fog)
float density = densityVol*300.0;
float density = densityVol;
///// ----- main fog lighting
//Just air
vec2 airCoef = exp(-max(progressW.y - SEA_LEVEL, 0.0) / vec2(8.0e3, 1.2e3) * vec2(6.,7.0)) * (atmosphereMult * 24.0) * Haze_amount * clamp(CloudLayer0_height - progressW.y + max(eyeAltitude-(CloudLayer0_height-50),0),0.0,1.0);
vec2 airCoef = exp2(-max(progressW.y-SEA_LEVEL,0.0)/vec2(8.0e3, 1.2e3)*vec2(6.,7.0)) * (24.0 * atmosphereMult) * Haze_amount * clamp(CloudLayer0_height - progressW.y + max(eyeAltitude-(CloudLayer0_height-100),0),0.0,1.0);
// * clamp(CloudLayer0_height - progressW.y + max(eyeAltitude-(CloudLayer0_height-100),0),0.0,1.0);
// * exp2(-0.05 * max(progressW.y - (CloudLayer0_height + max(eyeAltitude-(CloudLayer0_height-50.0),0)),0.0));
//Pbr for air, yolo mix between mie and rayleigh for water droplets
vec3 rL = rC*airCoef.x;
vec3 m = (airCoef.y+density) * mC;
vec3 rL = rC*(airCoef.x);
vec3 m = mC*(airCoef.y+densityVol*300.0);
// calculate the atmosphere haze seperately and purely on color, so visibility is not harmed.
vec3 Atmosphere = LightSourcePhased * sh * (rayL*rL + sunPhase*m) + (AveragedAmbientColor*0.7) * (rL+m) * lightleakfix2;
color += (Atmosphere - Atmosphere*exp(-(rL+m)*dd*dL_alternate)) / (rL+m+1e-6);
// calculate lighting
#ifdef PER_BIOME_ENVIRONMENT
vec3 Atmosphere = mix(skyLightPhased, biomeDirect, maxDistance) * (rL + m); // not pbr so just make the atmosphere also dense fog heh
vec3 DirectLight = mix(LightSourcePhased, biomeIndirect, maxDistance) * sh * (rL*rayL + m);
vec3 indirectLight = mix(skyLightPhased, biomeIndirect, maxDistance);
vec3 DirectLight = mix(LightSourcePhased, biomeDirect, maxDistance) * sh;
#else
vec3 Atmosphere = skyLightPhased * (rL + m); // not pbr so just make the atmosphere also dense fog heh
vec3 DirectLight = LightSourcePhased * sh * (rL*rayL + m);
vec3 indirectLight = skyLightPhased;
vec3 DirectLight = LightSourcePhased * sh;
#endif
vec3 Lightning = Iris_Lightningflash_VLfog(progressW-cameraPosition, lightningBoltPosition.xyz) * (rL + m);
vec3 lighting = DirectLight * lightleakfix + indirectLight * lightleakfix2 + Lightning;
vec3 foglighting = (Atmosphere + DirectLight + Lightning) * lightleakfix;
color += (lighting - lighting * exp(-density*dd*dL))*absorbance;
absorbance *= max(exp(-density*dd*dL),0.0);
color += (foglighting - foglighting * exp(-(rL+m)*dd*dL)) / ((rL+m)+0.00000001)*absorbance;
absorbance *= clamp(exp(-(rL+m)*dd*dL),0.0,1.0);
#ifdef RAYMARCH_CLOUDS_WITH_FOG
//////////////////////////////////////////
///// ----- cloud part
//////////////////////////////////////////
// curvature = clamp(1.0 - length(progressW - cameraPosition)/(32*128),0.0,1.0);
float otherlayer = max(progressW.y - (CloudLayer0_height+99.5), 0.0) > 0.0 ? 0.0 : 1.0;
float DUAL_MIN_HEIGHT = otherlayer > 0.0 ? CloudLayer0_height : CloudLayer1_height;
float DUAL_MAX_HEIGHT = DUAL_MIN_HEIGHT + 100.0;
float DUAL_DENSITY = otherlayer > 0.0 ? CloudLayer0_density : CloudLayer1_density;
if(clamp(progressW.y - DUAL_MAX_HEIGHT,0.0,1.0) < 1.0 && clamp(progressW.y - DUAL_MIN_HEIGHT,0.0,1.0) > 0.0){
float DUAL_MIN_HEIGHT_2 = otherlayer > 0.0 ? CloudLayer0_height : CloudLayer1_height;
float DUAL_MAX_HEIGHT_2 = DUAL_MIN_HEIGHT + 100.0;
float cumulus = GetCumulusDensity(-1, progressW, 1, CloudLayer0_height, CloudLayer1_height);
float fadedDensity = DUAL_DENSITY * clamp(exp( (progressW.y - (DUAL_MAX_HEIGHT - 75)) / 9.0 ),0.0,1.0);
float muE = cumulus*fadedDensity;
float directLight = 0.0;
for (int j=0; j < 3; j++){
vec3 shadowSamplePos = progressW + dV_Sun * (0.1 + j * (0.1 + dither.y*0.05));
float shadow = GetCumulusDensity(-1, shadowSamplePos, 0, DUAL_MIN_HEIGHT, DUAL_MAX_HEIGHT) * DUAL_DENSITY;
directLight += shadow;
}
/// shadows cast from one layer to another
/// large cumulus -> small cumulus
#if defined CloudLayer1 && defined CloudLayer0
if(otherlayer > 0.0) directLight += LAYER1_DENSITY * 2.0 * GetCumulusDensity(1, progressW + dV_Sun/abs(dV_Sun.y) * max((LAYER1_minHEIGHT+70*dither.y) - progressW.y,0.0), 0, LAYER1_minHEIGHT, LAYER1_maxHEIGHT);
#endif
// // altostratus -> cumulus
// #ifdef CloudLayer2
// vec3 HighAlt_shadowPos = rayProgress + dV_Sun/abs(dV_Sun.y) * max(LAYER2_HEIGHT - rayProgress.y,0.0);
// float HighAlt_shadow = GetAltostratusDensity(HighAlt_shadowPos) * CloudLayer2_density;
// directLight += HighAlt_shadow;
// #endif
float skyScatter = clamp(((DUAL_MAX_HEIGHT - 20 - progressW.y) / 275.0) * (0.5+DUAL_DENSITY),0.0,1.0);
float distantfade = 1- exp( -10*pow(clamp(1.0 - length(progressW - cameraPosition)/(32*65),0.0,1.0),2));
vec3 cloudlighting = DoCloudLighting(muE, cumulus, SkyLightColor, skyScatter, directLight, directScattering*sh2, directMultiScattering*sh2, 1);
color += max(cloudlighting - cloudlighting*exp(-muE*dd*dL),0.0) * absorbance;
absorbance *= max(exp(-muE*dd*dL),0.0);
}
#endif
if (min(dot(absorbance,vec3(0.335)),1.0) < 1e-5) break;
if (absorbance < 1e-5) break;
}
return vec4(color, min(dot(absorbance,vec3(0.335)),1.0));
}
// return vec4(color, dot(absorbance,vec3(0.21, 0.72, 0.07)));
return vec4(color, absorbance);
}
// vec4 GetVolumetricFog(
// vec3 viewPosition,
// vec2 dither,
// vec3 LightColor,
// vec3 AmbientColor
// ){
// #ifndef TOGGLE_VL_FOG
// return vec4(0.0,0.0,0.0,1.0);
// #endif
// int SAMPLECOUNT = VL_SAMPLES;
// /// ------------- RAYMARCHING STUFF ------------- \\\
// //project pixel position into projected shadowmap space
// vec3 wpos = mat3(gbufferModelViewInverse) * viewPosition + gbufferModelViewInverse[3].xyz;
// vec3 fragposition = mat3(shadowModelView) * wpos + shadowModelView[3].xyz;
// fragposition = diagonal3(shadowProjection) * fragposition + shadowProjection[3].xyz;
// //project view origin into projected shadowmap space
// vec3 start = toShadowSpaceProjected(vec3(0.0));
// //rayvector into projected shadow map space
// //we can use a projected vector because its orthographic projection
// //however we still have to send it to curved shadow map space every step
// vec3 dV = fragposition - start;
// vec3 dVWorld = (wpos-gbufferModelViewInverse[3].xyz);
// #ifdef DISTANT_HORIZONS
// float maxLength = min(length(dVWorld), max(dhFarPlane-1000,0.0))/length(dVWorld);
// SAMPLECOUNT += SAMPLECOUNT;
// #else
// float maxLength = min(length(dVWorld), far)/length(dVWorld);
// #endif
// dV *= maxLength;
// dVWorld *= maxLength;
// float dL = length(dVWorld);
// float mult = length(dVWorld)/25;
// vec3 progress = start.xyz;
// vec3 progressW = gbufferModelViewInverse[3].xyz + cameraPosition;
// vec3 WsunVec = mat3(gbufferModelViewInverse) * sunVec * lightCol.a;
// float SdotV = dot(sunVec,normalize(viewPosition))*lightCol.a;
// /// ------------- COLOR/LIGHTING STUFF ------------- \\\
// vec3 color = vec3(0.0);
// vec3 absorbance = vec3(1.0);
// ///// ----- fog lighting
// //Mie phase + somewhat simulates multiple scattering (Horizon zero down cloud approx)
// float mie = fogPhase(SdotV) * 5.0;
// float rayL = phaseRayleigh(SdotV);
// vec3 rC = vec3(sky_coefficientRayleighR*1e-6, sky_coefficientRayleighG*1e-5, sky_coefficientRayleighB*1e-5);
// vec3 mC = vec3(fog_coefficientMieR*1e-6, fog_coefficientMieG*1e-6, fog_coefficientMieB*1e-6);
// vec3 skyLightPhased = AmbientColor;
// vec3 LightSourcePhased = LightColor;
// #ifdef ambientLight_only
// LightSourcePhased = vec3(0.0);
// #endif
// #ifdef PER_BIOME_ENVIRONMENT
// vec3 biomeDirect = LightSourcePhased;
// vec3 biomeIndirect = skyLightPhased;
// float inBiome = BiomeVLFogColors(biomeDirect, biomeIndirect);
// #endif
// skyLightPhased = max(skyLightPhased + skyLightPhased*(normalize(wpos).y*0.9+0.1),0.0);
// LightSourcePhased *= mie;
// // float lightleakfix = clamp(pow(eyeBrightnessSmooth.y/240.,2) ,0.0,1.0);
// float lightleakfix = 1.0 - caveDetection;
// #ifdef RAYMARCH_CLOUDS_WITH_FOG
// vec3 SkyLightColor = AmbientColor;
// vec3 LightSourceColor = LightColor;
// #ifdef ambientLight_only
// LightSourceColor = vec3(0.0);
// #endif
// float shadowStep = 200.0;
// vec3 dV_Sun = WsunVec*shadowStep;
// float mieDay = phaseg(SdotV, 0.75);
// float mieDayMulti = (phaseg(SdotV, 0.35) + phaseg(-SdotV, 0.35) * 0.5) ;
// vec3 directScattering = LightSourceColor * mieDay * 3.14;
// vec3 directMultiScattering = LightSourceColor * mieDayMulti * 3.14;
// vec3 sunIndirectScattering = LightSourceColor * phaseg(dot(mat3(gbufferModelView)*vec3(0,1,0),normalize(viewPosition)), 0.5) * 3.14;
// #endif
// #ifdef DISTANT_HORIZONS
// float atmosphereMult = 1.0;
// #else
// float atmosphereMult = 1.5;
// #endif
// float expFactor = 11.0;
// for (int i=0;i<SAMPLECOUNT;i++) {
// float d = (pow(expFactor, float(i+dither.x)/float(SAMPLECOUNT))/expFactor - 1.0/expFactor)/(1-1.0/expFactor);
// float dd = pow(expFactor, float(i+dither.x)/float(SAMPLECOUNT)) * log(expFactor) / float(SAMPLECOUNT)/(expFactor-1.0);
// progress = start.xyz + d*dV;
// progressW = gbufferModelViewInverse[3].xyz+cameraPosition + d*dVWorld;
// // float curvature = 1-exp(-25*pow(clamp(1.0 - length(progressW - cameraPosition)/(32*80),0.0,1.0),2));
// //project into biased shadowmap space
// #ifdef DISTORT_SHADOWMAP
// float distortFactor = calcDistort(progress.xy);
// #else
// float distortFactor = 1.0;
// #endif
// vec3 pos = vec3(progress.xy*distortFactor, progress.z);
// vec3 sh = vec3(1.0);
// if (abs(pos.x) < 1.0-0.5/2048. && abs(pos.y) < 1.0-0.5/2048){
// pos = pos*vec3(0.5,0.5,0.5/6.0)+0.5;
// #ifdef TRANSLUCENT_COLORED_SHADOWS
// sh = vec3(shadow2D(shadowtex0, pos).x);
// if(shadow2D(shadowtex1, pos).x > pos.z && sh.x < 1.0){
// vec4 translucentShadow = texture2D(shadowcolor0, pos.xy);
// if(translucentShadow.a < 0.9) sh = normalize(translucentShadow.rgb+0.0001);
// }
// #else
// sh = vec3(shadow2D(shadow, pos).x);
// #endif
// }
// vec3 sh2 = sh;
// #ifdef VL_CLOUDS_SHADOWS
// // if(clamp(progressW.y - CloudLayer1_height,0.0,1.0) < 1.0 && clamp(progressW.y-50,0.0,1.0) > 0.0)
// sh *= GetCloudShadow_VLFOG(progressW, WsunVec);
// #endif
// #ifdef PER_BIOME_ENVIRONMENT
// float maxDistance = inBiome * min(max(1.0 - length(d*dVWorld.xz)/(32*8),0.0)*2.0,1.0);
// float densityVol = cloudVol(progressW, maxDistance) * lightleakfix;
// #else
// float densityVol = cloudVol(progressW, 0.0) * lightleakfix;
// #endif
// //Water droplets(fog)
// float density = densityVol*300.0;
// ///// ----- main fog lighting
// //Just air
// vec2 airCoef = exp(-max(progressW.y - SEA_LEVEL, 0.0) / vec2(8.0e3, 1.2e3) * vec2(6.,7.0)) * (atmosphereMult * 24.0) * Haze_amount * clamp(CloudLayer0_height - progressW.y + max(eyeAltitude-(CloudLayer0_height-50),0),0.0,1.0);
// //Pbr for air, yolo mix between mie and rayleigh for water droplets
// vec3 rL = rC*airCoef.x;
// vec3 m = (airCoef.y+density) * mC;
// #ifdef PER_BIOME_ENVIRONMENT
// vec3 Atmosphere = mix(skyLightPhased, biomeDirect, maxDistance) * (rL + m); // not pbr so just make the atmosphere also dense fog heh
// vec3 DirectLight = mix(LightSourcePhased, biomeIndirect, maxDistance) * sh * (rL*rayL + m);
// #else
// vec3 Atmosphere = skyLightPhased * (rL + m); // not pbr so just make the atmosphere also dense fog heh
// vec3 DirectLight = LightSourcePhased * sh * (rL*rayL + m);
// #endif
// vec3 Lightning = Iris_Lightningflash_VLfog(progressW-cameraPosition, lightningBoltPosition.xyz) * (rL + m);
// vec3 foglighting = (Atmosphere + DirectLight + Lightning) * lightleakfix;
// color += (foglighting - foglighting * exp(-(rL+m)*dd*dL)) / ((rL+m)+0.00000001)*absorbance;
// absorbance *= clamp(exp(-(rL+m)*dd*dL),0.0,1.0);
// #ifdef RAYMARCH_CLOUDS_WITH_FOG
// //////////////////////////////////////////
// ///// ----- cloud part
// //////////////////////////////////////////
// // curvature = clamp(1.0 - length(progressW - cameraPosition)/(32*128),0.0,1.0);
// float otherlayer = max(progressW.y - (CloudLayer0_height+99.5), 0.0) > 0.0 ? 0.0 : 1.0;
// float DUAL_MIN_HEIGHT = otherlayer > 0.0 ? CloudLayer0_height : CloudLayer1_height;
// float DUAL_MAX_HEIGHT = DUAL_MIN_HEIGHT + 100.0;
// float DUAL_DENSITY = otherlayer > 0.0 ? CloudLayer0_density : CloudLayer1_density;
// if(clamp(progressW.y - DUAL_MAX_HEIGHT,0.0,1.0) < 1.0 && clamp(progressW.y - DUAL_MIN_HEIGHT,0.0,1.0) > 0.0){
// float DUAL_MIN_HEIGHT_2 = otherlayer > 0.0 ? CloudLayer0_height : CloudLayer1_height;
// float DUAL_MAX_HEIGHT_2 = DUAL_MIN_HEIGHT + 100.0;
// float cumulus = GetCumulusDensity(-1, progressW, 1, CloudLayer0_height, CloudLayer1_height);
// float fadedDensity = DUAL_DENSITY * clamp(exp( (progressW.y - (DUAL_MAX_HEIGHT - 75)) / 9.0 ),0.0,1.0);
// float muE = cumulus*fadedDensity;
// float directLight = 0.0;
// for (int j=0; j < 3; j++){
// vec3 shadowSamplePos = progressW + dV_Sun * (0.1 + j * (0.1 + dither.y*0.05));
// float shadow = GetCumulusDensity(-1, shadowSamplePos, 0, DUAL_MIN_HEIGHT, DUAL_MAX_HEIGHT) * DUAL_DENSITY;
// directLight += shadow;
// }
// /// shadows cast from one layer to another
// /// large cumulus -> small cumulus
// #if defined CloudLayer1 && defined CloudLayer0
// if(otherlayer > 0.0) directLight += LAYER1_DENSITY * 2.0 * GetCumulusDensity(1, progressW + dV_Sun/abs(dV_Sun.y) * max((LAYER1_minHEIGHT+70*dither.y) - progressW.y,0.0), 0, LAYER1_minHEIGHT, LAYER1_maxHEIGHT);
// #endif
// // // altostratus -> cumulus
// // #ifdef CloudLayer2
// // vec3 HighAlt_shadowPos = rayProgress + dV_Sun/abs(dV_Sun.y) * max(LAYER2_HEIGHT - rayProgress.y,0.0);
// // float HighAlt_shadow = GetAltostratusDensity(HighAlt_shadowPos) * CloudLayer2_density;
// // directLight += HighAlt_shadow;
// // #endif
// float skyScatter = clamp(((DUAL_MAX_HEIGHT - 20 - progressW.y) / 275.0) * (0.5+DUAL_DENSITY),0.0,1.0);
// float distantfade = 1- exp( -10*pow(clamp(1.0 - length(progressW - cameraPosition)/(32*65),0.0,1.0),2));
// vec3 cloudlighting = DoCloudLighting(cloudDensity * cumulus, SkyLightColor, skyScatter, directLight, directScattering*sh2, directMultiScattering*sh2, 1);
// color += max(cloudlighting - cloudlighting*exp(-muE*dd*dL),0.0) * absorbance;
// absorbance *= max(exp(-muE*dd*dL),0.0);
// }
// #endif
// if (min(dot(absorbance,vec3(0.335)),1.0) < 1e-5) break;
// }
// return vec4(color, min(dot(absorbance,vec3(0.335)),1.0));
// }

View File

@ -167,15 +167,19 @@ const float entityShadowDistanceMul = 0.25; // [0.01 0.02 0.03 0.04 0.05 0.10 0.
#define FOG_START_HEIGHT 60 // [-200 -190 -180 -170 -160 -150 -130 -120 -110 -100 -90 -80 -70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200]
#define TOD_Fog_mult 1.0 // [0.0 0.25 0.5 0.75 1.0 2.0 3.0 4.0 5.0 10.0 15.0 20.0 25.0 50.0 75.0 100.0]
#define Morning_Uniform_Fog 1.0 // [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 15.0 20.0 25.0 30.0 35.0 40.0 45.0 50.0 75.0 100.0 125.0 150.0 175.0 200.0 255.]
#define Noon_Uniform_Fog 0.0 // [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 15.0 20.0 25.0 30.0 35.0 40.0 45.0 50.0 75.0 100.0 125.0 150.0 175.0 200.0 255.]
#define Evening_Uniform_Fog 3.0 // [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 15.0 20.0 25.0 30.0 35.0 40.0 45.0 50.0 75.0 100.0 125.0 150.0 175.0 200.0 255.]
#define Night_Uniform_Fog 5.0 // [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 15.0 20.0 25.0 30.0 35.0 40.0 45.0 50.0 75.0 100.0 125.0 150.0 175.0 200.0 255.]
#define Morning_Cloudy_Fog 10.0 // [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 15.0 20.0 25.0 30.0 35.0 40.0 45.0 50.0 75.0 100.0 125.0 150.0 175.0 200.0 255.]
#define Noon_Cloudy_Fog 0.0 // [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 15.0 20.0 25.0 30.0 35.0 40.0 45.0 50.0 75.0 100.0 125.0 150.0 175.0 200.0 255.]
#define Evening_Cloudy_Fog 1.0 // [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 15.0 20.0 25.0 30.0 35.0 40.0 45.0 50.0 75.0 100.0 125.0 150.0 175.0 200.0 255.]
#define Night_Cloudy_Fog 5.0 // [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 15.0 20.0 25.0 30.0 35.0 40.0 45.0 50.0 75.0 100.0 125.0 150.0 175.0 200.0 255.]
#define TOD_Fog_mult 1.0 // [0.00 0.25 0.50 0.75 1.0 1.25 1.50 1.75 2.00 3.00 4.00 5.00]
#define Morning_Uniform_Fog 0.01 // [0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
#define Morning_Cloudy_Fog 0.05 // [0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
#define Noon_Uniform_Fog 0.0 // [0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
#define Noon_Cloudy_Fog 0.0 // [0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
#define Evening_Uniform_Fog 0.05 // [0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
#define Evening_Cloudy_Fog 0.0 // [0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
#define Night_Uniform_Fog 0.2 // [0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
#define Night_Cloudy_Fog 0.05 // [0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
#define Haze_amount 1.0 // [0.0 0.2 0.4 0.6 0.8 1.0 1.25 1.5 1.75 2.0 3.0 4.0 5.0]
#define fog_coefficientRayleighR 5.8 // [0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
@ -185,7 +189,7 @@ const float entityShadowDistanceMul = 0.25; // [0.01 0.02 0.03 0.04 0.05 0.10 0.
#define fog_coefficientMieG 3.0 // [0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
#define fog_coefficientMieB 3.0 // [0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
#define RainFog_amount 3 // [0 1 2 3 4 5 6 7 8 9 10 15 20 25]
#define RainFog_amount 0.1 // [0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
#define BLOOMY_FOG 1.5 // [0.0 0.25 0.5 0.75 1.0 1.25 1.5 1.75 2.0 3.0 4.0 6.0 10.0 15.0 20.0]
#define BLOOM_STRENGTH 1.0 // [0.0 0.25 0.5 0.75 1.0 1.25 1.5 1.75 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 15.0 20.0 25.0 50.0 75.0 100.0]
@ -217,26 +221,28 @@ const float entityShadowDistanceMul = 0.25; // [0.01 0.02 0.03 0.04 0.05 0.10 0.
#define PER_BIOME_ENVIRONMENT
#define SWAMP_ENV
#define SWAMP_UNIFORM_DENSITY 50 // [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 15.0 20.0 25.0 30.0 35.0 40.0 45.0 50.0 75.0 100.0 125.0 150.0 175.0 200.0 255.]
#define SWAMP_CLOUDY_DENSITY 0 // [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 15.0 20.0 25.0 30.0 35.0 40.0 45.0 50.0 75.0 100.0 125.0 150.0 175.0 200.0 255.]
#define SWAMP_UNIFORM_DENSITY 0.3 // [0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
#define SWAMP_CLOUDY_DENSITY 0 // [0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
#define SWAMP_R 0.15 // [0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
#define SWAMP_G 0.25 // [0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
#define SWAMP_B 0.05 // [0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
#define JUNGLE_ENV
#define JUNGLE_UNIFORM_DENSITY 10 // [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 15.0 20.0 25.0 30.0 35.0 40.0 45.0 50.0 75.0 100.0 125.0 150.0 175.0 200.0 255.]
#define JUNGLE_CLOUDY_DENSITY 150 // [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 15.0 20.0 25.0 30.0 35.0 40.0 45.0 50.0 75.0 100.0 125.0 150.0 175.0 200.0 255.]
#define JUNGLE_UNIFORM_DENSITY 0.1 // [0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
#define JUNGLE_CLOUDY_DENSITY 0.2 // [0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
#define JUNGLE_R 0.5 // [0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
#define JUNGLE_G 1.0 // [0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
#define JUNGLE_B 0.5 // [0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
#define DARKFOREST_ENV
#define DARKFOREST_UNIFORM_DENSITY 15 // [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 15.0 20.0 25.0 30.0 35.0 40.0 45.0 50.0 75.0 100.0 125.0 150.0 175.0 200.0 255.]
#define DARKFOREST_CLOUDY_DENSITY 0 // [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 15.0 20.0 25.0 30.0 35.0 40.0 45.0 50.0 75.0 100.0 125.0 150.0 175.0 200.0 255.]
#define DARKFOREST_UNIFORM_DENSITY 0.1 // [0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
#define DARKFOREST_CLOUDY_DENSITY 0 // [0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
#define DARKFOREST_R 0.3 // [0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
#define DARKFOREST_G 0.4 // [0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
#define DARKFOREST_B 1.0 // [0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
#define SNOW_STORMS
#define SAND_STORMS
// i have to do this so it shows up in the menu lmao
#ifdef SWAMP_ENV
@ -245,6 +251,10 @@ const float entityShadowDistanceMul = 0.25; // [0.01 0.02 0.03 0.04 0.05 0.10 0.
#endif
#ifdef DARKFOREST_ENV
#endif
#ifdef SNOW_STORMS
#endif
#ifdef SAND_STORMS
#endif
///////////////////////////////////////////////////
// ----- LABPBR MATERIALS RELATED SETTINGS ----- //
@ -275,12 +285,6 @@ const float entityShadowDistanceMul = 0.25; // [0.01 0.02 0.03 0.04 0.05 0.10 0.
#define MAX_ITERATIONS 35 // [5 10 15 20 25 30 40 50 60 70 80 90 100 125 150 200 400]
#define MAX_DIST 25.0 // [5.0 10.0 15.0 20.0 25.0 30.0 40.0 50.0 60.0 70.0 80.0 90.0 100.0 125.0 150.0 200.0 400.0]
// #define HEIGTHMAP_DEPTH_OFFSET
#ifdef POM
#undef HEIGTHMAP_DEPTH_OFFSET
#endif
#define SSS_TYPE 1 // [0 1 2 3]
#define LabSSS_Curve 1.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 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3.0 ]
// #define MOB_SSS
@ -322,7 +326,7 @@ const float entityShadowDistanceMul = 0.25; // [0.01 0.02 0.03 0.04 0.05 0.10 0.
#define sunColorG 0.91 // [0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0 ]
#define sunColorB 0.81 // [0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0 ]
#define moon_illuminance 200.0 //[0.0 10.0 20.0 30.0 40.0 50.0 60.0 70.0 80.0 90.0 100.0 150.0 200.0 300.0 400.0 500.0 600.0 700.0 800.0 900.0 1000.0 2000.0 3000.0 4000.0 5000.0 6000.0 7000.0 8000.0 9000.0 10000.0 11000.0 12000.0 13000.0 14000.0 15000.0 20000.0 30000.0 40000.0 50000.0 60000.0 70000.0 80000.0 90000.0 100000.0 150000.0 200000.0 250000.0 300000.0 400000.0 500000.0]
#define moon_illuminance 50.0 //[0.0 10.0 20.0 30.0 40.0 50.0 60.0 70.0 80.0 90.0 100.0 150.0 200.0 300.0 400.0 500.0 600.0 700.0 800.0 900.0 1000.0 2000.0 3000.0 4000.0 5000.0 6000.0 7000.0 8000.0 9000.0 10000.0 11000.0 12000.0 13000.0 14000.0 15000.0 20000.0 30000.0 40000.0 50000.0 60000.0 70000.0 80000.0 90000.0 100000.0 150000.0 200000.0 250000.0 300000.0 400000.0 500000.0]
#define Moon_temp 15000 // [1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000 2100 2200 2300 2400 2500 2600 2700 2800 2900 3000 3100 3200 3300 3400 3500 3600 3700 3800 3900 4000 4100 4200 4300 4400 4500 4600 4700 4800 4900 5000 5100 5200 5300 4500 5600 5700 5800 5900 6000 6100 6200 6300 6400 6500 6600 6700 6800 6900 7000 7100 7200 7300 7400 7500 7600 7700 7800 7900 8000 8100 8200 8300 8400 8500 8600 8700 8800 8900 9000 9100 9200 9300 9400 9500 9600 9700 9800 9900 10000 15000 20000 25000 50000]
#define moonColorR 0.9080 //[0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0 ]
#define moonColorG 0.9121 //[0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0 ]
@ -406,100 +410,100 @@ uniform int moonPhase;
#define HQ_CLOUDS
// #define Daily_Weather
#define Daily_Weather
// #define CHOOSE_RANDOM_WEATHER_PROFILE
#ifdef Daily_Weather
// DAY 0 WEATHER PARAMETERS
#define DAY0_l0_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY0_l1_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY0_l2_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY0_l0_coverage 0.7 // [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 DAY0_l1_coverage 0.7 // [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 DAY0_l2_coverage 0.1 // [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 DAY0_ufog_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY0_l0_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY0_l1_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY0_l2_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY0_l0_density 0.5 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY0_l1_density 0.5 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY0_l2_density 0.1 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY0_cfog_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
// DAY 1 WEATHER PARAMETERS
#define DAY1_l0_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY1_l1_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY1_l2_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY1_ufog_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY1_l0_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY1_l1_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY1_l2_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY1_cfog_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY1_l0_coverage 0.7 // [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 DAY1_l1_coverage 1.1 // [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 DAY1_l2_coverage 1.0 // [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 DAY1_ufog_density 0.01 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY1_l0_density 0.5 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY1_l1_density 0.5 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY1_l2_density 0.5 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY1_cfog_density 0.1 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
// DAY 2 WEATHER PARAMETERS
#define DAY2_l0_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY2_l1_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY2_l2_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY2_l0_coverage 0.9 // [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 DAY2_l1_coverage 0.0 // [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 DAY2_l2_coverage 0.0 // [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 DAY2_ufog_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY2_l0_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY2_l0_density 0.25 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY2_l1_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY2_l2_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY2_cfog_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
// DAY 3 WEATHER PARAMETERS
#define DAY3_l0_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY3_l1_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY3_l2_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY3_l0_coverage 0.8 // [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 DAY3_l1_coverage 1.0 // [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 DAY3_l2_coverage 0.0 // [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 DAY3_ufog_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY3_l0_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY3_l1_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY3_l0_density 0.7 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY3_l1_density 0.7 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY3_l2_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY3_cfog_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
// DAY 4 WEATHER PARAMETERS
#define DAY4_l0_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY4_l1_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY4_l2_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY4_l0_coverage 0.0 // [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 DAY4_l1_coverage 0.0 // [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 DAY4_l2_coverage 0.6 // [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 DAY4_ufog_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY4_l0_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY4_l1_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY4_l2_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY4_l2_density 1.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY4_cfog_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
// DAY 5 WEATHER PARAMETERS
#define DAY5_l0_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY5_l1_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY5_l2_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY5_l0_coverage 0.8 // [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 DAY5_l1_coverage 0.0 // [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 DAY5_l2_coverage 1.5 // [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 DAY5_ufog_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY5_l0_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY5_l0_density 0.5 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY5_l1_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY5_l2_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY5_l2_density 0.1 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY5_cfog_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
// DAY 6 WEATHER PARAMETERS
#define DAY6_l0_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY6_l1_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY6_l2_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY6_l0_coverage 0.0 // [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 DAY6_l1_coverage 0.8 // [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 DAY6_l2_coverage 1.5 // [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 DAY6_ufog_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY6_l0_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY6_l1_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY6_l2_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY6_l1_density 1.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY6_l2_density 0.02 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY6_cfog_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
// DAY 7 WEATHER PARAMETERS
#define DAY7_l0_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY7_l1_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY7_l2_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY7_l0_coverage 0.0 // [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 DAY7_l1_coverage 0.0 // [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 DAY7_l2_coverage 0.0 // [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 DAY7_ufog_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY7_l0_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY7_l1_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY7_l2_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY7_cfog_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
// DAY 8 WEATHER PARAMETERS
#define DAY8_l0_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY8_l1_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY8_l2_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY8_l0_coverage 0.6 // [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 DAY8_l1_coverage 0.7 // [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 DAY8_l2_coverage 0.3 // [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 DAY8_ufog_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY8_l0_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY8_l1_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY8_l2_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY8_l0_density 1.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY8_l1_density 0.5 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY8_l2_density 1.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY8_cfog_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
// DAY 9 WEATHER PARAMETERS
#define DAY9_l0_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY9_l1_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY9_l2_coverage 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY9_l0_coverage 1.0 // [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 DAY9_l1_coverage 0.0 // [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 DAY9_l2_coverage 1.0 // [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 DAY9_ufog_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY9_l0_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY9_l0_density 1.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY9_l1_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY9_l2_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY9_cfog_density 0.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY9_l2_density 0.1 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define DAY9_cfog_density 1 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#endif
@ -522,7 +526,7 @@ uniform int moonPhase;
#define DOF_QUALITY -1 // [-1 0 1 2 3 4 5]
#define DOF_ANAMORPHIC_RATIO 1.0 // [0.3 0.6 1.0]
// // #define AUTOFOCUS
//#define FAR_BLUR_ONLY
#define focal 2.4 // [0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1.0 1.05 1.1 1.15 1.2 1.25 1.3 1.35 1.4 1.45 1.5 1.55 1.6 1.65 1.7 1.75 1.8 1.85 1.9 1.95 2.0 2.05 2.1 2.15 2.2 2.25 2.3 2.35 2.4 2.45 2.5 2.55 2.6 2.65 2.7 2.75 2.8 2.85 2.9 2.95 3.0 3.05 3.1 3.15 3.2 3.25 3.3 3.35 3.4 3.45 3.5 3.55 3.6 3.65 3.7 3.75 3.8 3.85 3.9 3.95 4.0 4.05 4.1 4.15 4.2 4.25 4.3 4.35 4.4 4.45 4.5 4.55 4.6 4.65 4.7 4.75 4.8 4.85 4.9 4.95 5.0 5.05 5.1 5.15 5.2 5.25 5.3 5.35 5.4 5.45 5.5 5.55 5.6 5.65 5.7 5.75 5.8 5.85 5.9 5.95 6.0 6.05 6.1 6.15 6.2 6.25 6.3 6.35 6.4 6.45 6.5 6.55 6.6 6.65 6.7 6.75 6.8 6.85 6.9 6.95 7.0 7.05 7.1 7.15 7.2 7.25 7.3 7.35 7.4 7.45 7.5 7.55 7.6 7.65 7.7 7.75 7.8 7.85 7.9 7.95 8.0 8.05 8.1 8.15 8.2 8.25 8.3 8.35 8.4 8.45 8.5 8.55 8.6 8.65 8.7 8.75 8.8 8.85 8.9 8.95 9.0 9.05 9.1 9.15 9.2 9.25 9.3 9.35 9.4 9.45 9.5 9.55 9.6 9.65 9.7 9.75 9.8 9.85 9.9 9.95 ]
#define aperture 0.8 // [0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1.0 1.05 1.1 1.15 1.2 1.25 1.3 1.35 1.4 1.45 1.5 1.55 1.6 1.65 1.7 1.75 1.8 1.85 1.9 1.95 2.0 2.05 2.1 2.15 2.2 2.25 2.3 2.35 2.4 2.45 2.5 2.55 2.6 2.65 2.7 2.75 2.8 2.85 2.9 2.95 3.0 3.05 3.1 3.15 3.2 3.25 3.3 3.35 3.4 3.45 3.5 3.55 3.6 3.65 3.7 3.75 3.8 3.85 3.9 3.95 4.0 4.05 4.1 4.15 4.2 4.25 4.3 4.35 4.4 4.45 4.5 4.55 4.6 4.65 4.7 4.75 4.8 4.85 4.9 4.95 5.0 5.05 5.1 5.15 5.2 5.25 5.3 5.35 5.4 5.45 5.5 5.55 5.6 5.65 5.7 5.75 5.8 5.85 5.9 5.95 6.0 6.05 6.1 6.15 6.2 6.25 6.3 6.35 6.4 6.45 6.5 6.55 6.6 6.65 6.7 6.75 6.8 6.85 6.9 6.95 7.0 7.05 7.1 7.15 7.2 7.25 7.3 7.35 7.4 7.45 7.5 7.55 7.6 7.65 7.7 7.75 7.8 7.85 7.9 7.95 8.0 8.05 8.1 8.15 8.2 8.25 8.3 8.35 8.4 8.45 8.5 8.55 8.6 8.65 8.7 8.75 8.8 8.85 8.9 8.95 9.0 9.05 9.1 9.15 9.2 9.25 9.3 9.35 9.4 9.45 9.5 9.55 9.6 9.65 9.7 9.75 9.8 9.85 9.9 9.95 ]
@ -591,9 +595,11 @@ const vec3 HIGHLIGHTS_TARGET = length(vec3(HIGHLIGHTS_GRADE_R, HIGHLIGHTS_GRADE_
const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631), AEROCHROME_PINKNESS);
//#define BICUBIC_UPSCALING
// #define CAMERA_GRIDLINES
// #define MOTION_BLUR
#define MOTION_BLUR_STRENGTH 1.0 // [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]
///////////////////////////////////////////////////////
// ----- GAMEPLAY POST EFFECT RELATED SETTINGS ----- //
///////////////////////////////////////////////////////
@ -663,7 +669,6 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631)
#define LIT_PARTICLE_BRIGHTNESS 1.0 // [1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 15.0 20.0 25.0 30.0 35.0 40.0 45.0 50.0 100.]
#define SELECT_BOX
#define LIGHTNING_FLASH // FOR OPTIFINE USERS. some mods change the sky color, which can trigger the lightning flash detection.
@ -699,10 +704,12 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631)
#endif
// #define DH_SHADOWPROJECTIONTWEAK
#define DH_OVERDRAW_PREVENTION
#define DH_KNOWN_ISSUES 0 // [0 1 2 3 4 5]
#define OVERDRAW_MAX_DISTANCE 0 // [0 32 48 64 80 96 112 128 144 160 176 192 208 224 240 256]
#define DH_AMBIENT_OCCLUSION
#define DH_SUBSURFACE_SCATTERING
#define DH_SCREENSPACE_REFLECTIONS
///////////////////////////////////////////
// ----- FLOODFILL [LPV] SETTINGS ----- //
@ -752,9 +759,14 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631)
// #define BLOOMY_PARTICLES
// #define ORIGINAL_CHOCAPIC_SKY
// #define CLOUDS_INFRONT_OF_WORLD
// #define LARGE_WAVE_DISPLACEMENT
// fix settings
#ifdef DH_SCREENSPACE_REFLECTIONS
#endif
#ifdef DH_SUBSURFACE_SCATTERING
#endif
#ifdef TRANSLUCENT_ENTITIES
#endif
#ifdef RENDER_ENTITY_SHADOWS

View File

@ -109,7 +109,7 @@ vec4 texture2D_bicubic_offset(sampler2D tex, vec2 uv, float noise, float scale)
#endif
vec4 texelSize = vec4(texelSize,1.0/texelSize);
uv = uv*texelSize.zw;
uv = (uv + texelSize.xy)*texelSize.zw;
vec2 iuv = floor( uv + circleOffsets );
vec2 fuv = fract( uv + circleOffsets );

View File

@ -229,7 +229,7 @@ void DoSpecularReflections(
#ifdef Sky_reflection
#ifdef OVERWORLD_SHADER
if(hasReflections) Background_Reflection = (skyCloudsFromTexLOD(L, colortex4, sqrt(Roughness) * 9.0).rgb / 30.0) * Metals;
if(hasReflections) Background_Reflection = (skyCloudsFromTexLOD(L, colortex4, sqrt(Roughness) * 9.0).rgb / 30.0) * Metals ;
#else
if(hasReflections) Background_Reflection = (skyCloudsFromTexLOD2(L, colortex4, sqrt(Roughness) * 6.0).rgb / 30.0) * Metals;
#endif

View File

@ -24,23 +24,27 @@ uniform int worldTime;
vec4 dailyWeatherParams1 = vec4(CloudLayer0_density, CloudLayer1_density, CloudLayer2_density, 0.0);
#endif
float LAYER0_width = 100.0;
float LAYER0_minHEIGHT = CloudLayer0_height;
float LAYER0_maxHEIGHT = 100 + LAYER0_minHEIGHT;
float LAYER0_maxHEIGHT = LAYER0_width + LAYER0_minHEIGHT;
float LAYER1_minHEIGHT = max(CloudLayer1_height,LAYER0_maxHEIGHT);
float LAYER1_maxHEIGHT = 100 + LAYER1_minHEIGHT;
float LAYER1_width = 100.0;
float LAYER1_minHEIGHT = max(CloudLayer1_height, LAYER0_maxHEIGHT);
float LAYER1_maxHEIGHT = LAYER1_width + LAYER1_minHEIGHT;
float LAYER2_HEIGHT = max(CloudLayer2_height,LAYER1_maxHEIGHT);
float LAYER2_HEIGHT = max(CloudLayer2_height, LAYER1_maxHEIGHT);
float LAYER0_COVERAGE = dailyWeatherParams0.x;
float LAYER1_COVERAGE = dailyWeatherParams0.y;
float LAYER2_COVERAGE = dailyWeatherParams0.z;
// float LAYER0_COVERAGE = mix(pow(dailyWeatherParams0.x*2.0,0.2), 0.9, rainStrength);
// float LAYER1_COVERAGE = mix(pow(dailyWeatherParams0.y*2.0,0.2), 0.8, rainStrength);
// float LAYER2_COVERAGE = mix(pow(dailyWeatherParams0.z*2.0,0.2), 1.3, rainStrength);
float LAYER0_DENSITY = dailyWeatherParams1.x;
float LAYER1_DENSITY = dailyWeatherParams1.y;
float LAYER2_DENSITY = dailyWeatherParams1.z;
float LAYER0_COVERAGE = mix(dailyWeatherParams0.x, 0.95, rainStrength);
float LAYER1_COVERAGE = mix(dailyWeatherParams0.y, 0.0, rainStrength);
float LAYER2_COVERAGE = mix(dailyWeatherParams0.z, 1.5, rainStrength);
float rainCloudwetness = rainStrength;
float LAYER0_DENSITY = mix(dailyWeatherParams1.x,1.0,rainStrength);
float LAYER1_DENSITY = mix(dailyWeatherParams1.y,0.0,rainStrength);
float LAYER2_DENSITY = mix(dailyWeatherParams1.z,0.05,rainStrength);
uniform int worldDay;
@ -64,25 +68,14 @@ float densityAtPos(in vec3 pos){
float GetAltostratusDensity(vec3 pos){
float Coverage; float Density;
float large = texture2D(noisetex, (pos.xz + cloud_movement)/100000. ).b;
float small = texture2D(noisetex, (pos.xz - cloud_movement)/10000. - vec2(-large,1-large)/5).b;
large = max(large + LAYER2_COVERAGE - 0.5, 0.0);
// float shape = (small + pow((1.0-large),2.0))/2.0;
float large = 1.0 - texture2D(noisetex, (pos.xz + cloud_movement)/100000.).b;
large = max(large + LAYER2_COVERAGE - 0.7, 0.0);
float weight = 0.7;
float shape = max( large*weight - small*(1.0-weight) ,0.0);
shape *= shape;
float medium = 1.0 - texture2D(noisetex, (pos.xz - cloud_movement)/7500. + vec2(-large,1.0-large)/5.0).b;
float shape = max(large - medium*0.4 * clamp(1.5-large,0.0,1.0),0.0);
// infinite vertical height will mess with lighting, so get rid of it.
// shape = max(shape - pow(abs(LAYER2_HEIGHT - pos.y)/20,1.5), 0.0);
shape = min(min(shape , clamp((LAYER2_HEIGHT + 15) - pos.y,0,1)), 1.0 - clamp(LAYER2_HEIGHT - pos.y,0,1));
return shape;
return shape*shape;
}
float cloudCov(int layer, in vec3 pos, vec3 samplePos, float minHeight, float maxHeight){
@ -95,8 +88,13 @@ float cloudCov(int layer, in vec3 pos, vec3 samplePos, float minHeight, float ma
// curvature = clamp(1.0 - length(pos - cameraPosition)/(32*128),0.0,1.0);
float LAYER0_minHEIGHT_FOG = CloudLayer0_height;
float LAYER0_maxHEIGHT_FOG = 100 + LAYER0_minHEIGHT_FOG;
LAYER0_minHEIGHT_FOG = LAYER0_minHEIGHT;
LAYER0_maxHEIGHT_FOG = LAYER0_maxHEIGHT;
float LAYER1_minHEIGHT_FOG = max(CloudLayer1_height, LAYER0_maxHEIGHT);
float LAYER1_maxHEIGHT_FOG = 100 + LAYER1_minHEIGHT_FOG;
LAYER1_minHEIGHT_FOG = LAYER1_minHEIGHT;
LAYER1_maxHEIGHT_FOG = LAYER1_maxHEIGHT;
vec2 SampleCoords0 = vec2(0.0); vec2 SampleCoords1 = vec2(0.0);
@ -132,26 +130,26 @@ float cloudCov(int layer, in vec3 pos, vec3 samplePos, float minHeight, float ma
if(layer == 0){
coverage = abs(CloudLarge*2.0 - 1.2)*0.5 - (1.0-CloudSmall);
float layer0 = min(min(coverage + dailyWeatherParams0.x, clamp(LAYER0_maxHEIGHT_FOG - pos.y,0,1)), 1.0 - clamp(LAYER0_minHEIGHT_FOG - pos.y,0,1));
float layer0 = min(min(coverage + LAYER0_COVERAGE, clamp(LAYER0_maxHEIGHT_FOG - pos.y,0,1)), 1.0 - clamp(LAYER0_minHEIGHT_FOG - pos.y,0,1));
Topshape = max(pos.y - (LAYER0_maxHEIGHT_FOG - 75),0.0) / 200.0;
Topshape += max(pos.y - (LAYER0_maxHEIGHT_FOG - 10),0.0) / 15.0;
Baseshape = max(LAYER0_minHEIGHT_FOG + 12.5 - pos.y, 0.0) / 50.0;
FinalCloudCoverage = max(layer0 - Topshape - Baseshape * rainStrength,0.0);
FinalCloudCoverage = max(layer0 - Topshape - Baseshape * (1.0-rainStrength),0.0);
}
if(layer == 1){
coverage = abs(CloudLarge-0.8) - CloudSmall;
float layer1 = min(min(coverage + dailyWeatherParams0.y - 0.5,clamp(LAYER1_maxHEIGHT_FOG - pos.y,0,1)), 1.0 - clamp(LAYER1_minHEIGHT_FOG - pos.y,0,1));
float layer1 = min(min(coverage + LAYER1_COVERAGE - 0.5,clamp(LAYER1_maxHEIGHT_FOG - pos.y,0,1)), 1.0 - clamp(LAYER1_minHEIGHT_FOG - pos.y,0,1));
Topshape = max(pos.y - (LAYER1_maxHEIGHT_FOG - 75),0.0) / 200.0;
Topshape += max(pos.y - (LAYER1_maxHEIGHT_FOG - 10), 0.0) / 15.0;
Baseshape = max(LAYER1_minHEIGHT_FOG + 15.5 - pos.y, 0.0) / 50.0;
FinalCloudCoverage = max(layer1 - Topshape - Baseshape * rainStrength, 0.0);
FinalCloudCoverage = max(layer1 - Topshape*Topshape - Baseshape * (1.0-rainStrength), 0.0);
}
@ -161,7 +159,7 @@ float cloudCov(int layer, in vec3 pos, vec3 samplePos, float minHeight, float ma
#ifdef CloudLayer0
float layer0_coverage = abs(CloudLarge*2.0 - 1.2)*0.5 - (1.0-CloudSmall);
float layer0 = min(min(layer0_coverage + dailyWeatherParams0.x, clamp(LAYER0_maxHEIGHT_FOG - pos.y,0,1)), 1.0 - clamp(LAYER0_minHEIGHT_FOG - pos.y,0,1));
float layer0 = min(min(layer0_coverage + LAYER0_COVERAGE, clamp(LAYER0_maxHEIGHT_FOG - pos.y,0,1)), 1.0 - clamp(LAYER0_minHEIGHT_FOG - pos.y,0,1));
Topshape = max(pos.y - (LAYER0_maxHEIGHT_FOG - 75),0.0) / 200.0;
Topshape += max(pos.y - (LAYER0_maxHEIGHT_FOG - 10),0.0) / 50.0;
@ -173,7 +171,7 @@ float cloudCov(int layer, in vec3 pos, vec3 samplePos, float minHeight, float ma
#ifdef CloudLayer1
float layer1_coverage = abs(CloudLarge-0.8) - CloudSmall;
float layer1 = min(min(layer1_coverage + dailyWeatherParams0.y - 0.5,clamp(LAYER1_maxHEIGHT_FOG - pos.y,0,1)), 1.0 - clamp(LAYER1_minHEIGHT_FOG - pos.y,0,1));
float layer1 = min(min(layer1_coverage + LAYER1_COVERAGE - 0.5,clamp(LAYER1_maxHEIGHT_FOG - pos.y,0,1)), 1.0 - clamp(LAYER1_minHEIGHT_FOG - pos.y,0,1));
Topshape = max(pos.y - (LAYER1_maxHEIGHT_FOG - 75), 0.0) / 200;
Topshape += max(pos.y - (LAYER1_maxHEIGHT_FOG - 10 ), 0.0) / 50;
@ -202,9 +200,9 @@ float cloudVol(int layer, in vec3 pos, in vec3 samplePos, in float cov, in int L
samplePos.xz -= cloud_movement/4;
samplePos.xz += pow( max(pos.y - (minHeight+20), 0.0) / 20.0,1.50) * upperPlane;
samplePos.xz += pow( max(pos.y - (minHeight+20), 0.0) / 20.0,1.50) ;
noise += (1.0-densityAtPos(samplePos * mix(100.0,200.0,upperPlane)) ) * sqrt(1.0-cov);
noise += (1.0-densityAtPos(samplePos * mix(100.0,200.0,upperPlane)) ) * sqrt(1.0-cov);
if (LoD > 0){
noise += abs( densityAtPos(samplePos * mix(450.0,600.0,upperPlane) ) - (1.0-clamp(((maxHeight - pos.y) / 100.0),0.0,1.0))) * 0.75 * (1.0-cov);
@ -233,7 +231,6 @@ float GetCumulusDensity(int layer, in vec3 pos, in int LoD, float minHeight, flo
#ifndef CLOUDSHADOWSONLY
uniform sampler2D colortex4; //Skybox
//Mie phase function
float phaseg(float x, float g){
float gg = g * g;
@ -242,7 +239,6 @@ float phaseg(float x, float g){
vec3 DoCloudLighting(
float density,
float densityFaded,
vec3 skyLightCol,
float skyScatter,
@ -250,17 +246,20 @@ vec3 DoCloudLighting(
float sunShadows,
vec3 sunScatter,
vec3 sunMultiScatter,
float distantfog
){
float powder = 1.0 - exp(-5.0 * sqrt(density));
vec3 indirectLight = skyLightCol * mix(1.0, 1.0 - exp(-1.0 * (1.0-sqrt(density))), skyScatter*skyScatter*skyScatter * distantfog);
float distantfog,
int layer
){
float powder = 1.0 - exp(-10.0 * density);
vec3 directLight = sunMultiScatter * exp(-3.0 * sunShadows) * powder + sunScatter * exp(-10.0 * sunShadows);
// return indirectLight;
vec3 indirectLight = skyLightCol * mix(1.0, 2.0 * (1.0 - sqrt((skyScatter*skyScatter*skyScatter)*density)) , pow(distantfog,1.0 - rainStrength*0.5));
// return directLight;
return indirectLight + directLight;
// #ifndef TEST
// return indirectLight;
// #endif
return directLight + indirectLight;
}
vec4 renderLayer(
@ -314,20 +313,22 @@ if(layer == 2){
if(max(signFlip * normalize(dV_view).y,0.0) <= 0.0){
float altostratus = GetAltostratusDensity(rayProgress);
float AltoWithDensity = altostratus * cloudDensity;
if(altostratus > 1e-5){
float muE = altostratus * cloudDensity;
float directLight = 0.0;
for (int j = 0; j < 2; j++){
vec3 shadowSamplePos_high = rayProgress + dV_Sun * (100.0 + j * (20.0 + dither*10.0));
// lower the step size as the sun gets higher in the sky
vec3 shadowSamplePos_high = rayProgress + dV_Sun * (1.0 + j * dither) / (pow(abs(dV_Sun.y*0.5),3.0) * 0.995 + 0.005);
float shadow = GetAltostratusDensity(shadowSamplePos_high) * cloudDensity;
directLight += shadow;
// lower density as the sun gets higher in the sky to simulate.... multiscattering or something idk it looks better this way
directLight += GetAltostratusDensity(shadowSamplePos_high) * cloudDensity * (1.0-abs(dV_Sun.y));
}
float skyscatter_alto = sqrt(altostratus*0.05) * cloudDensity;
vec3 lighting = DoCloudLighting(altostratus, 1.0, skyLightCol, skyscatter_alto, directLight, sunScatter, sunMultiScatter, distantfog);
vec3 lighting = DoCloudLighting(AltoWithDensity, skyLightCol, 0.5, directLight, sunScatter, sunMultiScatter, distantfog, layer);
COLOR += max(lighting - lighting*exp(-mult*muE),0.0) * TOTAL_EXTINCTION;
TOTAL_EXTINCTION *= max(exp(-mult*muE),0.0);
@ -338,8 +339,8 @@ if(layer == 2){
}else{
#if defined CloudLayer1 && defined CloudLayer0
float upperLayerOcclusion = layer == 0 ? LAYER1_DENSITY *2* GetCumulusDensity(1, rayProgress + vec3(0.0,1.0,0.0) * max((LAYER1_minHEIGHT+30) - rayProgress.y,0.0), 0, LAYER1_minHEIGHT, LAYER1_maxHEIGHT) : 0.0;
float skylightOcclusion = max(exp2(-5.0 * (upperLayerOcclusion*upperLayerOcclusion)), 0.75 + (1.0-distantfog)*0.25);
float upperLayerOcclusion = layer == 0 ? GetCumulusDensity(1, rayProgress + vec3(0.0,1.0,0.0) * max((LAYER1_minHEIGHT+30) - rayProgress.y,0.0), 0, LAYER1_minHEIGHT, LAYER1_maxHEIGHT) : 0.0;
float skylightOcclusion = mix(1.0, (1.0 - LAYER1_DENSITY)*0.8 + 0.2, (1.0 - exp2(-5.0 * (upperLayerOcclusion*upperLayerOcclusion))) * distantfog);
#else
float skylightOcclusion = 1.0;
#endif
@ -356,15 +357,15 @@ if(layer == 2){
if(clamp(rayProgress.y - maxHeight,0.0,1.0) < 1.0 && clamp(rayProgress.y - minHeight,0.0,1.0) > 0.0){
float cumulus = GetCumulusDensity(layer, rayProgress, 1, minHeight, maxHeight);
float fadedDensity = cloudDensity * pow(clamp((rayProgress.y - minHeight)/25,0.0,1.0),2.0);
float CumulusWithDensity = cloudDensity * cumulus;
float fadedDensity = cloudDensity * clamp(exp( (rayProgress.y - (maxHeight - 75)) / 9.0 ),0.0,1.0);
if(CumulusWithDensity > 1e-5 ){ // make sure no work is done on pixels with no densities
float muE = cumulus * fadedDensity;
float directLight = 0.0;
for (int j=0; j < 3; j++){
vec3 shadowSamplePos = rayProgress + dV_Sun * (20.0 + j * (20.0 + dither*10.0));
vec3 shadowSamplePos = rayProgress + dV_Sun * (20.0 + j * (20.0 + dither*20.0));
directLight += GetCumulusDensity(layer, shadowSamplePos, 0, minHeight, maxHeight) * cloudDensity;
}
@ -376,12 +377,12 @@ if(layer == 2){
// altostratus -> cumulus
#ifdef CloudLayer2
vec3 HighAlt_shadowPos = rayProgress + dV_Sun/abs(dV_Sun.y) * max(LAYER2_HEIGHT - rayProgress.y,0.0);
float HighAlt_shadow = GetAltostratusDensity(HighAlt_shadowPos) * CloudLayer2_density;
float HighAlt_shadow = GetAltostratusDensity(HighAlt_shadowPos) * CloudLayer2_density * (1.0-abs(WsunVec.y));
directLight += HighAlt_shadow;
#endif
float skyScatter = clamp(((maxHeight - rayProgress.y) / 100.0),0.0,1.0); // linear gradient from bottom to top of cloud layer
vec3 lighting = DoCloudLighting(CumulusWithDensity, muE, skyLightCol * skylightOcclusion, skyScatter, directLight, sunScatter, sunMultiScatter, distantfog);
vec3 lighting = DoCloudLighting(CumulusWithDensity, skyLightCol * skylightOcclusion, skyScatter, directLight, sunScatter, sunMultiScatter, distantfog, layer);
COLOR += max(lighting - lighting*exp(-mult*muE),0.0) * TOTAL_EXTINCTION;
@ -413,13 +414,14 @@ vec3 layerStartingPosition(
return position;
}
vec4 renderClouds(
vec3 FragPosition,
vec2 Dither,
vec3 LightColor,
vec3 SkyColor
){
vec3 SignedWsunvec = WsunVec;
vec3 WsunVec = WsunVec * (float(sunElevation > 1e-5)*2.0-1.0);
#ifndef VOLUMETRIC_CLOUDS
return vec4(0.0,0.0,0.0,1.0);
@ -436,24 +438,23 @@ vec4 renderClouds(
//project pixel position into projected shadowmap space
vec4 viewPos = normalize(gbufferModelViewInverse * vec4(FragPosition,1.0) );
// maxIT_clouds = int(clamp(maxIT_clouds / sqrt(exp2(viewPos.y)),0.0, maxIT));
maxIT_clouds = int(clamp(maxIT_clouds / sqrt(exp2(viewPos.y)),0.0, maxIT));
// maxIT_clouds = 15;
vec3 dV_view = normalize(viewPos.xyz);
vec3 dV_viewTEST = viewPos.xyz;
// this is the cloud curvature.
dV_view.y += 0.025 * heightRelativeToClouds;
vec3 dV_view_Alto = dV_view;
dV_view_Alto *= 100/abs(dV_view_Alto.y)/15;
dV_view_Alto *= 5.0/abs(dV_view_Alto.y);
float mult_alto = length(dV_view_Alto);
dV_view *= 90/abs(dV_view.y)/maxIT_clouds;
float mult = length(dV_view);
// dV_view *= (LAYER0_maxHEIGHT - LAYER0_minHEIGHT)/abs(dV_view.y)/maxIT_clouds;
vec3 dV_viewTEST = dV_view * (90.0/abs(dV_view.y)/maxIT_clouds);
float mult = length(dV_viewTEST);
//////////////////////////////////////////
////// lighting stuff
@ -464,19 +465,17 @@ vec4 renderClouds(
vec3 dV_Sun = WsunVec*shadowStep;
float SdotV = dot(mat3(gbufferModelView)*WsunVec, normalize(FragPosition));
float mieDay = phaseg(SdotV, 0.75);
float mieDay = phaseg(SdotV, 0.85) + phaseg(SdotV, 0.75);
float mieDayMulti = (phaseg(SdotV, 0.35) + phaseg(-SdotV, 0.35) * 0.5) ;
vec3 directScattering = LightColor * mieDay * 3.14;
vec3 directMultiScattering = LightColor * mieDayMulti * 3.14;
vec3 directScattering = LightColor * mieDay * 3.14 ;
vec3 directMultiScattering = LightColor * mieDayMulti * 3.14 * 2.0;
vec3 sunIndirectScattering = LightColor;// * phaseg(dot(mat3(gbufferModelView)*vec3(0,1,0),normalize(FragPosition)), 0.5) * 3.14;
// use this to blend into the atmosphere's ground.
vec3 approxdistance = normalize(dV_view);
vec3 approxdistance = normalize(dV_viewTEST);
#ifdef SKY_GROUND
float distantfog = mix(1.0, max(1.0 - clamp(exp2(pow(abs(approxdistance.y),1.5) * -100.0),0.0,1.0),0.0), heightRelativeToClouds);
float distantfog = mix(1.0, max(1.0 - clamp(exp2(pow(abs(approxdistance.y),mix(1.5, 4.0, rainStrength)) * -mix(100.0, 35.0, rainStrength)),0.0,1.0),0.0), heightRelativeToClouds);
#else
float distantfog = 1.0;
float distantfog2 = mix(1.0, max(1.0 - clamp(exp(pow(abs(approxdistance.y),1.5) * -35.0),0.0,1.0),0.0), heightRelativeToClouds);
@ -485,11 +484,12 @@ vec4 renderClouds(
// terrible fake rayleigh scattering
vec3 rC = vec3(sky_coefficientRayleighR*1e-6, sky_coefficientRayleighG*1e-5, sky_coefficientRayleighB*1e-5)*3.0;
float atmosphere = exp(abs(approxdistance.y) * -5.0);
vec3 scatter = exp(-10000.0 * rC * atmosphere) * distantfog;
vec3 scatter = distantfog * exp(-10000.0 * rC * atmosphere);
directScattering *= scatter;
directMultiScattering *= scatter;
// sunIndirectScattering *= scatter;
SkyColor *= mix(1.0* Sky_Brightness, 1.0-pow(1.0-clamp(SignedWsunvec.y,0.0,1.0),5.0) * 0.75 + 0.25, distantfog);
//////////////////////////////////////////
////// render Cloud layers and do blending orders
@ -515,17 +515,19 @@ vec4 renderClouds(
#ifdef CloudLayer0
vec3 layer0_start = layerStartingPosition(dV_view, cameraPosition, Dither.y, MinHeight, MaxHeight);
vec3 layer0_dV_view = dV_view * (LAYER0_width/abs(dV_view.y)/maxIT_clouds);
vec3 layer0_start = layerStartingPosition(layer0_dV_view, cameraPosition, Dither.y, MinHeight, MaxHeight);
#endif
#ifdef CloudLayer1
vec3 layer1_start = layerStartingPosition(dV_view, cameraPosition, Dither.y, MinHeight1, MaxHeight1);
vec3 layer1_dV_view = dV_view * (LAYER1_width/abs(dV_view.y)/maxIT_clouds);
vec3 layer1_start = layerStartingPosition(layer1_dV_view, cameraPosition, Dither.y, MinHeight1, MaxHeight1);
#endif
#ifdef CloudLayer2
vec3 layer2_start = layerStartingPosition(dV_view_Alto, cameraPosition, Dither.y, Height2, Height2);
#endif
#ifdef CloudLayer0
vec4 layer0 = renderLayer(0, layer0_start, dV_view, mult, Dither.x, maxIT_clouds, MinHeight, MaxHeight, dV_Sun, LAYER0_DENSITY, SkyColor, directScattering, directMultiScattering* 2.0, sunIndirectScattering, distantfog, false, FragPosition);
vec4 layer0 = renderLayer(0, layer0_start, layer0_dV_view, mult, Dither.x, maxIT_clouds, MinHeight, MaxHeight, dV_Sun, LAYER0_DENSITY, SkyColor, directScattering, directMultiScattering, sunIndirectScattering, distantfog, false, FragPosition);
total_extinction *= layer0.a;
// stop overdraw.
@ -537,7 +539,7 @@ vec4 renderClouds(
#endif
#ifdef CloudLayer1
vec4 layer1 = renderLayer(1, layer1_start, dV_view, mult, Dither.x, maxIT_clouds, MinHeight1, MaxHeight1, dV_Sun, LAYER1_DENSITY, SkyColor, directScattering, directMultiScattering* 2.0, sunIndirectScattering, distantfog, notVisible, FragPosition);
vec4 layer1 = renderLayer(1, layer1_start, layer1_dV_view, mult, Dither.x, maxIT_clouds, MinHeight1, MaxHeight1, dV_Sun, LAYER1_DENSITY, SkyColor, directScattering, directMultiScattering, sunIndirectScattering, distantfog, notVisible, FragPosition);
total_extinction *= layer1.a;
// stop overdraw.
@ -545,7 +547,7 @@ vec4 renderClouds(
#endif
#ifdef CloudLayer2
vec4 layer2 = renderLayer(2, layer2_start, dV_view_Alto, mult_alto, Dither.x, maxIT_clouds, Height2, Height2, dV_Sun, LAYER2_DENSITY, SkyColor, directScattering, directMultiScattering,sunIndirectScattering, distantfog, altoNotVisible, FragPosition);
vec4 layer2 = renderLayer(2, layer2_start, dV_view_Alto, mult_alto, Dither.x, maxIT_clouds, Height2, Height2, dV_Sun, LAYER2_DENSITY, SkyColor, directScattering * (1.0 + rainStrength*3), directMultiScattering* (1.0 + rainStrength*3), sunIndirectScattering, distantfog, altoNotVisible, FragPosition);
total_extinction *= layer2.a;
#endif
@ -585,7 +587,7 @@ vec4 renderClouds(
#endif
#ifndef SKY_GROUND
vec3 normView = normalize(dV_view);
vec3 normView = normalize(dV_viewTEST);
vec4 fogcolor = vec4(skyFromTex(normView, colortex4)/30.0, 0.0);
return mix(fogcolor, vec4(color, total_extinction), clamp(distantfog2,0.0,1.0));
@ -606,15 +608,15 @@ float GetCloudShadow(vec3 feetPlayerPos){
// assume a flat layer of cloud, and stretch the sampled density along the sunvector, starting from some vertical layer in the cloud.
#ifdef CloudLayer0
vec3 lowShadowStart = playerPos + (WsunVec / max(abs(WsunVec.y),0.0)) * max((CloudLayer0_height + 30) - playerPos.y,0.0) ;
shadow += GetCumulusDensity(0, lowShadowStart, 0, CloudLayer0_height, CloudLayer0_height+100)*dailyWeatherParams1.x;
shadow += GetCumulusDensity(0, lowShadowStart, 0, CloudLayer0_height, CloudLayer0_height+100)*LAYER0_DENSITY;
#endif
#ifdef CloudLayer1
vec3 higherShadowStart = playerPos + (WsunVec / max(abs(WsunVec.y),0.0)) * max((CloudLayer1_height + 50) - playerPos.y,0.0) ;
shadow += GetCumulusDensity(1, higherShadowStart, 0, CloudLayer1_height, CloudLayer1_height+100)*dailyWeatherParams1.y;
shadow += GetCumulusDensity(1, higherShadowStart, 0, CloudLayer1_height, CloudLayer1_height+100)*LAYER1_DENSITY;
#endif
#ifdef CloudLayer2
vec3 highShadowStart = playerPos + (WsunVec / max(abs(WsunVec.y),0.0)) * max(CloudLayer2_height - playerPos.y,0.0);
shadow += GetAltostratusDensity(highShadowStart) * dailyWeatherParams1.z;
shadow += GetAltostratusDensity(highShadowStart) * CloudLayer2_density * (1.0-abs(WsunVec.y));
#endif
shadow = clamp(shadow,0.0,1.0);
@ -636,15 +638,15 @@ float GetCloudShadow_VLFOG(vec3 WorldPos, vec3 WorldSpace_sunVec){
#ifdef CloudLayer0
vec3 lowShadowStart = WorldPos + (WorldSpace_sunVec / max(abs(WorldSpace_sunVec.y),0.0)) * max((CloudLayer0_height + 30) - WorldPos.y,0.0) ;
shadow += max(GetCumulusDensity(0, lowShadowStart, 0, CloudLayer0_height, CloudLayer0_height+100),0.0)*dailyWeatherParams1.x;
shadow += max(GetCumulusDensity(0, lowShadowStart, 0, CloudLayer0_height, CloudLayer0_height+100),0.0)*LAYER0_DENSITY;
#endif
#ifdef CloudLayer1
vec3 higherShadowStart = WorldPos + (WorldSpace_sunVec / max(abs(WorldSpace_sunVec.y),0.0)) * max((CloudLayer1_height + 30) - WorldPos.y,0.0) ;
shadow += max(GetCumulusDensity(1,higherShadowStart, 0, CloudLayer1_height,CloudLayer1_height+100) ,0.0)*dailyWeatherParams1.y;
shadow += max(GetCumulusDensity(1,higherShadowStart, 0, CloudLayer1_height,CloudLayer1_height+100) ,0.0)*LAYER1_DENSITY;
#endif
#ifdef CloudLayer2
vec3 highShadowStart = WorldPos + (WorldSpace_sunVec / max(abs(WorldSpace_sunVec.y),0.0)) * max(CloudLayer2_height - WorldPos.y,0.0);
shadow += GetAltostratusDensity(highShadowStart)*dailyWeatherParams1.z * 0.5;
shadow += GetAltostratusDensity(highShadowStart)*LAYER2_DENSITY * (1.0-abs(WorldSpace_sunVec.y));
#endif
shadow = clamp(shadow,0.0,1.0);