Loader: opt-in switches for the title's LOD, small-object cull, vehicle LOD and shadow settings #3817

Open
lucaseddd wants to merge 2 commits from upstream-pr/3817 into main
lucaseddd commented 2026-11-29 03:11:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by lucaseddd on 2026-11-29T03:11:05Z.


Adds opt-in switches for five of the title's own engine graphics settings, patched in the loaded image before any title code runs:

  • VICTORY_LOD_SCALE (world LOD distance);
  • VICTORY_SMALL_CULL (small-object cull threshold);
  • VICTORY_VEHICLE_LOD_BIAS;
  • VICTORY_LOW_SHADOWS (shadow-atlas tier);
  • VICTORY_LOW_VOLUMETRIC.

Every switch is off unless set, so default behaviour is unchanged.

The code is ToLIManl/VIctory-Hydra's crates/victory-loader/src/engine.rs at 85e7e07 (GPL-3.0), credited in the module header, with its settings-menu status hooks removed. site_patch.rs is its byte-verified, all-or-nothing patch core. Every site is compared byte for byte against title 1.0.2.1 before writing; another build is left alone and logged as Differs.

Why

On low-end cards the frame is bound by host preparation, not pixels: a 720p output does not raise fps (#3505, #3810). These settings cut the work per frame: fewer draws, so less preparation. They use the title's own LOD and culling tables, not a render-scale hack.

Measured

RTX 3060 Laptop 6 GB (D3D12 budget about 5.2 GB), Ryzen 7 5700X, game package on a 5400 rpm HDD, Series S, 1080p output (render 720p, title upscaler). VI-BR-PORT-based runtime, warm caches. Full report: lucaseddd/victory-rea build round 1; context in #3816.

First two minutes in the world, same opening route Without With LOD_SCALE=0.35, SMALL_CULL=2.0, LOW_SHADOWS=1280, LOW_VOLUMETRIC=1
Draws per frame 4,003 3,442
Host preparation per frame 106 ms 84 ms
Median fps 8.8 10.5

These are single sessions, not paired A/B runs: read them as the size of the effect, not a precise figure.

A later session with LOD_SCALE=0.35, SMALL_CULL=2.5, VEHICLE_LOD_BIAS=0.5, LOW_SHADOWS=1024 and without the volumetric setting had a correct image (hair, floors, walls, lights and shadows checked by eye), with a world median of 10.2 fps and p10 of 9.3 fps. That session also carried two unrelated runtime changes, so it confirms the image rather than isolating the fps.

Known issue, stated plainly: with VICTORY_LOW_VOLUMETRIC=1 (and 1,280 px shadows), floors and walls went black indoors and lamps blew out on that runtime. The setting shrinks the reflection cubemap from 64x64x6 to 32x32x6, and the shaders there did not cope. The docs say to keep it off unless the shader side handles the smaller cubemap. The other four switches were clean.

Tests

  • cargo test -p victory-loader --lib -- engine site_patch: 6 passed. They cover the sites' geometry, the replacements, the parsing, and that apply_set is all-or-nothing on a mismatch.
  • golden_title_exe_bytes_if_present passed with VICTORY_TITLE_EXE pointing at a real 1.0.2.1 executable: every site's expected bytes match. Without the variable it skips, as docs/asset-policy.md asks.
  • cargo build --release -p victory and cargo xtask policy (193 files ok) pass, and cargo fmt --check is clean for the files this PR touches.
  • In game, every site logs Done on 1.0.2.1.
<!-- greyfinch-sync:Marvisak/VIctory:issue:5547080508 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3817). Originally posted by [lucaseddd](https://github.com/lucaseddd) on 2026-11-29T03:11:05Z. --- Adds opt-in switches for five of the title's own engine graphics settings, patched in the loaded image before any title code runs: - `VICTORY_LOD_SCALE` (world LOD distance); - `VICTORY_SMALL_CULL` (small-object cull threshold); - `VICTORY_VEHICLE_LOD_BIAS`; - `VICTORY_LOW_SHADOWS` (shadow-atlas tier); - `VICTORY_LOW_VOLUMETRIC`. **Every switch is off unless set, so default behaviour is unchanged.** The code is ToLIManl/VIctory-Hydra's `crates/victory-loader/src/engine.rs` at `85e7e07` (GPL-3.0), credited in the module header, with its settings-menu status hooks removed. `site_patch.rs` is its byte-verified, all-or-nothing patch core. Every site is compared byte for byte against title 1.0.2.1 before writing; another build is left alone and logged as `Differs`. ## Why On low-end cards the frame is bound by host preparation, not pixels: a 720p output does not raise fps (#3505, #3810). These settings cut the **work per frame**: fewer draws, so less preparation. They use the title's own LOD and culling tables, not a render-scale hack. ## Measured RTX 3060 Laptop 6 GB (D3D12 budget about 5.2 GB), Ryzen 7 5700X, game package on a 5400 rpm HDD, Series S, 1080p output (render 720p, title upscaler). VI-BR-PORT-based runtime, warm caches. Full report: [lucaseddd/victory-rea build round 1](https://github.com/lucaseddd/victory-rea/blob/main/attempts/Builds/Round-01/report.md); context in #3816. | First two minutes in the world, same opening route | Without | With `LOD_SCALE=0.35`, `SMALL_CULL=2.0`, `LOW_SHADOWS=1280`, `LOW_VOLUMETRIC=1` | |---|---|---| | Draws per frame | 4,003 | 3,442 | | Host preparation per frame | 106 ms | 84 ms | | Median fps | 8.8 | 10.5 | These are single sessions, not paired A/B runs: read them as the size of the effect, not a precise figure. A later session with `LOD_SCALE=0.35`, `SMALL_CULL=2.5`, `VEHICLE_LOD_BIAS=0.5`, `LOW_SHADOWS=1024` and **without** the volumetric setting had a correct image (hair, floors, walls, lights and shadows checked by eye), with a world median of 10.2 fps and p10 of 9.3 fps. That session also carried two unrelated runtime changes, so it confirms the image rather than isolating the fps. **Known issue, stated plainly:** with `VICTORY_LOW_VOLUMETRIC=1` (and 1,280 px shadows), floors and walls went **black indoors** and lamps blew out on that runtime. The setting shrinks the reflection cubemap from 64x64x6 to 32x32x6, and the shaders there did not cope. The docs say to keep it off unless the shader side handles the smaller cubemap. The other four switches were clean. ## Tests - `cargo test -p victory-loader --lib -- engine site_patch`: 6 passed. They cover the sites' geometry, the replacements, the parsing, and that `apply_set` is all-or-nothing on a mismatch. - `golden_title_exe_bytes_if_present` passed with `VICTORY_TITLE_EXE` pointing at a real 1.0.2.1 executable: every site's expected bytes match. Without the variable it skips, as `docs/asset-policy.md` asks. - `cargo build --release -p victory` and `cargo xtask policy` (193 files ok) pass, and `cargo fmt --check` is clean for the files this PR touches. - In game, every site logs `Done` on 1.0.2.1.
lucaseddd commented 2026-11-29 03:32:50 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by lucaseddd on 2026-11-29T03:32:50Z.


The one failure in the CI run is victory-gpu's descriptor::host::tests::views_bound_while_another_slot_gets_its_texture_do_not_wait ("both made", descriptor/host.rs:2011). This PR does not touch victory-gpu: it only adds two victory-loader modules and four lines in apps/victory/src/run.rs.

The same test on this branch passed 30 out of 30 runs locally (Windows, MSVC, --release). It looks timing-dependent under a loaded parallel test run, so I'd ask for a re-run of the failed job. The CI's earlier steps (formatting, clippy and build) passed, and so did the PR's own tests.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7250113177 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3817#issuecomment-7250113177). Originally posted by [lucaseddd](https://github.com/lucaseddd) on 2026-11-29T03:32:50Z. --- The one failure in the CI run is `victory-gpu`'s `descriptor::host::tests::views_bound_while_another_slot_gets_its_texture_do_not_wait` ("both made", `descriptor/host.rs:2011`). This PR does not touch `victory-gpu`: it only adds two `victory-loader` modules and four lines in `apps/victory/src/run.rs`. The same test on this branch passed **30 out of 30** runs locally (Windows, MSVC, `--release`). It looks timing-dependent under a loaded parallel test run, so I'd ask for a re-run of the failed job. The CI's earlier steps (formatting, clippy and build) passed, and so did the PR's own tests.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3817:upstream-pr/3817'
git switch 'upstream-pr/3817'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3817'
git switch 'upstream-pr/3817'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3817'
git switch 'upstream-pr/3817'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3817'
git switch 'main'
git merge --squash 'upstream-pr/3817'
git switch 'main'
git merge --ff-only 'upstream-pr/3817'
git switch 'main'
git merge 'upstream-pr/3817'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!3817
No description provided.