diff options
| author | Rafael <rafaelalvesp2005@gmail.com> | 2026-11-22 15:33:34 -0300 |
|---|---|---|
| committer | Rafael <rafaelalvesp2005@gmail.com> | 2026-11-22 17:03:37 -0300 |
| commit | 8a926fe6d7bf1ad2b5659a58d9c8907dde7e7beb (patch) | |
| tree | c0e5f99ee3adafc2a674575ed72b91bea2db3aa3 /docs/models.md | |
| parent | f847748cc76bd3777f9c070c4034eb2fc1c04e64 (diff) | |
docs/models.md: effect records in shaders.rpf select a technique pass's mesh and pixel programs
Found by @jeremygold02 in #2519 and reproduced on three records of the same
shaders.rpf. The run-time choice of technique and pass, and a general locator
for effect records, stay open.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs/models.md')
| -rw-r--r-- | docs/models.md | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/docs/models.md b/docs/models.md index 026ccd998..580129e66 100644 --- a/docs/models.md +++ b/docs/models.md | |||
| @@ -502,8 +502,8 @@ file names), so the effect is recoverable from them. Measured on a 1.0.2.1 copy, | |||
| 502 | | Effects with `RaytracingResolve` CS programs | 341 (1,004 programs; 3 each for 324) | | 502 | | Effects with `RaytracingResolve` CS programs | 341 (1,004 programs; 3 each for 324) | |
| 503 | | Materials whose hash is the joaat of a carved effect name | 3,211 (96%), 8 of the 18 hashes | | 503 | | Materials whose hash is the joaat of a carved effect name | 3,211 (96%), 8 of the 18 hashes | |
| 504 | 504 | ||
| 505 | So a material leads to its effect and that effect's ray-tracing resolve programs. It does **not** lead to the | 505 | So a material leads to its effect and that effect's ray-tracing resolve programs. The draw (VS/PS/MS) programs |
| 506 | draw (VS/PS/MS) programs from the package alone: | 506 | are not reachable through the carved programs' names, order or suffixes: |
| 507 | 507 | ||
| 508 | - None of the 23,619 graphics programs (VS/PS/MS) carries an effect name; they are named `<stage>_<technique or entry>_<8 hex>`. | 508 | - None of the 23,619 graphics programs (VS/PS/MS) carries an effect name; they are named `<stage>_<technique or entry>_<8 hex>`. |
| 509 | - `shaders.rpf` stores programs grouped by kind, not by effect (the 1,004 `RaytracingResolve` programs sit next | 509 | - `shaders.rpf` stores programs grouped by kind, not by effect (the 1,004 `RaytracingResolve` programs sit next |
| @@ -512,8 +512,34 @@ draw (VS/PS/MS) programs from the package alone: | |||
| 512 | 1,775) but is not the joaat of the program name, and only 1 of the 896 suffixes on the effect-named CS programs | 512 | 1,775) but is not the joaat of the program name, and only 1 of the 896 suffixes on the effect-named CS programs |
| 513 | appears on any graphics program. | 513 | appears on any graphics program. |
| 514 | 514 | ||
| 515 | The effect → technique → VS/PS table is therefore not in the carved programs' names, order or suffixes; it is | 515 | They are reachable through the **effect records** in `shaders.rpf` (found by @jeremygold02, #2519). All fields |
| 516 | presumably in the executable (RT-5). Until then, a real model is drawn with a chosen pair ([first_light.md](first_light.md)). | 516 | are little-endian: |
| 517 | |||
| 518 | 1. **The effect record.** It starts with a one-byte name length and the name, including its terminator, then a | ||
| 519 | u32. Six stage lists follow, each a u32 count and that many u32 ordinals into a stage's programs. | ||
| 520 | 2. **The technique table.** A u32 count, then one 4-byte entry per technique: the low 15 bits of its first u16 are | ||
| 521 | the name's offset in the string block, and byte 3 is the pass count. A u32 pass total follows, then 24-byte pass | ||
| 522 | records. | ||
| 523 | 3. **The pass records.** The first six bytes of each pass select an entry of each stage list: 0 is unused, | ||
| 524 | otherwise `stage_list[selector - 1]`. | ||
| 525 | |||
| 526 | Checked on three records of a 1.0.2.1 copy (the same `shaders.rpf`, SHA-256 `0bc16345…`): | ||
| 527 | |||
| 528 | | Record | Stage list sizes | Techniques | Passes (total = sum of counts) | First pass mesh / pixel ordinal | | ||
| 529 | |---|---|---:|---:|---| | ||
| 530 | | windshield wiper mask | 1, 1, 0, 0, 0, 0 | 1 | 1 | 11017 / 10943 | | ||
| 531 | | stock rim | 41, 53, 0, 0, 0, 3 | 106 | 108 | 9143 / 8925 | | ||
| 532 | | stock tire | 41, 53, 0, 0, 0, 3 | 106 | 108 | 9089 / 8835 | | ||
| 533 | |||
| 534 | Two things are still open: | ||
| 535 | |||
| 536 | - **Finding effect records in general.** The three were found by their offsets; there is no general locator for | ||
| 537 | all effects yet. | ||
| 538 | - **Which technique and pass the game draws with.** That is a run-time choice; it is presumably made in the | ||
| 539 | executable (RT-5). | ||
| 540 | |||
| 541 | Until both are settled, a real model is drawn with a chosen pair ([first_light.md](first_light.md)). The effect | ||
| 542 | records already give that choice a pair that can be checked independently. | ||
| 517 | 543 | ||
| 518 | ## Vehicle distant-light recipes | 544 | ## Vehicle distant-light recipes |
| 519 | 545 | ||