diff options
| author | ItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com> | 2026-11-22 13:17:15 -0500 |
|---|---|---|
| committer | ItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com> | 2026-11-22 13:17:15 -0500 |
| commit | 4e646b96c126c85cf9a0b9eac4d0c986aa959c2a (patch) | |
| tree | 59f9204fbe256135b8d7db4e935d29d7b6e46663 /docs/models.md | |
| parent | 98d6888686aa57b87a2333b1c8761322c5888b65 (diff) | |
| parent | e804d20ff55812dde8640526462f8eb596cd86ba (diff) | |
Merge pull request #2712 from Davide
Diffstat (limited to 'docs/models.md')
| -rw-r--r-- | docs/models.md | 17 |
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 | ``` |
| 262 | rpf9dump models <archive.rpf> <outdir> | 262 | rpf9dump 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 | |||
| 268 | the following zlib blocks, splits the inflated bytes into the system segment and the graphics | 268 | the following zlib blocks, splits the inflated bytes into the system segment and the graphics |
| 269 | segment, probes the extents, and calls `RageModelDecoder.Decode`. | 269 | segment, 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` | ||
| 272 | nor `textures` needs the archive directory: the entry list comes from this run's scan or from the | ||
| 273 | index 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 | ||
| 275 | offset, which has no `9FPR` header - and the scan covers exactly the slice. A sub-range is never | ||
| 276 | written 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, | ||
| 278 | decoded and exported in about 2 s (497 MB of OBJ and manifest). | ||
| 279 | |||
| 271 | To locate a named drawable before decoding, `tools/rpf9_names.py` indexes the measured | 280 | To 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 | |||
| 278 | offset, OBJ name, model name, mesh/vertex/triangle counts, fragment and bone-binding flags, bounds, | 287 | offset, OBJ name, model name, mesh/vertex/triangle counts, fragment and bone-binding flags, bounds, |
| 279 | per-mesh shader indices, embedded textures, and material texture references. | 288 | per-mesh shader indices, embedded textures, and material texture references. |
| 280 | 289 | ||
| 290 | Three 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 | ||
| 292 | list) and `MeshGeoms` (the position of the geometry in that model). That pair is the geometry index | ||
| 293 | a 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 | |||
| 281 | The manifest has no failure, skip, or layout fields. `Program.cs` increments `fail` only when a | 296 | The manifest has no failure, skip, or layout fields. `Program.cs` increments `fail` only when a |
| 282 | model entry returned by the carver fails `RageModelDecoder.Decode`; `skip` is not used in models | 297 | model entry returned by the carver fails `RageModelDecoder.Decode`; `skip` is not used in models |
| 283 | mode. A printed `fail=0 skip=0` therefore means "no decoded entry failed", not "nothing was | 298 | mode. A printed `fail=0 skip=0` therefore means "no decoded entry failed", not "nothing was |