From 4e00602b336cc0510529e9f026e05951aacce35d Mon Sep 17 00:00:00 2001 From: Xonk Date: Fri, 10 May 2024 14:47:56 -0400 Subject: [PATCH] make seasons work on distant horizons LODS --- shaders/dimensions/DH_solid.vsh | 8 ++++++++ shaders/dimensions/all_solid.vsh | 2 +- shaders/lib/climate_settings.glsl | 6 ++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/shaders/dimensions/DH_solid.vsh b/shaders/dimensions/DH_solid.vsh index d48deaf..3f95634 100644 --- a/shaders/dimensions/DH_solid.vsh +++ b/shaders/dimensions/DH_solid.vsh @@ -45,6 +45,8 @@ vec4 toClipSpace3(vec3 viewSpacePosition) { } */ +#define SEASONS_VSH +#include "/lib/climate_settings.glsl" void main() { gl_Position = ftransform(); @@ -86,6 +88,12 @@ void main() { normals_and_materials = vec4(normalize(gl_NormalMatrix * gl_Normal), MATERIALS); dh_material_id = dhMaterialId; + + #if defined Seasons && defined OVERWORLD_SHADER + float blank = 0.0; + YearCycleColor(gcolor.rgb, gl_Color.rgb, blank, dhMaterialId == DH_BLOCK_LEAVES); + #endif + #if DOF_QUALITY == 5 vec2 jitter = clamp(jitter_offsets[frameCounter % 64], -1.0, 1.0); jitter = rotate(radians(float(frameCounter))) * jitter; diff --git a/shaders/dimensions/all_solid.vsh b/shaders/dimensions/all_solid.vsh index 29fce04..73b07ee 100644 --- a/shaders/dimensions/all_solid.vsh +++ b/shaders/dimensions/all_solid.vsh @@ -356,7 +356,7 @@ if(heldItemId == ITEM_LIGHT_SOURCES || heldItemId2 == ITEM_LIGHT_SOURCES) HELD_I #if defined Seasons && defined WORLD && !defined ENTITIES && !defined BLOCKENTITIES && !defined HAND float blank = 0.0; - YearCycleColor(color.rgb, gl_Color.rgb, blank); + YearCycleColor(color.rgb, gl_Color.rgb, blank, mc_Entity.x == BLOCK_AIR_WAVING); #endif #ifdef TAA_UPSCALING diff --git a/shaders/lib/climate_settings.glsl b/shaders/lib/climate_settings.glsl index 4a89a47..9e58fd8 100644 --- a/shaders/lib/climate_settings.glsl +++ b/shaders/lib/climate_settings.glsl @@ -17,7 +17,9 @@ void YearCycleColor ( inout vec3 FinalColor, vec3 glcolor, - inout float SnowySeason + inout float SnowySeason, + + bool isLeaves ){ // colors for things that arent leaves and using the tint index. vec3 SummerCol = vec3(Summer_R, Summer_G, Summer_B); @@ -32,7 +34,7 @@ SpringCol *= glcolor; // do leaf colors different because thats cool and i like it - if(mc_Entity.x == BLOCK_AIR_WAVING){ + if(isLeaves){ SummerCol = vec3(Summer_Leaf_R, Summer_Leaf_G, Summer_Leaf_B); AutumnCol = vec3(Fall_Leaf_R, Fall_Leaf_G, Fall_Leaf_B); WinterCol = vec3(Winter_Leaf_R, Winter_Leaf_G, Winter_Leaf_B);