fix more TAAU shenanigans in the nether

This commit is contained in:
Xonk 2023-06-11 17:28:54 -04:00
parent 0171b41502
commit 432674bc59
7 changed files with 45 additions and 45 deletions

View File

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

View File

@ -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) ;

View File

@ -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) ;

View File

@ -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

View File

@ -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

View File

@ -2,4 +2,4 @@
#define WORLD
#define BLOCKENTITIES
#include "/gbuffers_all_solid.fsh"
#include "/programs/all_solid.fsh"

View File

@ -2,4 +2,4 @@
#define WORLD
#define BLOCKENTITIES
#include "/gbuffers_all_solid.vsh"
#include "/programs/all_solid.vsh"