From 432674bc59e9e6845c6c788c0f9bf8592640ff8f Mon Sep 17 00:00:00 2001 From: Xonk Date: Sun, 11 Jun 2023 17:28:54 -0400 Subject: [PATCH] fix more TAAU shenanigans in the nether --- shaders/lib/climate_settings.glsl | 32 +++++++++++++----------------- shaders/lib/diffuse_lighting.glsl | 4 ++-- shaders/lib/volumetricClouds.glsl | 19 ++++++++++-------- shaders/programs/all_solid.vsh | 3 ++- shaders/shaders.properties | 28 +++++++++++++------------- shaders/world-1/gbuffers_block.fsh | 2 +- shaders/world-1/gbuffers_block.vsh | 2 +- 7 files changed, 45 insertions(+), 45 deletions(-) diff --git a/shaders/lib/climate_settings.glsl b/shaders/lib/climate_settings.glsl index 708609f..37fc501 100644 --- a/shaders/lib/climate_settings.glsl +++ b/shaders/lib/climate_settings.glsl @@ -2,19 +2,18 @@ // i gotta start centralizing shit someday. -uniform float Day; -uniform float worldDay; +// uniform float Day; -// it's so symmetrical~ +// // it's so symmetrical~ -float day0 = clamp(clamp(Day, 0.0,1.0)*clamp(2-Day, 0.0,1.0),0.0,1.0); -float day1 = clamp(clamp(Day-1, 0.0,1.0)*clamp(3-Day, 0.0,1.0),0.0,1.0); -float day2 = clamp(clamp(Day-2, 0.0,1.0)*clamp(4-Day, 0.0,1.0),0.0,1.0); -float day3 = clamp(clamp(Day-3, 0.0,1.0)*clamp(5-Day, 0.0,1.0),0.0,1.0); -float day4 = clamp(clamp(Day-4, 0.0,1.0)*clamp(6-Day, 0.0,1.0),0.0,1.0); -float day5 = clamp(clamp(Day-5, 0.0,1.0)*clamp(7-Day, 0.0,1.0),0.0,1.0); -float day6 = clamp(clamp(Day-6, 0.0,1.0)*clamp(8-Day, 0.0,1.0),0.0,1.0); -float day7 = clamp(clamp(Day-7, 0.0,1.0)*clamp(9-Day, 0.0,1.0),0.0,1.0); +// float day0 = clamp(clamp(Day, 0.0,1.0)*clamp(2-Day, 0.0,1.0),0.0,1.0); +// float day1 = clamp(clamp(Day-1, 0.0,1.0)*clamp(3-Day, 0.0,1.0),0.0,1.0); +// float day2 = clamp(clamp(Day-2, 0.0,1.0)*clamp(4-Day, 0.0,1.0),0.0,1.0); +// float day3 = clamp(clamp(Day-3, 0.0,1.0)*clamp(5-Day, 0.0,1.0),0.0,1.0); +// float day4 = clamp(clamp(Day-4, 0.0,1.0)*clamp(6-Day, 0.0,1.0),0.0,1.0); +// float day5 = clamp(clamp(Day-5, 0.0,1.0)*clamp(7-Day, 0.0,1.0),0.0,1.0); +// float day6 = clamp(clamp(Day-6, 0.0,1.0)*clamp(8-Day, 0.0,1.0),0.0,1.0); +// float day7 = clamp(clamp(Day-7, 0.0,1.0)*clamp(9-Day, 0.0,1.0),0.0,1.0); /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// @@ -92,14 +91,9 @@ float day7 = clamp(clamp(Day-7, 0.0,1.0)*clamp(9-Day, 0.0,1.0),0.0,1.0); #ifdef WEATHERCLOUDS + uniform float Cumulus_Cov; - uniform float Alto_Cov; - uniform float Alto_Den; - - uniform float CirrusCoverage; - uniform float CirrusThickness; - float DailyWeather_Cumulus( float Coverage ){ @@ -113,11 +107,13 @@ float day7 = clamp(clamp(Day-7, 0.0,1.0)*clamp(9-Day, 0.0,1.0),0.0,1.0); return Coverage; } + uniform float Alto_Cov; + uniform float Alto_Den; + void DailyWeather_Alto( inout float Coverage, inout float Density ){ - #ifdef Daily_Weather Coverage = Alto_Cov; Density = Alto_Den; diff --git a/shaders/lib/diffuse_lighting.glsl b/shaders/lib/diffuse_lighting.glsl index df13c0a..1a96423 100644 --- a/shaders/lib/diffuse_lighting.glsl +++ b/shaders/lib/diffuse_lighting.glsl @@ -10,10 +10,10 @@ vec3 DoAmbientLighting (vec3 SkyColor, vec3 TorchColor, vec2 Lightmap, float sky vec3 TorchLight = TorchColor * pow(1.0-pow(1.0-clamp(Lightmap.x,0.0,1.0) ,0.1),2); - TorchLight = exp(TorchLight * 30) - 1.0; + TorchLight = clamp(exp(TorchLight * 30) - 1.0,0.0,5.0); - vec3 SkyLight = max((SkyColor * 8./150./3.) * pow(Lightmap.y,3.0) , vec3(0.2,0.4,1.0) * (MIN_LIGHT_AMOUNT*0.01)) ; + vec3 SkyLight = max((SkyColor * 8./150./3.) * min(pow(Lightmap.y,3.0),1.0) , vec3(0.2,0.4,1.0) * (MIN_LIGHT_AMOUNT*0.01)) ; // vec3 SkyLight = max((SkyColor * 8./150./3.) * pow(Lightmap.y,3.0),0.0) ; diff --git a/shaders/lib/volumetricClouds.glsl b/shaders/lib/volumetricClouds.glsl index f2124d7..f0ed4f3 100644 --- a/shaders/lib/volumetricClouds.glsl +++ b/shaders/lib/volumetricClouds.glsl @@ -111,7 +111,7 @@ float GetAltostratusDensity(vec3 pos){ float shape = (small + pow((1.0-large),2.0))/2.0; float Coverage; float Density; - DailyWeather_Alto(Coverage,Density); + DailyWeather_Alto(Coverage, Density); shape = pow(max(shape + Coverage - 0.5,0.0),2.0); shape *= Density; @@ -142,12 +142,14 @@ vec3 Cloud_lighting( float lesspowder = powder*0.4+0.6; - vec3 skyLighting = SkyColors; + vec3 skyLighting = SkyColors; // skyLighting = vec3(0.0); #ifdef Altostratus - float Coverage = 0.0; float Density = 0.0; - DailyWeather_Alto(Coverage,Density); - skyLighting += sunContributionMulti * exp(-SunShadowing) * clamp((1.0 - abs(pow(Density*4.0 - 1.1,4.0))) * Coverage,0,1) ; + /// a special conditon where scattered light exiting altocumulus clouds come down onto the cumulus clouds below. + float cov = 0.0; + float den = 0.0; + DailyWeather_Alto(cov, den); + skyLighting += (sunContributionMulti * exp(-SunShadowing)) * clamp( 1.0 - pow( abs(den - 0.35) * 4.0 , 5.0) ,0.0,1.0) * cov; #endif skyLighting *= exp(SkyShadowing * AmbientShadow * coeeff/2.0 ) * lesspowder ; @@ -164,6 +166,7 @@ vec3 Cloud_lighting( vec3 moonLighting = exp(MoonShadowing * coeeff/4 + powder) * moonContribution; return skyLighting + moonLighting + sunLighting ; + // return skyLighting; } @@ -371,10 +374,10 @@ float GetCloudShadow_VLFOG(vec3 WorldPos){ float shadow = 0.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 + #ifdef Cumulus vec3 lowShadowStart = WorldPos + WsunVec/abs(WsunVec.y) * max((MaxCumulusHeight - 60) - WorldPos.y,0.0) ; shadow += GetCumulusDensity(lowShadowStart,0)*Cumulus_density; - // #endif + #endif #ifdef Altostratus vec3 highShadowStart = WorldPos + WsunVec/abs(WsunVec.y) * max(AltostratusHeight - WorldPos.y,0.0); @@ -383,7 +386,7 @@ float GetCloudShadow_VLFOG(vec3 WorldPos){ // shadow = shadow/2.0; // perhaps i should average the 2 shadows being added.... - shadow = clamp(exp(-shadow*255.0),0.0,1.0); + shadow = clamp(exp(-shadow*35.0),0.0,1.0); // do not allow it to exist above the lowest cloud plane // shadow *= clamp(((MaxCumulusHeight + CumulusHeight)*0.435 - WorldPos.y)/100,0.0,1.0) ; diff --git a/shaders/programs/all_solid.vsh b/shaders/programs/all_solid.vsh index 819d451..abf33d8 100644 --- a/shaders/programs/all_solid.vsh +++ b/shaders/programs/all_solid.vsh @@ -127,13 +127,14 @@ void main() { normalMat.a = 0.9; } - gl_Position = toClipSpace3(position); #endif + gl_Position = toClipSpace3(position); // #ifdef TAA_UPSCALING // gl_Position.xy = gl_Position.xy * RENDER_SCALE + RENDER_SCALE * gl_Position.w - gl_Position.w; // #endif + #ifdef TAA gl_Position.xy += offsets[framemod8] * gl_Position.w * texelSize; #endif diff --git a/shaders/shaders.properties b/shaders/shaders.properties index 0dc3566..813c17d 100644 --- a/shaders/shaders.properties +++ b/shaders/shaders.properties @@ -203,9 +203,9 @@ screen = [Direct_Light] [World] [Ambient_light] [Fog] [Post_Processing] [Clouds] screen.Advanced = Dirt_Scatter_R Dirt_Scatter_G Dirt_Scatter_B Dirt_Absorb_R Dirt_Absorb_G Dirt_Absorb_B Water_Absorb_R Water_Absorb_G Water_Absorb_B ######## moonphase based weather -uniform.float.Cumulus_Cov = smooth( if( \ +uniform.float.Cumulus_Cov = smooth(1, if( \ moonPhase == 0, 0.7, \ - moonPhase == 1, 0.9, \ + moonPhase == 1, 0.7, \ moonPhase == 2, 0.0, \ moonPhase == 3, 0.0, \ moonPhase == 4, 0.0, \ @@ -213,7 +213,7 @@ uniform.float.Cumulus_Cov = smooth( if( \ moonPhase == 6, 0.0, \ 0.0 ), 5, 5) -uniform.float.Alto_Cov = smooth( if( \ +uniform.float.Alto_Cov = smooth(2, if( \ moonPhase == 0, 0.1, \ moonPhase == 1, 1.0, \ moonPhase == 2, 0.0, \ @@ -223,9 +223,9 @@ uniform.float.Alto_Cov = smooth( if( \ moonPhase == 6, 0.0, \ 0.0 ), 5, 5) -uniform.float.Alto_Den = smooth( if( \ +uniform.float.Alto_Den = smooth(3, if( \ moonPhase == 0, 0.1, \ - moonPhase == 1, 0.25, \ + moonPhase == 1, 0.35, \ moonPhase == 2, 0.0, \ moonPhase == 3, 0.0, \ moonPhase == 4, 0.0, \ @@ -235,15 +235,15 @@ uniform.float.Alto_Den = smooth( if( \ -uniform.float.Day = smooth( if( \ - moonPhase == 0, 1, \ - moonPhase == 1, 2, \ - moonPhase == 2, 3, \ - moonPhase == 3, 4, \ - moonPhase == 4, 5, \ - moonPhase == 5, 6, \ - moonPhase == 6, 7, \ - 8 ), 5, 5) +# uniform.float.Day = smooth( if( \ +# moonPhase == 0, 1, \ +# moonPhase == 1, 2, \ +# moonPhase == 2, 3, \ +# moonPhase == 3, 4, \ +# moonPhase == 4, 5, \ +# moonPhase == 5, 6, \ +# moonPhase == 6, 7, \ +# 8 ), 5, 5) # Biome uniforms diff --git a/shaders/world-1/gbuffers_block.fsh b/shaders/world-1/gbuffers_block.fsh index 34cbade..3397eab 100644 --- a/shaders/world-1/gbuffers_block.fsh +++ b/shaders/world-1/gbuffers_block.fsh @@ -2,4 +2,4 @@ #define WORLD #define BLOCKENTITIES -#include "/gbuffers_all_solid.fsh" \ No newline at end of file +#include "/programs/all_solid.fsh" \ No newline at end of file diff --git a/shaders/world-1/gbuffers_block.vsh b/shaders/world-1/gbuffers_block.vsh index 31749b9..dd49c86 100644 --- a/shaders/world-1/gbuffers_block.vsh +++ b/shaders/world-1/gbuffers_block.vsh @@ -2,4 +2,4 @@ #define WORLD #define BLOCKENTITIES -#include "/gbuffers_all_solid.vsh" \ No newline at end of file +#include "/programs/all_solid.vsh" \ No newline at end of file