Cockpit: authentic eyepoint + canopy lattice render (task #55)

The first-person cockpit now shows by default and matches gameplay footage
(verified on the Madcat). Two decomp-verified reconstructions:

EYEPOINT (FUN_004579a8 + caller part_014.c:5525, FUN_004c22c4):
- eye offset = siteeyepoint GetBaseOffset (not GetSegmentToEntity, not the
  upright hack), parented on the PARENT segment DCS (btl4vid.cpp)
- live view = affine INVERSE of the eye world matrix (L4VIDRND Execute) --
  replaces the hand-rolled LookAtRH whose +Z-forward/+Y-up row guess aimed
  some mechs into the canopy; combine order fixed to baseOffset * R
- chase camera basis + aim boresight re-expressed for the inverse convention
  (row2 = back); boresight now derives from the view matrix (the stale rows
  aimed the pick ray at the sky = no target, no discharge)

CANOPY (*_COP.BGF, dpl_Punchize geogroups):
- every shell is an open strut lattice (38-59% boundary edges, all 12 mechs);
  rendered single-sided with per-face INWARD winding (l/r torso patches are
  mirrored, so no global winding works) the struts are the dark frame and the
  openings show the world
- frame colour = the 'softer' ramp near its dark end (texture-less unlit ramp;
  BLXSKIN.BMF has no texture -- the old "punch texels" theory was wrong)
- scoped by filename (meshIsCop); wrong drop-punch + view-cut paths removed
- BT_FORCE_MODEL=<name> forces the player mech for per-mech bring-up

KB: new context/cockpit-view.md topic; punch split corrected in bgf-format;
gotchas 14 (LookAt axis guess) + 15 (per-patch edge namespaces); env gates +
eye/punch addresses in decomp-reference.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-11 06:46:54 -05:00
co-authored by Claude Fable 5
parent 7b0b4f64ab
commit abaa145b6f
9 changed files with 349 additions and 53 deletions
+12 -2
View File
@@ -43,8 +43,18 @@ LOD whose band contains the camera distance.
- **ADDITIVE_LODS** (object-level `SV_SPECIAL` token, 135 pod BGFs — all arena structures): at eye
distance d, EVERY LOD with `d < OutDist` draws (near detail ADDS onto coarser massing). Non-additive
keep first-LOD-only (the 2007 engine's own behavior). [T2]
- **PUNCH** (patch-level `SV_SPECIAL`): cutout geogroups — black texels = HOLES (alpha-test in the
opaque pass). Coplanar shells inside one LOD z-fight → depth-bias by submission ordinal. [T2]
- **PUNCH** (patch-level `SV_SPECIAL`, `dpl_Punchize` = FUN_00490308 → VPX board cmd `0x20`, tokens
`{0x80000003,0x80000017,0x80000004}` — a CONSTANT geogroup-modifier opcode, no color key; the
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 frame/window split is the GEOMETRY —
every `_cop` is an open strut lattice (38-59% boundary edges, all 12 mechs); rendered
single-sided with per-face INWARD winding orientation (the l/r torso patches are MIRRORED, so
no single global winding works) the struts are the dark frame and the openings show the world.
The old "canopy windows are punch texels" claim was WRONG — there is no texel to key. See
[[cockpit-view]]. [T2 render-verified in-game on Madcat vs gameplay footage]
## Shading model (from libDPL DPLTYPES.H)
Shading is selected PER-GEOMETRY by vertex type: