Fix 3D model decoding: dictionaries, vertex axis order, fake MODEL entries, external textures #7
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/rpatty-dev--PercyStar!7
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/7/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Ahmet-Dedeler on GitHub · 2026-11-20 22:01 UTC · original
Ahmet-Dedeler:fix/model-decoding→main· +984 −232 · 4 files · 1 commits · merged 2026-11-21 07:55 UTCRan into a few model bugs while browsing the Xbox build, mostly in
levels.rpf. All four are fixed here.1. Drawable dictionaries were merged into one mesh
Some
.#drentries are actually a pgDictionary of drawables: hashes at+0x20, drawable pointers at+0x30. The decoder fell back to "All" geometry and merged everything, so independent models got stacked at the origin. Example:bk_02_road_str_slod.#dris 8 separate Brickell SLOD blocks (317 geoms).Now each entry is decoded on its own (LOD0) and laid out on a grid. There's a part picker in the viewer to isolate one. OBJ export writes one
ogroup per drawable, and an isolated part exports re-centred.2. Vertex position axis order (
+0x6C)The u32 at vertex-buffer header
+0x6Csays which axis lives in the 16-bit position slot:Only mode 2 was handled, so roughly 30% of geometries rendered rotated (towers lying on their side). I verified the mapping against drawable bboxes on ~1.6k geometries across 150 models: 191/193, 310/311 and 1104/1118 fit. A few geometries carry other values and look like a different vertex layout; those keep the old read.
3. Fake MODEL entries in the scanner
Metadata containers and mid-resource chunks were listed as MODEL because they contain a
*.#drstring. Opening them failed with "No RAGE9 meshlet geometries". The scanner now:+0x60 == 0x1601)The scan cache is bumped to
v9so stale entries aren't reused. That means one full rescan after updating.4. External
.ttpftexturesShader texture references are resolved to the external texture archives through their 64-bit hashes. The index is built once per dump root and decodes are cached. You get per-geometry materials, plus vehicle paint detection with colour presets.
cheetah2_hiresolves 15/35 materials + paint, and the Brickell SLODs resolve 286/317.Tests
Two regression tests, which only run when
PERCYSTAR_LEVELS_RPFpoints atlevels.rpffrom the Xbox dump. Everything else passes as before, and there are no new warnings.Independent of the sort PR; they touch different parts of
main.rsand merge cleanly together.Same note as the other one: I know PRs are invite only per the license, so close it if you'd rather not take it. Happy to split it up or change anything.
🤖 Generated with Claude Code
@copilot-pull-request-reviewer[bot] on GitHub · 2026-11-20 22:01 UTC · original · reviewed
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
@rpatty-dev on GitHub · 2026-11-21 08:03 UTC · original
Merged and shipped in v1.3.1! Huge improvement having drawable dictionary grid splitting, +0x6C vertex axis permutation, mid-resource geometry filtering (scan_cache_v9), and external .ttpf hash material + car paint resolution. Thank you @Ahmet-Dedeler!