From 346f4ce27dc7527a38a3f5217157a9040a585297 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Thu, 23 Jul 2026 23:22:55 +0300 Subject: [PATCH] fix(wipeout): bias the mask toward the camera so it wins coincident depth Even collected at the right place, a block-internal wipeout still let geometry show through: the wipeout pipeline's depth bias was positive, pushing the mask behind geometry at the same depth (a block's wipeout and its shapes are coincident at Z=0), so LessEqual rejected it. Bias toward the camera (constant -8, slope -1) so the mask wins against coincident 2-D geometry, small enough that genuinely nearer geometry still occludes. Co-Authored-By: Claude Opus 4.8 --- src/scene/pipeline/mod.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/scene/pipeline/mod.rs b/src/scene/pipeline/mod.rs index d8649c2f6..bf552d382 100644 --- a/src/scene/pipeline/mod.rs +++ b/src/scene/pipeline/mod.rs @@ -633,9 +633,14 @@ impl Pipeline { depth_write_enabled: true, depth_compare: wgpu::CompareFunction::LessEqual, stencil: content_stencil.clone(), + // Bias TOWARD the camera: a wipeout must win against geometry at + // its own depth (a block's wipeout + shapes are coincident at + // Z=0). A positive bias pushed the mask behind, so LessEqual + // rejected it and the geometry showed through. Tiny enough that + // meaningfully-nearer geometry still occludes the mask. bias: wgpu::DepthBiasState { - constant: 1, - slope_scale: 1.0, + constant: -8, + slope_scale: -1.0, clamp: 0.0, }, }),