diff --git a/shaders/dimensions/DH_solid.vsh b/shaders/dimensions/DH_solid.vsh index c5be031..0d2777e 100644 --- a/shaders/dimensions/DH_solid.vsh +++ b/shaders/dimensions/DH_solid.vsh @@ -14,12 +14,13 @@ uniform float nightVision; uniform vec2 texelSize; uniform int framemod8; +uniform float far; + #if DOF_QUALITY == 5 uniform int hideGUI; uniform int frameCounter; uniform float aspectRatio; uniform float screenBrightness; -uniform float far; #include "/lib/bokeh.glsl" #endif @@ -32,7 +33,6 @@ uniform int framemod4_DH; uniform mat4 gbufferModelViewInverse; uniform mat4 gbufferModelView; -uniform float far; uniform mat4 dhProjection; uniform vec3 cameraPosition; diff --git a/shaders/dimensions/composite1.fsh b/shaders/dimensions/composite1.fsh index 1feebf9..0441744 100644 --- a/shaders/dimensions/composite1.fsh +++ b/shaders/dimensions/composite1.fsh @@ -1291,7 +1291,7 @@ void main() { vec3 specularNormal = normal; if (dot(normal, (feetPlayerPos_normalized)) > 0.0) specularNormal = FlatNormals; - FINAL_COLOR = specularReflections(viewPos, feetPlayerPos_normalized, WsunVec, specularNoises, specularNormal, SpecularTex.r, SpecularTex.g, albedo, FINAL_COLOR, shadowColor, lightmap.y, hand, isWater || (!isWater && isEyeInWater == 1), flashLightSpecularData); + FINAL_COLOR = specularReflections(viewPos, feetPlayerPos_normalized, WsunVec, specularNoises, specularNormal, SpecularTex.r, SpecularTex.g, albedo, FINAL_COLOR, shadowColor, lightmap.y, hand, flashLightSpecularData); #endif gl_FragData[0].rgb = FINAL_COLOR; @@ -1350,10 +1350,11 @@ void main() { gl_FragData[0].rgb = clamp(fp10Dither(Background, triangularize(noise_2)), 0.0, 65000.); } - // water absorbtion will impact ALL light coming up from terrain underwater. - gl_FragData[0].rgb *= Absorbtion; if(translucentMasks > 0.0 && isEyeInWater != 1){ + // water absorbtion will impact ALL light coming up from terrain underwater. + gl_FragData[0].rgb *= Absorbtion; + vec4 vlBehingTranslucents = BilateralUpscale_VLFOG(colortex13, depthtex1, gl_FragCoord.xy - 1.5, ld(z)); gl_FragData[0].rgb = gl_FragData[0].rgb * vlBehingTranslucents.a + vlBehingTranslucents.rgb; diff --git a/shaders/lib/specular.glsl b/shaders/lib/specular.glsl index 0d6a7d0..c0ec7a0 100644 --- a/shaders/lib/specular.glsl +++ b/shaders/lib/specular.glsl @@ -284,9 +284,8 @@ vec3 specularReflections( in bool isHand // mask for the hand #ifdef FORWARD_SPECULAR - , inout float reflectanceForAlpha - #else , bool isWater + , inout float reflectanceForAlpha #endif ,in vec4 flashLight_stuff @@ -327,7 +326,7 @@ vec3 specularReflections( float shlickFresnel = shlickFresnelRoughness(dot(-normalize(viewDir), vec3(0.0,0.0,1.0)), roughness); #if defined FORWARD_SPECULAR && defined SNELLS_WINDOW - if(isEyeInWater == 1) shlickFresnel = mix(shlickFresnel, 1.0, min(max(0.98 - (1.0-shlickFresnel),0.0)/(1-0.98),1.0)); + if(isEyeInWater == 1 && isWater) shlickFresnel = mix(shlickFresnel, 1.0, min(max(0.98 - (1.0-shlickFresnel),0.0)/(1-0.98),1.0)); #endif // F0 < 230 dialectrics diff --git a/shaders/lib/volumetricClouds.glsl b/shaders/lib/volumetricClouds.glsl index fe1fcf4..d2138f7 100644 --- a/shaders/lib/volumetricClouds.glsl +++ b/shaders/lib/volumetricClouds.glsl @@ -334,10 +334,13 @@ vec4 raymarchCloud( float shapeWithDensityFaded = shape*density * pow(clamp((rayPosition.y - minHeight)/(max(maxHeight-minHeight,1.0)*0.25),0.0,1.0),2.0); + if(shapeWithDensityFaded > mix(0.06, 1e-5, dither)){ + cloudPlaneDistance.x = length(rayPosition - cameraPosition); cloudPlaneDistance.y = 0.0; + } + // check if the pixel has visible clouds before doing work. if(shapeWithDensityFaded > 1e-5){ - cloudPlaneDistance.x = length(rayPosition - cameraPosition); cloudPlaneDistance.y = 0.0; // can add the initial cloud shape sample for a free shadow starting step :D float indirectShadowMask = 1.0 - min(max(rayPosition.y - minHeight,0.0) / max(maxHeight-minHeight,1.0), 1.0);