fix(render): draw 3D surface fills at their real depth, not draw order

PolyfaceMesh / PolygonMesh / SubDMesh fills and 3DFACE quads were
classified as 2D fills and given the draw-order z-bias, so they were
pulled toward the camera and drew over solids. The tessellator emits a
mesh's edges and its fill as separate WireModels (points-only vs
fill-only), so the old `!points.is_empty()` discriminator misrouted the
fill. Classify a fill as a 3D surface by its double-single low residual
(`fill_tris_low`) instead, and drop the draw-order bias from 3DFACE
quads. 2D annotation fills (text greek, MultiLeader / dimension
backgrounds) leave `fill_tris_low` empty and keep ordering by rank.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-07-02 01:23:27 +03:00
commit 7185f6e4fa
2 changed files with 25 additions and 8 deletions

View file

@ -34,8 +34,9 @@ struct VertexOut {
@location(0) color: vec4<f32>,
};
// Draw-order depth bias (see wire.wgsl). Signed draw_depth; 0.0 (3D mesh
// faces) leaves real depth untouched; 2D fills / 3DFACE quads order by rank.
// Draw-order depth bias (see wire.wgsl). Signed draw_depth; 0.0 (all 3D
// surface faces — 3DFACE, PolyfaceMesh, PolygonMesh) leaves real depth
// untouched so they occlude against solids; only 2D fills order by rank.
const DRAW_ORDER_BIAS: f32 = 0.001;
@vertex