upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs/models.md
diff options
context:
space:
mode:
authorItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com>2026-11-22 13:17:15 -0500
committerItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com>2026-11-22 13:17:15 -0500
commit4e646b96c126c85cf9a0b9eac4d0c986aa959c2a (patch)
tree59f9204fbe256135b8d7db4e935d29d7b6e46663 /docs/models.md
parent98d6888686aa57b87a2333b1c8761322c5888b65 (diff)
parente804d20ff55812dde8640526462f8eb596cd86ba (diff)
Merge pull request #2712 from Davide
Diffstat (limited to 'docs/models.md')
-rw-r--r--docs/models.md17
1 files changed, 16 insertions, 1 deletions
diff --git a/docs/models.md b/docs/models.md
index 42fe87aba..026ccd998 100644
--- a/docs/models.md
+++ b/docs/models.md
@@ -259,7 +259,7 @@ failures, no duplicate model names, and 2.22 billion triangles (1.95 billion bef
259## How the exporter works 259## How the exporter works
260 260
261``` 261```
262rpf9dump models <archive.rpf> <outdir> 262rpf9dump models <archive.rpf> <outdir> [--start BYTES] [--length BYTES]
263``` 263```
264 264
265`FindCandidateOffsets` scans 4 MiB blocks for a page-aligned 16-byte zero prefix followed by a zlib 265`FindCandidateOffsets` scans 4 MiB blocks for a page-aligned 16-byte zero prefix followed by a zlib
@@ -268,6 +268,15 @@ a drawable or fragment header (`RageModelDecoder.LooksLikeResource`). `RecoverAt
268the following zlib blocks, splits the inflated bytes into the system segment and the graphics 268the following zlib blocks, splits the inflated bytes into the system segment and the graphics
269segment, probes the extents, and calls `RageModelDecoder.Decode`. 269segment, probes the extents, and calls `RageModelDecoder.Decode`.
270 270
271`--start`/`--length` scan one window of the file instead of the whole archive. Neither `models`
272nor `textures` needs the archive directory: the entry list comes from this run's scan or from the
273index cache, and every resource is read from its own compression blocks
274(`tools/rpf9dump/Segments.cs`). A window is therefore a raw slice - a copy of `levels.rpf` from an
275offset, which has no `9FPR` header - and the scan covers exactly the slice. A sub-range is never
276written to the index cache, which describes a whole file; the manifest records `Scan.Start` and
277`Scan.Length` for it. One measured 1 GiB slice of `levels.rpf`: 1,228 models scanned, recovered,
278decoded and exported in about 2 s (497 MB of OBJ and manifest).
279
271To locate a named drawable before decoding, `tools/rpf9_names.py` indexes the measured 280To locate a named drawable before decoding, `tools/rpf9_names.py` indexes the measured
272`name.#dr`/`#ft`/`#dd` spellings in bounded zlib prefixes without the encrypted TOC; see 281`name.#dr`/`#ft`/`#dd` spellings in bounded zlib prefixes without the encrypted TOC; see
273[resource_names.md](resource_names.md). 282[resource_names.md](resource_names.md).
@@ -278,6 +287,12 @@ For each returned entry, `tools/rpf9dump/Program.cs` reads the segments, splits
278offset, OBJ name, model name, mesh/vertex/triangle counts, fragment and bone-binding flags, bounds, 287offset, OBJ name, model name, mesh/vertex/triangle counts, fragment and bone-binding flags, bounds,
279per-mesh shader indices, embedded textures, and material texture references. 288per-mesh shader indices, embedded textures, and material texture references.
280 289
290Three arrays describe the geometries one by one, in the same order as the OBJ's `o` groups:
291`MeshTris` (triangles), `MeshModels` (the position of the model in the drawable's primary-LOD model
292list) and `MeshGeoms` (the position of the geometry in that model). That pair is the geometry index
293a dehydrated BLAS leaf stores ([bvh.md](bvh.md) §4a), which is what `tools/bvh_match.py` matches on;
294`MeshShaders` maps each geometry to its entry in `Materials`, and therefore to its shader name hash.
295
281The manifest has no failure, skip, or layout fields. `Program.cs` increments `fail` only when a 296The manifest has no failure, skip, or layout fields. `Program.cs` increments `fail` only when a
282model entry returned by the carver fails `RageModelDecoder.Decode`; `skip` is not used in models 297model entry returned by the carver fails `RageModelDecoder.Decode`; `skip` is not used in models
283mode. A printed `fail=0 skip=0` therefore means "no decoded entry failed", not "nothing was 298mode. A printed `fail=0 skip=0` therefore means "no decoded entry failed", not "nothing was