Ground rendering, glowing plant stems and disappearing ground fog (v2.0.3, RTX 5080) #757
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot#757
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Hookshot version
v2.0.3
What kind of problem
Graphics (missing, black or wrong-coloured things, lighting, flicker)
What happened
Version: v2.0.3 (
45620e8)OS: NixOS, Hyprland
GPU: NVIDIA RTX 5080
CPU: Intel i9-14900K
What happens
All three were already present in earlier versions (v2.0.0, v2.0.2) and are still there in v2.0.3.
Steps to reproduce
Where in the game
Kokiri Forest
How often
Every time
Graphics card and driver version
RTX 5080 driver 595.112.07 kernel Linux 6.18.62
CPU, RAM and operating system
Intel i9 14900k NixOS kernel 6.18.62
Changes from the defaults
No response
Other software hooked into the game
No, nothing hooked in
hookshot_log.txt
hookshot_log_v2.0.3.txt
Screenshots or video
Before you send it
same with 9070xt and 7800x3d, 2.0.2 was fine
I'm still experiencing glowing foliage on 2.0.5 with my 4060 running on arch
same as @CoreBytee , still the same bug present on 2.0.5 running on 9070xt and 7800x3d. Lighting has been fixed but not the glowing vegetation
Findings: glowing / missing flower stems (Kokiri Forest, mesh foliage colour pass)
Version: current main (
b1799142, #640 reverted), Linux, NVIDIA RTX 3090Related: this issue, #667, #696 (glowing stems, near foliage), #674 (flower petals too white)
What happens
Next to Link's house in Kokiri Forest, the flower patch by the path looks like this:
RX_VK_MIRROR), so "glowing" and "missing" look like two faces of the same bug.Same save, same spot, both at the spawn camera:
The draws
Found by hiding programs live with
RX_VK_SKIP_FILE:5ba7cf23d685783689ca750f9852b7caSo geometry, culling and the pre-pass are fine: the stems are there and in the right place. The colour
89ca750f's fragment program computes is wrong.What
89ca750f's fragment readsFrontFace(two-sided stems: the normal is flipped by facing).c0[0x510], then 96-byte light recordsc0[0x520] + idx*96 + 16/32(four 128-bit loads).Ruled out (this report and the earlier ones)
RX_VK_MISS_LOG=1 RX_VK_MISS_LOG_PROG=89ca750fshows 0 misses. The "storage buffer NOT bound" programs of #696 are not this one (another report changed that search; the glow stayed).RX_VK_LOG_IMG=89ca750f); none hits the "handle is a storage pointer" rule.RX_VK_PARALLEL,RX_VK_KEEP_FINALIZED_MB=0, the mesh "firsts" (from the earlier reports).RX_VK_NO_F16=1can't be used as a test: it breaks the whole picture (the upscaler network).Where to look next
The colour is a lighting result that follows the stems' world orientation and the wind. That points at the light-list / probe path (
c0[0x510]indices,c0[0x520]records, the 3D texture and cube map) or at the normal built from the mesh outputs and the BC normal/material arrays, rather than at geometry. A next step would be dumping89ca750f's light-record reads (the index list and the four 128-bit loads) for one stem pixel and checking them against the same frame in Lichii, which draws the patch correctly.Reproduce
RX_VK_SKIP_FILE=<file>with89ca750f9852b7cain it turns the stems white; with5ba7cf23d6857836the stems disappear.Update: the glow is the per-vertex ambient (SH probe) colour, computed too high in the mesh program
Measured inside
89ca750f's fragment shader at a glowing stem pixel, against a normal grass fragment further away:Generic11.xyzreceived from the mesh stageGeneric11.y× ac6[1088]-scaled factor + a small rest) = 0.095 × 10.7 ≈ 1.015. The other four terms the shader adds up are below 0.05 together.c0[0x510]) and the 96-byte records (c0[0x520]) look sane (e.g. a light of radius 20 at (-45.2, 112.7, -18.7), likely the lantern above the patch), and the glow is there even on fragments where no light is accumulated. Normals are unit length; world positions match the spot.Generic11is: the mesh program writes it as a per-vertex spherical-harmonics irradiance evaluation, per colour channel (the SH constants 0.282095 and 0.162868 are in the IR). Its coefficients come from about four 128-bit global loads, a weighted blend of light probes, through a pointer read from the storage buffer atc0[0x780]+32, then probe index × 16.RX_VK_MISS_LOGshows 0 misses, so those reads land in a bound buffer. (The guess here that the probe data itself was stale turned out wrong; see the next update.)Next: a probe in the mesh stage records the raw SH words, their blend weights and addresses for the vertices that come out too bright, to see which buffer and page they're read from and whether that memory was last written by the CPU (mirror sync) or by a GPU pass.
Update 2: the probe data is right; the error is in the mesh program's ambient computation (or one of its later inputs)
A probe in
89ca750f's mesh stage recorded what it reads for the vertices that come out too bright:c0[0x770]+48/80/96,c4at 80/544/548/900) are identical to guest memory at the same addresses. They're CPU-written, nothing writes them after play starts (RX_VK_WATCH_CPU,RX_VK_WATCH_GPU_WRITE), and no GPU pass writes into them. So it isn't mirror sync or a stale copy.c4is its own binding.c0[0x770]+96.x × 0.282, then a further chain of the same kind. Everything checked so far is correct, so the wrong part is somewhere in the rest of that chain (a later read landing on another field, or arithmetic that doesn't match the hardware). Only part of the ~2,800-instruction cone has been probed.Also ruled out:
32df58e0, legacy global-memory pass by default)RX_VK_PRECOMPILE=0 RX_VK_NO_PROGRAM_CACHE=1(everything translated in play)EDEN_NX2_UNDEF_ZERO=0RX_VK_NOOPT=1EDEN_NX2_GM_LEGACY=1vs the port89ca750f's mesh and fragment IR are identical; the stems only dimEDEN_NX2_GM_COMPETING=089ca750fNext: the cone needs a reference value per vertex to bisect against (
Generic11.yfor the same vertex from a correct renderer, or the mesh IR evaluated on the CPU over the same guest memory). That's a bigger step than the probes so far, so it's paused here; anyone with an idea where to look in that chain is welcome to pick it up.Fixed in v2.0.6 (https://github.com/NotRexed/Hookshot/releases/tag/v2.0.6): the bright red/green/neon plant stems, flowers and branches came from a shader translation bug that gave an instruction the wrong input (PR #759). Please update from the launcher; reply here or open a new issue if it still happens. The ground rendering and disappearing ground parts are tracked in #994.
Confirmed on v2.0.6 (NixOS, Hyprland, RTX 5080): plant stems, flowers and ground fog look right now. Thanks a lot! I’ll follow #994 for the ground.
Confirming #922 fixes the Kokiri Forest case too (the flower patch next to Link's house, from the findings above).
The stems' mesh colour pass there (
d38b0d52a94ab5a8) had the same marker clash in ten instructions, for exampleFFMA R239, R28, R216, R239→R216->X239, R216->X216. In the per-vertex ambient (SH probe) sum that turnedx·w + accintox·acc + acc: red lost a probe term, and green and blue came out about 10× too bright (measured 2–22 against about 0.2 in a reference renderer), hence the cyan-green glow. With #922's rule the program lowers with no number mapped twice, and the patch looks right: dark stems, purple petals, no glow, normal grass.Reference | before | with #922: