diff options
| author | Davide <davidec98@live.it> | 2026-11-22 18:25:54 +0100 |
|---|---|---|
| committer | Davide <davidec98@live.it> | 2026-11-22 18:49:29 +0100 |
| commit | e804d20ff55812dde8640526462f8eb596cd86ba (patch) | |
| tree | 9dbc3c352d7b42f7ea10b34d33f87559f261d261 /docs/models.md | |
| parent | e6ab90d6d4a7a56fdf8dc9215afb52fc868316e9 (diff) | |
tools/bvh_match.py: find the drawable geometry a dehydrated BLAS was built from
Reads the leaf signature (triangles per geometry index, a leaf that holds two primitives counting
as two), keeps every (drawable, model) of an `rpf9dump models` manifest whose per-geometry triangle
counts contain it as an ordered subsequence, and checks the survivors with
tools/bvh_geometry_check.py from the model's exported OBJ and the 3x4 at +0x50 of the instance
descriptor. The geometries of the two shaders the BVH leaves out are filtered with --skip-shaders
(those name hashes are game data, so the rule is off unless the user passes them); a drawable whose
shader indices the manifest cannot resolve keeps every geometry and the checks decide.
All the BVH logic stays in Python: the C# side is only the model decoding and the export.
Measured on the ten BLAS of the sample pack against one 1 GiB window of levels.rpf: 1,228 models
exported, 1 to 374 candidates per BLAS from the signature, and exactly one consistent candidate
for each of the ten. The tool prints no drawable names unless --names is given.
The two tools that came with #2205 and #2428 lacked the stdout errors="replace" guard every CLI
tool needs (tests/test_tool_stdout_encoding.py), so this also adds it there; without it that test
fails for both.
Tests are synthetic (tests/test_bvh_match.py, 14 cases): the right geometry is found and verified,
a wrong one, a wrong shader rule and a missing transform are not, geometries are matched inside one
model, and a manifest without per-geometry counts is an input error.
Diffstat (limited to 'docs/models.md')
0 files changed, 0 insertions, 0 deletions