From cf3346232eeca374579161481db6de67e040ea94 Mon Sep 17 00:00:00 2001 From: MikiP98 <79966387+MikiP98@users.noreply.github.com> Date: Sat, 16 Nov 2024 21:39:26 +0100 Subject: [PATCH] Revert "remove underwater distortion. make AO in sunlight also be on SSS." This reverts commit f8d1b0b8da0622f9f0866a7f80a8da61390a9cd2. --- shaders/dimensions/composite1.fsh | 24 +++++++----------------- shaders/lib/gameplay_effects.glsl | 2 +- shaders/lib/volumetricClouds.glsl | 2 +- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/shaders/dimensions/composite1.fsh b/shaders/dimensions/composite1.fsh index b4692de..ede4faa 100644 --- a/shaders/dimensions/composite1.fsh +++ b/shaders/dimensions/composite1.fsh @@ -1353,24 +1353,14 @@ void main() { float skylight = 1.0; #if indirect_effect == 0 || indirect_effect == 1 || indirect_effect == 2 - // float SkylightDir = (slopednormal / dot(abs(slopednormal),vec3(1.0))).y *1.5; - // if(isGrass) SkylightDir = 1.5; + float SkylightDir = (slopednormal / dot(abs(slopednormal),vec3(1.0))).y*1.5; + if(isGrass) SkylightDir = 1.5; - // skylight = max(pow((FlatNormals).y*0.5+0.5,0.1) + SkylightDir, 0.2 + (1-lightmap.y)*0.8); - - // #if indirect_effect == 1 - // skylight = min(skylight, mix(0.95, 2.5, pow(1-pow(1-SSAO_SSS.x, 0.5),2.0) )); - // #endif - - float SkylightDir = (slopednormal / dot(abs(slopednormal),vec3(1.0))).y; - - if(isGrass) SkylightDir = 1.0; - - SkylightDir = clamp(SkylightDir*0.7+0.3, 0.0, pow(1-pow(1-SSAO_SSS.x, 0.5),2.0) * 0.7 + 0.3); - - - skylight = mix(0.2 + 2.3*(1.0-lightmap.y), 2.5, SkylightDir); + skylight = max(pow((FlatNormals).y*0.5+0.5,0.1) + SkylightDir, 0.2 + (1-lightmap.y)*0.8); + #if indirect_effect == 1 + skylight = min(skylight, mix(0.95, 2.5, pow(1-pow(1-SSAO_SSS.x, 0.5),2.0) )); + #endif #endif #if indirect_effect == 3 || indirect_effect == 4 @@ -1497,7 +1487,7 @@ void main() { #ifdef OVERWORLD_SHADER // Direct_lighting = max(shadowColor*NdotL, SSSColor); #ifdef AO_in_sunlight - Direct_lighting = (shadowColor*NdotL + SSSColor) * (AO*0.7+0.3); + Direct_lighting = shadowColor*NdotL*(AO*0.7+0.3) + SSSColor; #else Direct_lighting = shadowColor*NdotL + SSSColor; #endif diff --git a/shaders/lib/gameplay_effects.glsl b/shaders/lib/gameplay_effects.glsl index 31e3ce7..b9e28ad 100644 --- a/shaders/lib/gameplay_effects.glsl +++ b/shaders/lib/gameplay_effects.glsl @@ -68,7 +68,7 @@ void applyGameplayEffects(inout vec3 color, in vec2 texcoord, float noise){ float waterDrops = texture2D(noisetex, (texcoord - vec2(0.0, scale.z)) * scale.xy).r ; - if(isEyeInWater == 1) waterDrops = 0.0; + if(isEyeInWater == 1) waterDrops = waterDrops*waterDrops * 0.3; if(isEyeInWater == 0 && exitWater > 0.0) waterDrops = sqrt(min(max(waterDrops - (1.0-sqrt(exitWater))*0.7,0.0) * (1.0 + exitWater),1.0)) * 0.3; // apply distortion effects for exiting water and under water diff --git a/shaders/lib/volumetricClouds.glsl b/shaders/lib/volumetricClouds.glsl index 18afa8e..95f2264 100644 --- a/shaders/lib/volumetricClouds.glsl +++ b/shaders/lib/volumetricClouds.glsl @@ -384,7 +384,7 @@ vec4 GetVolumetricClouds( #if defined DISTANT_HORIZONS float maxdist = dhFarPlane; #else - float maxdist = far*4.0; + float maxdist = far + 16*5.0; #endif float lViewPosM = length(viewPos) < maxdist ? length(viewPos) - 1.0 : 100000000.0;