Cockpit: the authentic punch STENCIL-CUT -- all 8 cockpits real (task #55)

The user caught the inversion (blocked viewports, see-through frames); the
answer came from the rasterizer board itself: an i860 disassembly of the
VREND.MNG firmware decoded the damageize handler (@0xf040f6f8) -- cmd 0x20
(vr_damage_action) writes the dpl_Punchize token triple onto the punch
geogroup's first three geometry chunks IN FILE ORDER:

  chunk1 = the detailed window-aperture shapes -> an invisible per-pixel MASK
  chunk2 = the coarse hull -> the ONLY colour-drawn geometry (where not masked)
  chunk3 = byte-identical hull twin -> the damage-reset record, never visible

Visible canopy = hull-minus-apertures.  Both earlier readings were wrong ways
around the same three chunks: dropping all punch left floating fragments (no
hull); hiding the duplicate pair hid the HULL and drew the MASK -- the exact
inversion observed.

Port: bgfload tags per punch patch {non-paired pmesh = mask (role 1),
first twin = hull (role 2), second twin = skip}; L4D3D DrawMesh runs
mask->stencil-1 (no colour/z-write, z-tested), hull->stencil-NOTEQUAL,
mask->stencil-0; device D24X8 -> D24S8 + stencil clear.  The cut never
touches z, so later-drawn entities show through the apertures.
BT_COP_PLATES=1 disables (diag).

In-game, all 8 mechs on pure defaults: connected dark frames with clear
viewports -- thor (the footage mech) shows the central viewport + surrounding
frame exactly as filmed.  Combat regression clean (kill + no NaN).

Arena textured punch uses the same firmware kit; the black-texel alpha path
there is a working approximation, flagged in the KB.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-11 08:53:22 -05:00
co-authored by Claude Fable 5
parent 8431e69b1a
commit 96b8892e7c
8 changed files with 136 additions and 41 deletions
+9 -9
View File
@@ -48,15 +48,15 @@ LOD whose band contains the camera distance.
sibling `dpl_Damagize` FUN_004902b0 uses the same cmd with a different triple). Two cases: [T1]
- **Textured** punch (arena walls/catwalks): black texels = HOLES (alpha-test in the opaque
pass). Coplanar shells inside one LOD z-fight → depth-bias by submission ordinal. [T2]
- **Texture-less** punch (the `*_cop` cockpit canopies: blakskn + `softer` ramp, NO texture tag
in the BMF — byte-verified, 238-byte BLXSKIN.BMF): **the PUNCH-tagged patches ARE the
transparent WINDOWS** (the whole tagged geogroup renders as holes); the visible frame is only
the NON-punch geometry, itself an open strut lattice rendered single-sided with per-face
INWARD winding (the l/r torso patches are MIRRORED, so no single global winding works).
Verified by rendering every shell from its mech's AUTHORED eye (SKL [jointeye]) — the punch
panes sit exactly over the window apertures in all 8 mechs; all-punch canopies
(bhk1/loki/vulture/avatar) are authentically FRAMELESS. The old "canopy windows are punch
texels" claim was WRONG — there is no texel to key. See [[cockpit-view]]. [T2 in-game, all 8]
- **FINAL mechanism (i860 VREND.MNG firmware, decoded 2026-07-11): a punch geogroup is a
THREE-CHUNK STENCIL-CUT KIT** -- in file order: aperture MASK (invisible per-pixel cutout),
visible HULL (the only colour-drawn chunk, drawn where not masked), byte-identical hull TWIN
(the damage-reset record, never visible). Visible result = hull-minus-apertures. Applies
to cockpit canopies, arena punch (AR02 etc.) and outside-torso punch (VUX_TOR) alike -- the
port's arena "black texels = holes" alpha-test path is a visual approximation that predates
this decode (works; revisit for exactness). Port: bgfload punch-kit roles + the L4D3D
stencil cut (D24S8). See [[cockpit-view]] + [[decomp-reference]] for firmware addresses.
[T1 mechanism / T2 render-verified all 8 cockpits]
## Shading model (from libDPL DPLTYPES.H)
Shading is selected PER-GEOMETRY by vertex type: