From 90c92973b7684532892c9746a1a70ac3d8fde635 Mon Sep 17 00:00:00 2001 From: Xonk Date: Thu, 22 Jun 2023 18:34:41 -0400 Subject: [PATCH] make underwater ambient fog better when in caves --- shaders/composite2.fsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shaders/composite2.fsh b/shaders/composite2.fsh index 839d038..fd7a1c8 100644 --- a/shaders/composite2.fsh +++ b/shaders/composite2.fsh @@ -41,6 +41,7 @@ uniform int frameCounter; uniform float rainStrength; uniform float sunElevation; uniform ivec2 eyeBrightnessSmooth; +uniform ivec2 eyeBrightness; uniform float frameTimeCounter; uniform int isEyeInWater; uniform vec2 texelSize; @@ -181,7 +182,7 @@ void waterVolumetrics(inout vec3 inColor, vec3 rayStart, vec3 rayEnd, float estE vec3 p3 = mat3(gbufferModelViewInverse) * rayEnd; vec3 np3 = normVec(p3); float ambfogfade = clamp(exp(np3.y*1.5 - 1.5),0.0,1.0) ; - vec3 ambientMul = exp(-max(estEyeDepth - dY * d,0.0) * waterCoefs) + ambfogfade*0.5 ; + vec3 ambientMul = exp(-max(estEyeDepth - dY * d,0.0) * waterCoefs) + ambfogfade*0.5 * clamp(eyeBrightnessSmooth.y/240.0,0.1,1.0); vec3 sunMul = exp(-max((estEyeDepth - dY * d) ,0.0)/abs(refractedSunVec.y) * waterCoefs)*cloudShadow; float sunCaustics = waterCaustics(progressW, WsunVec);