Make the water corrections in the runtime, on by default, instead of loading replacement modules from a folder.

The coordinate pair and the absorption guard needed modules made on each PC by tools/projective_recipe.py and a folder named in NX2NAVI_SPV_OVERRIDE, so no player had them. runtime/spirv_water.c makes the recipe's edits on the translation in memory, in the recipe's order: on the NVIDIA profile its three modules are byte for byte the recipe's (RTX 5090, game 1.1.1). vk_pipeline.c keeps the edited modules in a small table, made at first use, and builds a pair from them only when both of its stages were made; a module of another shape is built as it is, with a log line. NX2NAVI_WATER_PROJECTIVE=0 turns the corrections off. tests/water_projective_check.py compares the runtime's edits with the recipe's on made-up modules.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-12 07:55:57 -05:00
parent 56e142169c
commit d31c3a1036
8 changed files with 575 additions and 137 deletions

View File

@@ -18,7 +18,7 @@ for the launcher; a GPU with Vulkan 1.3 and `VK_EXT_external_memory_host` (curre
## Faster
- **A new install no longer builds its pipelines while you play.** A release now carries a list of the graphics
pipelines the game is known to draw, 8,605 of them in this one. The install builds all of them while it prepares the
pipelines the game is known to draw, 8,715 of them in this one. The install builds all of them while it prepares the
shaders, and every start builds them before play, as it already did for the pipelines your own install had drawn.
Before, a new install met each pipeline in play first: in Hyrule Field one ten-second stretch of a first visit had
1,769 draws wait for their pipelines, 461 ms in all, the longest frame 88 ms. In a first walk through Kakariko
@@ -55,16 +55,17 @@ for the launcher; a GPU with Vulkan 1.3 and `VK_EXT_external_memory_host` (curre
5 to 180 m in one frame; such a frame now starts a new history, and frame generation is told of every new start, so
it no longer makes frames between two unrelated pictures. `dlaa_cut = 0` turns the camera test off. By bct8925
(pull request #651).
- **Water drawn as a rectangle over solid ground at the Hyrule Castle moat and the Castle Town canal, and a red beam
there** (issue #398). The water's shader worked out each corner's place on the screen and blended that across the
surface, which goes wrong as soon as a corner of the surface is behind the camera; its place is now worked out per
pixel. The distance through the water that dims what lies under it can no longer be negative, which had turned the
dimming into a gain. Found and corrected by ChurchOfIlias (pull request #666); the game applies the correction to
those two shaders itself. `water_projective = 0` in nx2navi.ini leaves them as they are. The correction was compared
byte for byte on an NVIDIA card; on AMD it runs the same steps on AMD's translation of the shaders and was not run by
us. Why the distance comes out negative is not known yet.
- **The launcher run from the source with an older Python** stopped at *Gather Build Tools* with nothing but "No
module named 'zstandard'". It now says so on its first screen, with the command that installs what is missing.
## For testers
- **Water drawn as a rectangle over solid ground at the Hyrule Castle moat and the Castle Town canal, and a red beam
there** (issue #398): the source has an opt-in correction by ChurchOfIlias (pull request #666). It takes replacement
shaders made on your own PC from your own shader cache (`tools/projective_recipe.py`, `docs/water-projective.md`)
and is off unless `spv_override` names their folder. The release does not turn it on.
## Known issues
- A rare one-frame flicker of shadows or lighting, on grass and objects, may remain; the fix for the black part of the