From 306951ebee735a6a99139c2bf153600b051bd5f5 Mon Sep 17 00:00:00 2001 From: mcrcortex <18544518+MCRcortex@users.noreply.github.com> Date: Mon, 21 Apr 2025 20:18:37 +1000 Subject: [PATCH] Depth patch --- src/main/resources/assets/voxy/shaders/hiz/blit.fsh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main/resources/assets/voxy/shaders/hiz/blit.fsh b/src/main/resources/assets/voxy/shaders/hiz/blit.fsh index a84d93f3..4fa79954 100644 --- a/src/main/resources/assets/voxy/shaders/hiz/blit.fsh +++ b/src/main/resources/assets/voxy/shaders/hiz/blit.fsh @@ -6,13 +6,10 @@ layout(binding = 0) uniform sampler2D depthTex; void main() { vec4 depths = textureGather(depthTex, uv, 0); // Get depth values from all surrounding texels. - //TODO: fully fix this system + bvec4 cv = lessThanEqual(vec4(0.999999f), depths); + if (any(cv)) {//Patch holes (its very dodgy but should work :tm:, should clamp it to the first 3 levels) + depths = mix(vec4(0.0f), depths, cv); + } - //TODO, do it so that for the first 2,3 levels if 1 (or maybe even 2 (on the first layer)) pixels are air, just ignore that - // this is to stop issues with 1 pixel gaps - bvec4 cv = lessThanEqual(vec4(0.99999999), depths); - //if (any(cv) && !all(cv)) { - // depths = mix(vec4(1.0f), depths, cv); - //} gl_FragDepth = max(max(depths.x, depths.y), max(depths.z, depths.w)); // Write conservative depth. }