diff --git a/context/locomotion.md b/context/locomotion.md index 2f5facb..26ec071 100644 --- a/context/locomotion.md +++ b/context/locomotion.md @@ -102,12 +102,20 @@ co-dependent parts — change one, re-check the others: bias can never paint the shadow OVER the feet, structurally. 4. **BIAS pairing** (L4D3D.cpp): tilt on (default) → decal epsilon −0.0008; `BT_SHADOW_TILT=0` (flat A/B fallback) → the old −0.004 it needs to survive slope burial. `BT_SHADOW_BIAS` overrides. +5. **LOADER-LEVEL TAG** (L4D3D.cpp `LoadObjectBGF`): `*tshd*` filenames get `SetIsShadow(1)` in the + LOADER, not at call sites. The V VIEW TOGGLE (`SetViewInside`) and the damage swaps RELOAD segment + meshes; an untagged reload disengages the whole pipeline — solid opaque black, no bias, buried on + any slope ("shadow broke mid-session after pressing V", user-confirmed fixed). The all-shadow- + material detector misses the mech proxy (plain black material, not shadow_mtl). [T2] Polar maps have STUB `*_tshd` (shadow authored-off on snow). The visual-ground conform (`btvisgnd.cpp`) stays render-only (never touches localOrigin). [T2] -⚠ **"Shadow vanishes on inclines" can also be a GAIT-DESYNC symptom.** The first 2026-07-09 recurrence -CO-RESOLVED with the gait v5 fix (no shadow code changed): a popping root pose (out-of-phase leg -channel showing through) can push the quad past the bias margin. Check `[sync]`/`BT_SYNC_LOG` for -channel drift before touching the shadow itself. [T2 observation; mechanism T4] +⚠ **"Shadow vanishes on inclines" now has THREE confirmed/suspected causes — diagnose before fixing:** +(a) the V-toggle/reload UNTAG above (solid black + buried; broke mid-session; the likeliest cause of +the recurring reports — a relaunch always "fixed" it because the fresh build re-tagged); (b) gait +desync popping the displayed root pose past the bias margin (the first 2026-07-09 recurrence co- +resolved with gait v5, no shadow code changed — though (a) may have contributed) [T2 obs; mechanism +T4]; (c) genuine slope burial when the quad is flat/mis-tilted (the depth-bias margin is finite). +Check `[shadowobj]` tag lines and `[sync]`/`BT_SYNC_LOG` before touching bias/tilt. ## Key Relationships - Detail: `docs/P3_LOCOMOTION.md`. Uses: [[asset-formats]] (SKL/ANI), [[decomp-reference]] (offsets). diff --git a/engine/MUNGA_L4/L4D3D.cpp b/engine/MUNGA_L4/L4D3D.cpp index d65e313..aa2c3db 100644 --- a/engine/MUNGA_L4/L4D3D.cpp +++ b/engine/MUNGA_L4/L4D3D.cpp @@ -331,6 +331,17 @@ d3d_OBJECT* d3d_OBJECT::LoadObjectBGF(LPDIRECT3DDEVICE9 device, char *fileName) bool allShadow = !data.batches.empty(); for (size_t bi = 0; bi < data.batches.size() && allShadow; ++bi) if (!data.batches[bi].shadowMat) allShadow = false; + // MECH SHADOW PROXIES (*_tshd.bgf) tag by FILENAME here in the loader + // (task #49b): the mech proxy uses a plain black material (not + // shadow_mtl), so the all-shadow-material detector above misses it. + // The render-tree build used to tag it at its own call site -- but the + // VIEW TOGGLE (SetViewInside) and the damage swaps RELOAD segment + // meshes through this loader and swapped in an UNTAGGED object: solid + // opaque black, no depth bias, buried on slopes (the "shadow broke + // mid-session after pressing V" report). Tagging at load covers every + // caller; the drawOps' alphaTest routing below reads the flag. + if (!allShadow && fileName != NULL && strstr(fileName, "tshd") != NULL) + allShadow = true; if (allShadow) { object->SetIsShadow(1);