From e0cd62d87d95f3c9f439e29325bffb424cf0af32 Mon Sep 17 00:00:00 2001 From: Merlin1809 <88194861+Merlin1809@users.noreply.github.com> Date: Sat, 7 Feb 2026 16:34:50 +0100 Subject: [PATCH] fix dh/voxy reflections on vanilla water --- shaders/lib/specular.glsl | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/shaders/lib/specular.glsl b/shaders/lib/specular.glsl index ae61b9c..d936b4e 100644 --- a/shaders/lib/specular.glsl +++ b/shaders/lib/specular.glsl @@ -110,7 +110,7 @@ float invertLinearizeDepthFast(const in float z) { } -vec3 rayTraceSpeculars(vec3 dir, vec3 position, float dither, float quality, bool hand, inout float reflectionLength, inout bool depthCheck){ +vec3 rayTraceSpeculars(vec3 dir, vec3 position, float dither, float quality, const bool hand, inout float reflectionLength, inout bool depthCheck){ const float biasAmount = 0.0001; @@ -200,20 +200,12 @@ vec3 rayTraceSpeculars(vec3 dir, vec3 position, float dither, float quality, boo #endif #if (defined VOXY && defined VOXY_REFLECTIONS) || (defined DISTANT_HORIZONS && defined DH_SCREENSPACE_REFLECTIONS) - if (sp > 0.9999999){ - #ifdef QUARTER_RES_SSR - #ifdef FULLRESDEPTH - sp = texelFetch(dhVoxyDepthTex, ivec2(spos2.xy/texelSize),0).r; - #else - sampleDepth = texelFetch(colortex12, ivec2(spos2.xy/texelSize/4.0),0).a/65000.0; - sp = DH_invLinZ(sqrt(sampleDepth)); - #endif + if (sp >= 1.0){ + + #ifdef FULLRESDEPTH + sp = texelFetch(dhVoxyDepthTex, ivec2(spos2.xy/texelSize),0).r; #else - #ifdef FULLRESDEPTH - sp = texelFetch(dhVoxyDepthTex, ivec2(spos2.xy/texelSize),0).r; - #else - sp = texelFetch(dhVoxyDepthTex1, ivec2(spos2.xy/texelSize),0).r; - #endif + sp = texelFetch(dhVoxyDepthTex1, ivec2(spos2.xy/texelSize),0).r; #endif if(sp < max(minZ2, maxZ2) && sp > min(minZ2, maxZ2)) {