fix(oot): keep sun shadows sharp on ultrawide and move the cascade splits #2431
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2431
Loading…
Reference in a new issue
No description provided.
Delete branch "Wrath/Longshot:fix/2274-ultrawide-shadows"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
On monitors wider than 16:9, the game fits each sun shadow cascade around its slice of the wider horizontal view while keeping the same 3072x3072 shadow map. That spreads the same texels over a much wider area (worst at 32:9), making shadows coarse, shimmery, and flickering as the camera or sun moves, and making the cascade 0 to cascade 1 seam very noticeable on objects like the Castle Town drawbridge chains and archway.
To reproduce on
main: launch at 32:9 (5120x1440) with Shadow resolution on Highest or Auto (12 GB+ GPU), go to Hyrule Field near the drawbridge and trees, and watch the shadow edges shimmer and soften across the near cascade seam.What this changes:
HighestandAutoon 12 GB+ GPUs): sets 16:9 and narrower to4096, and scales smoothly upward with wider aspect ratios using4096 * (aspect / (16/9))^0.3219(rounded to a multiple of 8, capped at5120: about4512at 21:9,5120at 32:9). The render target pool reserves the extra room at boot as long as the total stays within 900 MB; otherwise Highest falls back to3072. An explicitHOS_RT_POOL_MBis used as-is and disables automatic shadow-map scaling.High(8 GB cards at2200) andGame'spresets are unchanged.HOS_SHADOW_RES=0restores the menu's sizes, including3072on Highest;HOS_SHADOW_RES=<texels>(64 to 8192, rounded up to a multiple of 8) forces a size. A forced size bypasses the automatic 900 MB limit; withHOS_RT_POOL_MBset, the pool is used as-is.45 macross all aspect ratios, and cascade 0 end to15 mat 16:9 and narrower,12 mat 32:9 and wider, sliding linearly in between (13.97 mat 3440x1440).HOS_SHADOW_SPLITS=0(oroff/0,0) restores the game's splits;HOS_SHADOW_SPLITS=<c0>,<c1>overrides them. If the requested splits would leave a slice empty or out of order, the game's splits are kept there.4096, adds3,4to the cascade depth bias to suppress shadow acne on the higher-resolution maps. Maps at4096or smaller get no automatic addition.RX_VK_CASCADE_BIAS(including0,0) overrides the automatic addition.Result: shadows on 32:9 and 16:9 are sharper and mostly stop flickering in Hyrule Field, including across the drawbridge chains, archway, trees, and Link up close.
Files to read first:
game/mods/shadows/src/wide.rs,game/mods/shadows/src/splits.rs,host/shadow_res.h,host/nn_applet.c,gpu/vk/vk_draw.cpp.Fixes #2274
Testing
Tested: Windows 11 Pro, NVIDIA GeForce RTX 3090 (24 GB), driver 621.01, DLAA, Shadow resolution on Highest. I walked Hyrule Field near the Castle Town drawbridge, the gate and the river wall at both 32:9 (5120x1440) and 16:9 (2560x1440), once on main (Nightly 805,
6b928cb4) and once on this PR (1a8cbac2), with the stat screen open in every picture. The pictures are below the list.5120sun shadows (+192 MBrender target pool, 802 MB total),12.00 m / 45.00 mcascade splits, and3,4cascade bias. The nearest shadows are sharper and steadier around Link and the drawbridge. I have not looked closely at the farther shadow slices yet.4096sun shadows (+84 MBrender target pool, 596 MB total),15.00 m / 45.00 mcascade splits, and0,0cascade bias.mise run lintpasses (only the pre-existing shellcheck note onbuild-windows.yml). Affected tests (test_oot_shadow,test_oot_shadow_splits,test_oot_shadow_fit,test_output_resolution,test_rt_pool_minimum,test_switch_table,test_settings_table,test_menu_ini_keys) all pass on this branch, and all 5 shadow/pool tests fail when copied onto cleanorigin/main(90fae88c). Onmise run test, the 28 remaining failures are identical on cleanorigin/main.32:9 (5120x1440), main first, this PR second
Castle wall by the river


Castle in the field


Drawbridge chains


16:9 (2560x1440), main first, this PR second
Castle gate


Castle wall by the river


Still to test:
4512shadow map (+125 MBpool),13.97 m / 45.00 msplits, and the automatic3,4bias (@Beanstalkor by hand).2200shadow map unchanged and no VRAM out-of-memory (@Beanstalkor by hand).3,4cascade bias does not cause peter-panning or shadow acne (@Beanstalkor by hand).Measurements
Verdict: In these spot checks the PR build runs about the same as main: frame time within 1 ms and GPU time within 0.5 ms at the same spots, with the render target pool growing by 192 MB at 32:9 and 84 MB at 16:9. Each spot is one reading, not an interleaved median, so please treat the table as a sanity check and not a full benchmark.
Setup: Windows 11 Pro, RTX 3090 (24 GB), driver 621.01, Ryzen 9 5900X, DLAA, V-Sync off, Shadow resolution on Highest, Hyrule Field near Castle Town. FPS, frame time and GPU time are read from the stat screen open in each picture; the pool sizes come from the run logs. main is Nightly 805 (
6b928cb4), which hadRX_VK_CASCADE_BIAS=0,2andHOS_SHADOW_STABLE=1set; the PR run had no switches set. The PR was measured on1a8cbac2, the head before BeanBot's rebase (it is nowa3489f89), and I have not re-measured on the new head.6b928cb41a8cbac2Risks
High/2200) are untouched by default. Forced shadow sizes bypass that limit, and an explicit pool size is used as-is.HOS_SHADOW_RES=0restores3072,HOS_SHADOW_SPLITS=0restores the game's splits, andRX_VK_CASCADE_BIAS=0,0disables the automatic bias. A plain revert also backs everything out cleanly.longshot_options.iniare untouched.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure. (One reading per spot so far; interleaved runs on the new head are still to do.)third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.gpu/vk/switches.def.tests/that reads changed source is updated, not weakened.mainand here, for a change that shows on screen.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.Tested in game: Windows 11 Pro, RTX 3090 (24 GB), driver 621.01, DLAA, Highest shadows. Tested in Hyrule Field (trees, drawbridge chains/archway, Link up close) at 32:9 (5120x1440: 5120 shadows, +192 MB pool, 12m/45m splits, 3,4 bias) and 16:9 (2560x1440: 4096 shadows, +84 MB pool, 15m/45m splits, 0,0 bias). Shadows are sharper and mostly stop flickering.
Possibly related, for context:
@review
Recommendation: Request changes. The automatic bias remains active after lowering shadow quality, and an explicit pool size can receive larger shadows without space being added for them. The visual improvement is reported on one GPU, but the performance cost and behavior across supported hardware remain unmeasured.
The change enlarges Highest sun shadow maps, moves cascade splits and adds depth bias for large maps. The reported Hyrule Field result is sharper, more stable shadows, at the cost of additional pool memory and unquantified GPU time.
Blocking (2): must change before merging.
gpu/vk/vk_draw.cpp:6147: The automatic bias is latched for the rest of the process after any qualifying large depth target is drawn. (more on the line) Do: Choose the automatic bias from the current sun shadow map and its current size, and clear it when the map or preset changes.host/nn_applet.c:218: An explicit pool override suppresses the extra allocation but still grants the larger automatic shadow size. (more on the line) Do: Do not grant the automatic enlargement when an explicit pool has not reserved space for it, or account for the extra space while preserving the documented override semantics.Should fix (2): not blocking, but worth doing before merging.
tests/test_oot_shadow_splits.py:18: The new test hard-codes gcc for the test runner instead of using its configured C compiler. (more on the line) Do: Pass the runner's C compiler placeholder and honor CC in standalone invocation.tests/test_output_resolution.py:82: The new pool assertions inherit HOS_SHADOW_RES from the developer's environment but assume any set value adds no pool space. (more on the line) Do: Remove HOS_SHADOW_RES from the fixture environment or explicitly exercise and calculate its override cases.Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
host/nn_applet.c:218: The pool grows on every preset, including cards that never select Highest automatically. (more on the line) Do: Compare base and head memory, frame pacing and gameplay on Steam Deck and an 8 GB GPU with their normal presets. (@fixdoes its part first: Reserve the extra pool space only when the selected preset can use the enlarged map, while accounting for later preset changes.)gpu/vk/vk_draw.cpp:6145: The new shadow sizes, splits and bias lack matching base-versus-head timing and cross-vendor visual runs. (more on the line) Do: Run interleaved base and head comparisons in the target and heavy scenes, including frame times and lows, and check visual output on the affected Tier 1 GPUs and operating systems.@fixcan do L1, L2, L3, L4 and L5.Questions (2) (not confirmed from the code; they don't hold the recommendation)
Checks: Still running: 10 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven against the requested baseline: the author reports visibly sharper, mostly stable shadows on an RTX 3090 at 16:9 and 32:9, but the before screenshots are listed as pending and the matching base timing measurements are TBD. The reported pool increases are 84 MiB at 16:9 and 192 MiB at 32:9.
Other systems: The split change affects every shadow preset, including Game's and High. The pool grows even when those presets use no larger map, including on Steam Deck and lower-memory GPUs. The bias affects matching depth-only targets after a large target is drawn. AMD, Intel, Linux, Steam Deck, other scenes and lower presets have no reported runs.
Switches: HOS_SHADOW_RES is added, defaulting to 4096–5120 on Highest when granted; HOS_SHADOW_SPLITS is added, defaulting to aspect-dependent 12–15 m and 45 m; RX_VK_CASCADE_BIAS changes from 0,0 to 3,4 after a qualifying large map. Their defaults need the missing hardware and performance evidence. All have switch-table entries, though the existing HOS_SHADOW_STABLE entry still describes Highest as 3072.
Reviewed:
9a599a98d0against90fae88c13: Read the repository instructions, contribution rules, standards and PR template; the diff and commit; shadow resolution, split, pool and patch code; and the changed shadow and pool test paths. Skimmed the larger output-resolution fixture and documentation. The requested docs/review-checklist.md and neighboring Tooling checkout are absent. The full renderer and every changed test were not read in full; no generated files or recorded runs were supplied in the diff.; nothing run (a code review).Checked and fine:
Testing: No commands that build, run tests or execute project code were run, as requested. The author reports Windows game testing and passing affected checks; CI remains in progress.
Overlaps and merge order: Not checked; the network is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@ -6138,2 +6142,4 @@}();(void)parsed;static std::atomic<bool> wide_sun{false};if (!cascade_set && at.width > 4096 && !wide_sun.load(std::memory_order_relaxed) && !wide_sun.exchange(true))L6 (should fix): The new shadow sizes, splits and bias lack matching base-versus-head timing and cross-vendor visual runs.
When: The only reported game run is on Windows with an RTX 3090; the base FPS and GPU times are TBD, and AMD, Linux and other affected presets have not been checked. The larger shadow passes can cost GPU time, while the new splits and bias can alter shadow quality elsewhere.
Do: Run interleaved base and head comparisons in the target and heavy scenes, including frame times and lows, and check visual output on the affected Tier 1 GPUs and operating systems.
@ -6140,0 +6144,4 @@static std::atomic<bool> wide_sun{false};if (!cascade_set && at.width > 4096 && !wide_sun.load(std::memory_order_relaxed) && !wide_sun.exchange(true))logf("vk: cascade bias 3,4: a sun shadow map %u texels a side, past 4096 (RX_VK_CASCADE_BIAS)", at.width);const bool wide_bias = !cascade_set && wide_sun.load(std::memory_order_relaxed);L1 (blocking): The automatic bias is latched for the rest of the process after any qualifying large depth target is drawn.
When: At 32:9, start on Highest and then change Shadow resolution to High or Game's, which applies immediately. The smaller cascades still receive 3,4 even though the automatic bias is intended for maps larger than 4096, changing their shadows until restart.
Do: Choose the automatic bias from the current sun shadow map and its current size, and clear it when the map or preset changes.
@ -210,0 +215,4 @@explicit HOS_RT_POOL_MB is taken as it is, and the wide size only while the pool stays within the 900 MB most */const int forced = hos_shadow_res_switch(getenv("HOS_SHADOW_RES"), NULL);uint32_t sun = forced > 0 ? (uint32_t)forced : forced < 0 ? 0 : hos_shadow_res_wide((uint32_t)wide, (uint32_t)(wide >> 32));uint64_t extra = e || !sun ? 0 : hos_shadow_res_extra(sun);L2 (blocking): An explicit pool override suppresses the extra allocation but still grants the larger automatic shadow size.
When: With HOS_RT_POOL_MB=512 at 16:9 and Highest, the pool remains 512 MiB while the hook changes 3072 shadows to 4096, consuming approximately 84 MiB more of that same pool. A previously sufficient override can therefore exhaust the render-target pool.
Do: Do not grant the automatic enlargement when an explicit pool has not reserved space for it, or account for the extra space while preserving the documented override semantics.
L5 (should fix): The pool grows on every preset, including cards that never select Highest automatically.
When: A 16:9 Steam Deck or 8 GB card using Game's or High reserves 84 MiB more without using a larger shadow map; at 32:9 the increase can be 192 MiB. Its effect on memory pressure and gameplay has not been measured.
Do: Compare base and head memory, frame pacing and gameplay on Steam Deck and an 8 GB GPU with their normal presets.
@ -0,0 +15,4 @@import sysimport tempfileRUN_ALL_ARGS = ["--cc", "gcc"]L3 (should fix): The new test hard-codes gcc for the test runner instead of using its configured C compiler.
When: On a supported Windows or Linux setup with Clang selected through CC and no gcc executable, the runner skips or fails this check instead of testing the split change.
Do: Pass the runner's C compiler placeholder and honor CC in standalone invocation.
@ -79,1 +80,3 @@assert(hos_rt_pool_size(305ull << 20) == ((uint64_t)pool << 20)); // (512 MB at least, 900 MB at most above 4K: nn_applet.c)// (512 MB at least, 900 MB at most above 4K: nn_applet.c; and room for Highest's 4096 sun shadows, 84 MB, within 900 MB:// issue 2274, host/shadow_res.h)const bool sixteen = !getenv("HOS_SHADOW_RES") && !getenv("HOS_RT_POOL_MB") && pool + 84 <= 900;L4 (should fix): The new pool assertions inherit HOS_SHADOW_RES from the developer's environment but assume any set value adds no pool space.
When: With HOS_SHADOW_RES=4096 in the environment, the production function adds 84 MiB, while sixteen is false and the assertion expects the unexpanded pool, so the unrelated output-resolution check fails.
Do: Remove HOS_SHADOW_RES from the fixture environment or explicitly exercise and calculate its override cases.
Change requests noted, fixes are already mostly built locally, out of tokens, will wrap up Wednesday if nobody picks it up.
@fix
I didn't fix this pull request: the change I made would remove a switch this pull request adds (
gpu/vk/switches.def), which undoes it. So L1, L2, L3 and L4 are the author's now. Nothing was pushed.Automated fix by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@fix
9a599a98d01a8cbac234Recommendation: Approve. The code is ready: only testing is left. The reported visual improvement is promising, but matching baseline timings and cross-vendor visual results are still missing. The extra pool reservation also remains on presets that cannot use the enlarged map. Recommend approval; not approved on the forge.
What
@fixchangedI changed this pull request: the new head is
1a8cbac234. I rebased it ontomain(6123c76adc). I edited its description to match the change.Changed
Not done
Nothing was built or run: the checks run again on the new head.
The change increases sun-shadow resolution and adjusts cascade splits and bias to reduce ultrawide shimmer. It adds render-target memory and shadow-pass work, with the performance cost still unmeasured against the base.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
host/nn_applet.c:218: The pool grows on every preset, including cards that never select Highest automatically. When: A 16:9 Steam Deck or 8 GB card using Game's or High reserves 84 MiB more without using a larger shadow map; at 32:9 the increase can be 192 MiB. Its effect on memory pressure and gameplay has not been measured. Do: Compare base and head memory, frame pacing and gameplay on Steam Deck and an 8 GB GPU with their normal presets.gpu/vk/vk_draw.cpp:6145: The new shadow sizes, splits and bias lack matching base-versus-head timing and cross-vendor visual runs. When: The only reported game run is on Windows with an RTX 3090; the base FPS and GPU times are TBD, and AMD, Linux and other affected presets have not been checked. The larger shadow passes can cost GPU time, while the new splits and bias can alter shadow quality elsewhere. Do: Run interleaved base and head comparisons in the target and heavy scenes, including frame times and lows, and check visual output on the affected Tier 1 GPUs and operating systems.Checks: they run again on this head; a failure shows on the pull request.
Also noticed (3; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Unproven: the author reports sharper, more stable shadows on an RTX 3090 at 16:9 and 32:9, but the matching base FPS and GPU-time results are TBD. The reported pool increases are 84 MB and 192 MB respectively.
Other systems: The rendering changes can affect other GPUs, drivers and Linux; AMD and Intel visual runs and a Linux build remain unreported. Lower shadow presets still reserve the enlarged pool by default.
Switches: HOS_SHADOW_RES defaults to automatic scaling, with 0 restoring menu sizes and 64–8192 forcing a size. HOS_SHADOW_SPLITS defaults to the new aspect-dependent splits, with 0 restoring game splits or a pair overriding them. RX_VK_CASCADE_BIAS defaults to 3,4 above 4096 texels and 0,0 otherwise; an explicit value overrides it. The defaults still need the outstanding visual and timing evidence.
Reviewed:
1a8cbac234against6123c76adc: Read AGENTS.md and CONTRIBUTING.md, the fix diff, the pool and cascade-bias code around the changed lines, and the shadow sizing code. The base diff output was truncated and the full changed code and repository rules referenced by it were not all read; no complete code review is claimed.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run tests were executed. The author reports Windows RTX 3090 gameplay checks; CI has not run on this head.
Overlaps and merge order: Not checked; network access is unavailable.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.
Edits have been pulled and tested locally, seems to function the same. Fix is still applied!
WIP: fix(oot): keep sun shadows sharp on ultrawide and move the cascade splitsto fix(oot): keep sun shadows sharp on ultrawide and move the cascade splits@review
Recommendation: Request changes. It conflicts with its base branch: bring it up to date (
@fixor@rebasetry first). (L7) The reported game run shows sharper, more stable shadows on an RTX 3090, but the cost against the base and the effect on other GPU vendors remain unmeasured. The pool also reserves extra space on presets that cannot use the larger map.Raises Highest shadow-map resolution and moves cascade splits to reduce coarse, shimmering sun shadows, at the cost of additional render-target memory and unknown GPU time. It also adds automatic depth bias for maps larger than 4096.
Blocking (1): must change before merging.
@fixor@rebasetry first). (for the author)Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
host/nn_applet.c:218: The pool grows on every preset, including cards that never select Highest automatically. When: A 16:9 Steam Deck or 8 GB card using Game's or High reserves 84 MiB more without using a larger shadow map; at 32:9 the increase can be 192 MiB. Its effect on memory pressure and gameplay has not been measured. Do: Compare base and head memory, frame pacing and gameplay on Steam Deck and an 8 GB GPU with their normal presets.gpu/vk/vk_draw.cpp:6145: The new shadow sizes, splits and bias lack matching base-versus-head timing and cross-vendor visual runs. When: The only reported game run is on Windows with an RTX 3090; the base FPS and GPU times are TBD, and AMD, Linux and other affected presets have not been checked. The larger shadow passes can cost GPU time, while the new splits and bias can alter shadow quality elsewhere. Do: Run interleaved base and head comparisons in the target and heavy scenes, including frame times and lows, and check visual output on the affected Tier 1 GPUs and operating systems.Since the last review (on
1a8cbac234)Still open: L5 (The pool grows on every preset, including cards that never select Highest automatically.); L6 (The new shadow sizes, splits and bias lack matching base-versus-head timing and cross-vend…)
New: L7 (It conflicts with its base branch: bring it up to date (
@fixor@rebasetry first).)Checks: Failing on this head, which is behind its base, where it passes:
PR description / Description follows the template (pull_request_target).@rebase(or@fix) brings it up to date and runs it again; not held against it.Also noticed (3; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Unproven across affected systems. The author reports visibly sharper, more stable shadows on Windows with an RTX 3090 at 32:9 and 16:9; the reported pool increases are 192 MB and 84 MB respectively. Matching base timing numbers and cross-vendor visual results are missing.
Other systems: The changes affect shadow rendering and pool memory on Windows and Linux, across GPU vendors and presets. AMD and Intel visual runs, Linux compilation, and an 8 GB Auto/High run remain unreported.
Switches: HOS_SHADOW_RES is added: by default Highest scales from 4096 to 5120 when pool space permits; 0 restores menu sizes and a numeric value forces a size. HOS_SHADOW_SPLITS is added: defaults to 15–12 m and 45 m; 0 restores the game's splits and a pair overrides them. RX_VK_CASCADE_BIAS now defaults to 3,4 for maps above 4096, otherwise 0,0; an explicit value overrides it. The defaults still need the ledger's measurements and visual runs.
Reviewed:
1a8cbac234against6123c76adc: Read repository rules, the PR template, standards, the diff and the ledger-relevant pool and shadow-resolution paths. Skimmed the remaining changed code, documentation and tests; did not read vk_draw.cpp or all changed test files in full. The requested review checklist and adjacent Tooling rules file were not present.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run project code were executed. The author reports passing affected tests and lint, with remaining suite failures also present on main; the PR lists Linux, 21:9, 8 GB and AMD/Intel runs as outstanding.
Overlaps and merge order: Not checked; network unavailable.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@fix
1a8cbac234a3489f8912Recommendation: Approve. The code is ready: only testing is left. The reported visual improvement is encouraging, but the larger shadow maps reserve extra pool memory on lower presets and their timing cost and cross-vendor appearance remain unmeasured. Recommend approval; not approved on the forge.
What
@fixchangedI changed this pull request: the new head is
a3489f8912. I rebased it ontomain(68ab0bc7ba).Conflicts resolved
game/oot_sites.c,game/sites.def,game/sites/e0f3ccfaf50065ae4ea01eb5aeb13b1a45da3348/locations.toml,game/sites/sites.toml,host/game_host.h,tests/test_oot_shadow_splits.pyNothing was built or run: the checks run again on the new head.
The change increases sun-shadow resolution and moves cascade splits to reduce shimmer and visible seams, at the cost of additional render-target memory and potentially more GPU work.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
host/nn_applet.c:218: The pool grows on every preset, including cards that never select Highest automatically. When: A 16:9 Steam Deck or 8 GB card using Game's or High reserves 84 MiB more without using a larger shadow map; at 32:9 the increase can be 192 MiB. Its effect on memory pressure and gameplay has not been measured. Do: Compare base and head memory, frame pacing and gameplay on Steam Deck and an 8 GB GPU with their normal presets.gpu/vk/vk_draw.cpp:6145: The new shadow sizes, splits and bias lack matching base-versus-head timing and cross-vendor visual runs. When: The only reported game run is on Windows with an RTX 3090; the base FPS and GPU times are TBD, and AMD, Linux and other affected presets have not been checked. The larger shadow passes can cost GPU time, while the new splits and bias can alter shadow quality elsewhere. Do: Run interleaved base and head comparisons in the target and heavy scenes, including frame times and lows, and check visual output on the affected Tier 1 GPUs and operating systems.Checks: they run again on this head (
PR description / Description follows the template (pull_request_target)failed on the last one); a failure shows on the pull request.More: does it help, other systems, switches, what was read
Does it help: Unproven against the required comparison: the author reports sharper, more stable shadows on an RTX 3090 at 16:9 and 32:9, but the matching base timing results are still TBD. The reported pool increases are 84 MB and 192 MB respectively.
Other systems: The changes affect shadow rendering and render-target memory across GPUs and operating systems. AMD and Intel visual runs, an 8 GB Auto/High run, and a Linux build remain unreported.
Switches: HOS_SHADOW_RES defaults to automatic scaling on Highest; 0 restores menu sizes and a numeric value forces a size. HOS_SHADOW_SPLITS defaults to aspect-dependent splits; 0 restores the game's splits and a pair overrides them. RX_VK_CASCADE_BIAS defaults to 3,4 for maps above 4096 and otherwise 0,0; an explicit value overrides it. The defaults still need the measurements and cross-vendor runs in L6.
Reviewed:
a3489f8912against68ab0bc7ba: Read the repository agent and contribution rules, pull request template, current shadow resolution and pool code, the rebased game shadow and hook-site diff, and the supplied review history and test reports. Skimmed the range-diff and test changes; did not read every changed file in full. The review checklist file was absent.; nothing run (a code review).Checked and fine:
Testing: No commands from the project or tests were run. The author reports Windows RTX 3090 gameplay and passing affected tests; CI has not run on this head.
Overlaps and merge order: Not checked; network access is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.
Can you check what BeanBot said?
Before and after screenshots for the description (main @
6b928cb4and this PR @1a8cbac2), stat screen open in each.32:9 (5120x1440)
Castle wall by the river


Castle in the field


Drawbridge chains


16:9 (2560x1440)
Castle gate


Castle wall by the river


a3489f891256517e3af8Rebased and ported onto mod-api; this PR now targets mod-api. Old head:
a3489f89(on main). New head:56517e3a(your two commits kept, plus three port commits on top). What moved where is at the top of the description.@review
Recommendation: Approve. The code is ready: only testing is left. The larger shadow maps and moved splits have shown a visual improvement on the author's RTX 3090, but matching timing and cross-vendor visual runs are still needed. The pool also reserves extra memory for presets that cannot use the larger maps. Recommend approval; not approved on the forge.
The change increases Highest sun-shadow resolution and moves cascade splits to make shadows sharper and steadier, especially on ultrawide displays. It costs additional render-target memory and may increase shadow-pass GPU work; the port moves the game-side logic into the Shadows system mod.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
host/nn_applet.c:218: The pool grows on every preset, including cards that never select Highest automatically. When: A 16:9 Steam Deck or 8 GB card using Game's or High reserves 84 MiB more without using a larger shadow map; at 32:9 the increase can be 192 MiB. Its effect on memory pressure and gameplay has not been measured. Do: Compare base and head memory, frame pacing and gameplay on Steam Deck and an 8 GB GPU with their normal presets.gpu/vk/vk_draw.cpp:6145: The new shadow sizes, splits and bias lack matching base-versus-head timing and cross-vendor visual runs. When: The only reported game run is on Windows with an RTX 3090; the base FPS and GPU times are TBD, and AMD, Linux and other affected presets have not been checked. The larger shadow passes can cost GPU time, while the new splits and bias can alter shadow quality elsewhere. Do: Run interleaved base and head comparisons in the target and heavy scenes, including frame times and lows, and check visual output on the affected Tier 1 GPUs and operating systems.Since the last review (on
a3489f8912)Still open: L5 (The pool grows on every preset, including cards that never select Highest automatically.); L6 (The new shadow sizes, splits and bias lack matching base-versus-head timing and cross-vend…); L8 (The check
PR description / Description follows the template (pull_request_target)fails…)Checks: Failing on this head, which is behind its base, where they pass:
Guide screenshots / Guide images and local UI source review (pull_request),CI / Lint (pre-commit, ShellCheck) (pull_request),CI / Website build and checks (pull_request),CI / Game-free checks (run_all.py, part 2/4) (pull_request),CI / Game-free checks (run_all.py, part 3/4) (pull_request),CI / Game-free checks (run_all.py, part 4/4) (pull_request),CI / Rust (rustfmt, clippy, cargo test) (pull_request),CI / Game-free checks (run_all.py, part 1/4) (pull_request),PR description / Description follows the template (pull_request_target).@rebase(or@fix) brings it up to date and runs them again; not held against it. Cancelled on this head (no result):PR description / Title and description (pull_request_target). Still running:CI / longshot-builder end to end (synthetic game) (pull_request),CI / Host C for Windows (llvm-mingw, compile only) (pull_request).More: does it help, other systems, switches, what was read
Does it help: Unproven on the current head: the author reports sharper, steadier shadows on Windows at 16:9 and 32:9 on an earlier head. Single readings show up to 0.5 ms more GPU time and pool increases of 84 MB and 192 MB respectively, but the before and after runs used different switches and were not interleaved.
Other systems: The change affects sun-shadow rendering across GPUs and operating systems, as well as render-target memory on lower presets. The current-head Linux RTX 3090 run reports the expected sizes and no visible seam; AMD and Intel visual results and matching performance runs remain outstanding.
Switches: HOS_SHADOW_RES defaults to automatic enlargement on Highest, with 0 restoring menu sizes and a numeric value forcing a size. HOS_SHADOW_SPLITS defaults to the new aspect-dependent splits, with 0 restoring the game's splits and a pair overriding them. RX_VK_CASCADE_BIAS defaults to an added 3,4 above 4096 texels unless explicitly set. The defaults still need the runs described in L6.
Reviewed:
56517e3af8against8efb4b3eb4: Read AGENTS.md, CONTRIBUTING.md and the pull request template; inspected the pool, shadow-resolution bridge, split logic, hook changes and renderer bias diff. The full changed files and remaining diff were not read in full; recorded screenshots and runs were considered from their descriptions.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run project code were executed. The author reports a current-head Linux game build and headless shots; Windows gameplay and timing reports are from an earlier head. CI still has two checks running.
Overlaps and merge order: The PR targets mod-api and depends on that branch.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
Description: the files to read first now name the mod-api paths (game/mods/shadows).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.