From ff13358df09aa7c54fa76305f9859032ac8d269a Mon Sep 17 00:00:00 2001 From: Aidan Saull Date: Fri, 13 Sep 2024 01:46:19 -0400 Subject: [PATCH 1/2] clouds now show up on worlds with very high DayTime values --- shaders/dimensions/composite1.fsh | 2 +- shaders/dimensions/deferred.vsh | 4 ++-- shaders/lib/climate_settings.glsl | 4 ++-- shaders/lib/volumetricClouds.glsl | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/shaders/dimensions/composite1.fsh b/shaders/dimensions/composite1.fsh index 3bbc6651..af498e86 100644 --- a/shaders/dimensions/composite1.fsh +++ b/shaders/dimensions/composite1.fsh @@ -935,7 +935,7 @@ void main() { #if RESOURCEPACK_SKY == 1 || RESOURCEPACK_SKY == 0 || RESOURCEPACK_SKY == 3 // vec3 orbitstar = vec3(feetPlayerPos_normalized.x,abs(feetPlayerPos_normalized.y),feetPlayerPos_normalized.z); orbitstar.x -= WsunVec.x*0.2; vec3 orbitstar = normalize(mat3(gbufferModelViewInverse) * toScreenSpace(vec3(texcoord/RENDER_SCALE,1.0))); - float radiance = 2.39996 - (worldTime + worldDay*24000.0) / 24000.0; + float radiance = 2.39996 - (worldTime + (worldDay & 0xFFFF) * 24000.0) / 24000.0; // float radiance = 2.39996 + frameTimeCounter; mat2 rotationMatrix = mat2(vec2(cos(radiance), -sin(radiance)), vec2(sin(radiance), cos(radiance))); diff --git a/shaders/dimensions/deferred.vsh b/shaders/dimensions/deferred.vsh index 02bf6ec9..0c6b99bd 100644 --- a/shaders/dimensions/deferred.vsh +++ b/shaders/dimensions/deferred.vsh @@ -179,9 +179,9 @@ void main() { // as the day counter changes, switch to a different set of stored values. #ifdef CHOOSE_RANDOM_WEATHER_PROFILE - int dayCounter = int(clamp(hash11(float(mod(worldDay, 1000))) * 10.0, 0,10)); + int dayCounter = int(clamp(hash11(float(mod(worldDay & 0xFFFF, 1000))) * 10.0, 0,10)); #else - int dayCounter = int(mod(worldDay, 10)); + int dayCounter = int(mod(worldDay & 0xFFFF, 10)); #endif diff --git a/shaders/lib/climate_settings.glsl b/shaders/lib/climate_settings.glsl index d952f5b6..6ea4aef7 100644 --- a/shaders/lib/climate_settings.glsl +++ b/shaders/lib/climate_settings.glsl @@ -52,7 +52,7 @@ int SeasonLength = Season_Length; // loop the year. multiply the season length by the 4 seasons to create a years time. - float YearLoop = mod(worldDay + Start_Season * SeasonLength, SeasonLength * 4); + float YearLoop = mod(worldDay & 0xFFFF + Start_Season * SeasonLength, SeasonLength * 4); // the time schedule for each season float SummerTime = clamp(YearLoop ,0, SeasonLength) / SeasonLength; @@ -95,7 +95,7 @@ int SeasonLength = 1; // loop the year. multiply the season length by the 4 seasons to create a years time. - float YearLoop = mod(worldDay + SeasonLength, SeasonLength * 4); + float YearLoop = mod(worldDay & 0xFFFF + SeasonLength, SeasonLength * 4); // the time schedule for each season float SummerTime = clamp(YearLoop ,0, SeasonLength) / SeasonLength; diff --git a/shaders/lib/volumetricClouds.glsl b/shaders/lib/volumetricClouds.glsl index 901aea51..4a4007bc 100644 --- a/shaders/lib/volumetricClouds.glsl +++ b/shaders/lib/volumetricClouds.glsl @@ -48,7 +48,7 @@ float LAYER2_DENSITY = mix(dailyWeatherParams1.z,0.05,rainStrength); uniform int worldDay; -float cloud_movement = (worldTime + mod(worldDay,100)*24000.0) / 24.0 * Cloud_Speed; +float cloud_movement = (worldTime + mod(worldDay & 0xFFFF,100)*24000.0) / 24.0 * Cloud_Speed; //3D noise from 2d texture float densityAtPos(in vec3 pos){ From 1dce580891a47e896b53fbef090ee62c155314bf Mon Sep 17 00:00:00 2001 From: Aidan Saull Date: Sun, 15 Sep 2024 01:51:48 -0400 Subject: [PATCH 2/2] fixed broken seasons (oops) --- shaders/lib/climate_settings.glsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shaders/lib/climate_settings.glsl b/shaders/lib/climate_settings.glsl index 6ea4aef7..768623d8 100644 --- a/shaders/lib/climate_settings.glsl +++ b/shaders/lib/climate_settings.glsl @@ -52,7 +52,7 @@ int SeasonLength = Season_Length; // loop the year. multiply the season length by the 4 seasons to create a years time. - float YearLoop = mod(worldDay & 0xFFFF + Start_Season * SeasonLength, SeasonLength * 4); + float YearLoop = mod((worldDay & 0xFFFF) + Start_Season * SeasonLength, SeasonLength * 4); // the time schedule for each season float SummerTime = clamp(YearLoop ,0, SeasonLength) / SeasonLength; @@ -95,7 +95,7 @@ int SeasonLength = 1; // loop the year. multiply the season length by the 4 seasons to create a years time. - float YearLoop = mod(worldDay & 0xFFFF + SeasonLength, SeasonLength * 4); + float YearLoop = mod((worldDay & 0xFFFF) + SeasonLength, SeasonLength * 4); // the time schedule for each season float SummerTime = clamp(YearLoop ,0, SeasonLength) / SeasonLength;