diff options
| author | Rafael <rafaelalvesp2005@gmail.com> | 2026-11-22 17:14:18 -0300 |
|---|---|---|
| committer | Rafael <rafaelalvesp2005@gmail.com> | 2026-11-22 22:25:39 -0300 |
| commit | 203b207c7abb1b48999e70ab94fb1bf2fbd9fe59 (patch) | |
| tree | 615908e194ac1cfe4992c789e7620427eedf3d9a /docs/models.md | |
| parent | 03b09a086592a197db64d91655c6e65c30764d96 (diff) | |
docs/models.md: the u32 after an effect name is a size computed from the record's fields
@jeremygold02's formula, recomputed here on all 932 records (910 + 22);
the value never equals the serialized record length, so the walk still
finds the next record. Runtime use unknown.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs/models.md')
| -rw-r--r-- | docs/models.md | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/docs/models.md b/docs/models.md index 793ac5b0b..09ce7e070 100644 --- a/docs/models.md +++ b/docs/models.md | |||
| @@ -550,7 +550,21 @@ They are reachable through the **effect records** in `shaders.rpf` (found by @je | |||
| 550 | are little-endian: | 550 | are little-endian: |
| 551 | 551 | ||
| 552 | 1. **The effect record.** It starts with a one-byte name length and the name, including its terminator, then a | 552 | 1. **The effect record.** It starts with a one-byte name length and the name, including its terminator, then a |
| 553 | u32 whose meaning is not known. Six stage lists follow, each a u32 count and that many u32 ordinals. | 553 | u32 (below). Six stage lists follow, each a u32 count and that many u32 ordinals. |
| 554 | |||
| 555 | The u32 is a size computed from the record's own counted fields (@jeremygold02). Let G be the ordinals in the | ||
| 556 | six lists, T the techniques, P the passes, and W the post-pass word count. Let A and B be the two block | ||
| 557 | lengths after them, E the post-pass entry count, I the payload bytes of the entries whose tag is a length | ||
| 558 | (not `0x80000000`), and S the string-pool length. Lengths don't count their own prefixes. Then, with | ||
| 559 | `x = 4W + A + B`: | ||
| 560 | |||
| 561 | ```text | ||
| 562 | word = 48 + 8(G + T + E) + 32P + I + S + (round_up(x, 8) if E else x) | ||
| 563 | ``` | ||
| 564 | |||
| 565 | This holds for all 932 records of this build (910 + 22, recomputed here). The value never equals the record's | ||
| 566 | serialized length (0 of 932), so the next record is found by the sequential walk, not by this word. What the | ||
| 567 | runtime uses it for is unknown. Groups 3 and 4 are empty here, so their share of it is unmeasured. | ||
| 554 | 568 | ||
| 555 | `shaders.rpf` holds **two shader databases** (SGD5), and an ordinal counts within one of them (found by | 569 | `shaders.rpf` holds **two shader databases** (SGD5), and an ordinal counts within one of them (found by |
| 556 | @jeremygold02). Each database stores six program groups, each a u32 count followed by its programs. A program | 570 | @jeremygold02). Each database stores six program groups, each a u32 count followed by its programs. A program |
| @@ -597,7 +611,8 @@ record, technique and pass. The record and pass format below was also checked by | |||
| 597 | 611 | ||
| 598 | Two things are still open: | 612 | Two things are still open: |
| 599 | 613 | ||
| 600 | - **The u32 after an effect's name.** What it means is still unknown. | 614 | - **The u32 after an effect's name.** It is reproduced from the record's fields; how the runtime uses it is |
| 615 | still unknown. | ||
| 601 | - **Which technique and pass the game draws with.** That is a run-time choice; it is presumably made in the | 616 | - **Which technique and pass the game draws with.** That is a run-time choice; it is presumably made in the |
| 602 | executable (RT-5). | 617 | executable (RT-5). |
| 603 | 618 | ||