fix(wipeout): frame draws above the mask; mask joins the draw order

The wipeout pass ran after the wire pass with no draw-order bias, so
the mask erased its own boundary frame (and everything else at its
plane regardless of draw order). The mask uniform now carries the
entity's draw-order depth (uniform grows 80 → 96 bytes) and biases its
clip-z like every other pipeline, and the frame wire rides a
+half-rank override — the later mask pass fails the depth test at the
frame's pixels, so the boundary stays visible, while entities drawn
above the wipeout are no longer erased.

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Fable 5 committed 2026-07-23 07:23:10 +03:00
1 parent f72852e94b
commit fd2607452d
4 files changed
+27 -3

No files matched your search

+7
View File
@@ -52,6 +52,9 @@ struct HatchUniforms {
// // catastrophically cancel when world coords
// // are large and pattern spacing is small.
origin_low: vec2<f32>, // 72: anchor low residual (double-single)
draw_depth: f32, // 80: signed (-1,1) draw-order bias; 0 = neutral
_pad0: f32, // 84
_pad1: vec2<f32>, // 88
}
@group(1) @binding(0) var<uniform> h: HatchUniforms;
@@ -111,6 +114,10 @@ struct VOut {
v.pos.y + h.origin_low.y - u.eye_low.y,
v.pos.z - u.eye_low.z);
o.clip = u.view_rot * vec4<f32>(hi + lo, 1.0);
// Draw-order bias (see wire.wgsl): the mask erases what draws BELOW its
// entity and loses to what draws above — including its own frame wire,
// which rides a +half-rank override.
o.clip.z = o.clip.z - h.draw_depth * 0.001 * o.clip.w;
o.xz = vec2<f32>(v.pos.x, v.pos.y);
return o;
}