Game: DLSS/DLAA ghosting when camera clips inside Link #1370

Open
opened 2026-11-17 06:57:01 +00:00 by BeanIssues · 4 comments
Collaborator

Reported on Discord

Longshot version

v3.0.0-rc.7, built from source with personal additions; also reproduced on source builds of rc.4, rc.5 and rc.6. Not tested with a release binary.

Channel

Built from source (release candidate source).

What happened

With DLSS or DLAA, when the camera is pushed inside Link, the background smears and repeats while he moves. Examples include fence rails appearing duplicated, a duplicate sprout, and the tunnel wall seeming to move with Link. It gets worse with faster movement and is worse with DLSS Quality than DLAA. Expected the room behind Link to remain clean while he is invisible.

Frame generation off, a 60 fps cap, RX_VK_NO_A2C=1, and RX_VK_REACTIVE=1 made no difference. Using the game's own upscaler makes the artifact almost disappear. No injected frame generation or ReShade.

The reporter's renderer measurements suggest that when the camera is inside Link, the game omits his colour draws but retains roughly 30 depth-only draws. Their hypothesis is that this leaves moving body depth/motion data for DLSS in front of the visible room. They report RX_VK_DLSS_DEBUG=motion shows large solid shapes at the camera. Their proposed workaround skips hidden-mesh depth-only draws under conditions described in their patch; they report it removed the artifact in both locations without new smearing.

Proposed patch excerpt from the reporter:

// mesh = s.vbuf[0].address, counted per frame for skinned draws into the scene:
//   depth:  draws that write depth and no colour
//   colour: draws that write colour, into any target
// hidden: in the frame before depth > 0 and colour == 0,
//         and it had colour in an earlier frame
if (hidden(mesh) && depth_only && !d.occ_pool) SKIP_HERE();

On rc.7, the reporter says this skips 30 draws per frame while the camera is in Link and the ghosting disappears. They report it does not skip draws with an occlusion query, draws into another target, or meshes that never showed colour; depth returns one frame after the colour draw. Their patch covers four files under gpu/vk (269 lines, mostly diagnostic recorder) and adds RX_VK_DLSS_FADED=0 to disable it.

Where in the game

Crawl tunnel in Kokiri Forest; top of a vine wall in the Deku Tree, with the camera turned until it clips into Link.

How often

Every time.

Graphics card and driver version

NVIDIA RTX 5090, driver 621.14.

CPU, RAM and operating system

Ryzen 9 9950X3D, 64 GB RAM, Windows 11 build 26300.

Graphics settings

4K, 240 Hz HDR; DLSS Quality and DLAA. Frame generation disabled for testing.

Logs and videos

The reporter says longshot_log.txt and clips were attached to the original post; those files could not be copied here. Please attach the log, video and proposed patch (dlss-hidden-body-depth-v3.0.0-rc.7.patch) to this issue.

Longshot #242 proposes shared pose motion vectors for Link and attached equipment; it is related to upscaler motion data but does not track this specific hidden-body depth artifact.

Reported on [Discord](https://discord.com/channels/1569849200047427645/1572143132064354314/1572143132064354314) ### Longshot version v3.0.0-rc.7, built from source with personal additions; also reproduced on source builds of rc.4, rc.5 and rc.6. Not tested with a release binary. ### Channel Built from source (release candidate source). ### What happened With DLSS or DLAA, when the camera is pushed inside Link, the background smears and repeats while he moves. Examples include fence rails appearing duplicated, a duplicate sprout, and the tunnel wall seeming to move with Link. It gets worse with faster movement and is worse with DLSS Quality than DLAA. Expected the room behind Link to remain clean while he is invisible. Frame generation off, a 60 fps cap, `RX_VK_NO_A2C=1`, and `RX_VK_REACTIVE=1` made no difference. Using the game's own upscaler makes the artifact almost disappear. No injected frame generation or ReShade. The reporter's renderer measurements suggest that when the camera is inside Link, the game omits his colour draws but retains roughly 30 depth-only draws. Their hypothesis is that this leaves moving body depth/motion data for DLSS in front of the visible room. They report `RX_VK_DLSS_DEBUG=motion` shows large solid shapes at the camera. Their proposed workaround skips hidden-mesh depth-only draws under conditions described in their patch; they report it removed the artifact in both locations without new smearing. Proposed patch excerpt from the reporter: ```cpp // mesh = s.vbuf[0].address, counted per frame for skinned draws into the scene: // depth: draws that write depth and no colour // colour: draws that write colour, into any target // hidden: in the frame before depth > 0 and colour == 0, // and it had colour in an earlier frame if (hidden(mesh) && depth_only && !d.occ_pool) SKIP_HERE(); ``` On rc.7, the reporter says this skips 30 draws per frame while the camera is in Link and the ghosting disappears. They report it does not skip draws with an occlusion query, draws into another target, or meshes that never showed colour; depth returns one frame after the colour draw. Their patch covers four files under `gpu/vk` (269 lines, mostly diagnostic recorder) and adds `RX_VK_DLSS_FADED=0` to disable it. ### Where in the game Crawl tunnel in Kokiri Forest; top of a vine wall in the Deku Tree, with the camera turned until it clips into Link. ### How often Every time. ### Graphics card and driver version NVIDIA RTX 5090, driver 621.14. ### CPU, RAM and operating system Ryzen 9 9950X3D, 64 GB RAM, Windows 11 build 26300. ### Graphics settings 4K, 240 Hz HDR; DLSS Quality and DLAA. Frame generation disabled for testing. ### Logs and videos The reporter says `longshot_log.txt` and clips were attached to the original post; those files could not be copied here. Please attach the log, video and proposed patch (`dlss-hidden-body-depth-v3.0.0-rc.7.patch`) to this issue. ### Related issue Longshot #242 proposes shared pose motion vectors for Link and attached equipment; it is related to upscaler motion data but does not track this specific hidden-body depth artifact.

Files as requested

Files as requested

Log attached, as asked: the game's log from a run of about 7 minutes of v3.0.0-rc.7 built from source with the patch in (rule on, no switch set, DLSS Quality 2560x1440 to 3840x2160). The camera was pushed into Link twice in that run.

One thing in the file is obfuscated: my Windows account name is replaced by account in four paths, so C:\Users\account\... stands for my own user folder. Nothing else is changed.

Lines of that log (they start vk: upscaler: faded: and come from the patch's recorder):

frame 34600: 40 meshes with 45 skinned draws that wrote depth alone into the scene; 10 of them got colour in the frame (0 colour draws on the scene's depth target, 15 on others, ...), 30 got none, 30 of those after colour in an earlier frame (hidden); ...; 30 depth draws of hidden meshes left out, ...
frames 34600 to 35077: 14333 depth draws of hidden meshes left out, in 478 frames, 30 in a frame at most; ...
frames 35506 to 36106: 18030 depth draws of hidden meshes left out, in 601 frames, 30 in a frame at most; ...

So Link is 30 skinned meshes with one depth-only draw each. While the camera is inside him none of them gets a colour draw, and all 30 depth-only draws are still submitted. Longshot's own counter agrees: vk: skips a frame by vk_draw.cpp line: 8191: 30.0 in those periods, and no skipped draw in the other 326 of the run's 339 periods.

Three things the summary above does not have:

  • Where it is. skin_check() and draw() in gpu/vk/vk_draw.cpp (the skip sits right after reactive_scene_draw), and the switch in gpu/vk/vk_temporal.cpp. The upscaler's depth and motion are made in gpu/vk/shaders/dlss_prep.comp and by actor_motion (dlss_actor.frag), which is why a body that only writes depth matters to DLSS.
  • A caveat. In two earlier runs with the same rule, a stray draw was skipped now and then outside the Link case: under 0.1 a frame, in a few periods, nothing I could see. In the attached run there were none. Meshes that lose their colour for a frame in ordinary play are kept; the log says why, once for each reason (drawn because the game asks about them with a query, or no depth draw in the next frame).
  • How it was made. The patch and the analysis were made with an AI assistant (Claude). I ran every build and test myself, on one PC, at DLSS Quality. DLAA shows the fault too; I have not yet run the fix at DLAA.
Log attached, as asked: the game's log from a run of about 7 minutes of v3.0.0-rc.7 built from source with the patch in (rule on, no switch set, DLSS Quality 2560x1440 to 3840x2160). The camera was pushed into Link twice in that run. One thing in the file is obfuscated: my Windows account name is replaced by `account` in four paths, so `C:\Users\account\...` stands for my own user folder. Nothing else is changed. Lines of that log (they start `vk: upscaler: faded:` and come from the patch's recorder): ``` frame 34600: 40 meshes with 45 skinned draws that wrote depth alone into the scene; 10 of them got colour in the frame (0 colour draws on the scene's depth target, 15 on others, ...), 30 got none, 30 of those after colour in an earlier frame (hidden); ...; 30 depth draws of hidden meshes left out, ... frames 34600 to 35077: 14333 depth draws of hidden meshes left out, in 478 frames, 30 in a frame at most; ... frames 35506 to 36106: 18030 depth draws of hidden meshes left out, in 601 frames, 30 in a frame at most; ... ``` So Link is 30 skinned meshes with one depth-only draw each. While the camera is inside him none of them gets a colour draw, and all 30 depth-only draws are still submitted. Longshot's own counter agrees: `vk: skips a frame by vk_draw.cpp line: 8191: 30.0` in those periods, and no skipped draw in the other 326 of the run's 339 periods. Three things the summary above does not have: - **Where it is.** `skin_check()` and `draw()` in `gpu/vk/vk_draw.cpp` (the skip sits right after `reactive_scene_draw`), and the switch in `gpu/vk/vk_temporal.cpp`. The upscaler's depth and motion are made in `gpu/vk/shaders/dlss_prep.comp` and by `actor_motion` (`dlss_actor.frag`), which is why a body that only writes depth matters to DLSS. - **A caveat.** In two earlier runs with the same rule, a stray draw was skipped now and then outside the Link case: under 0.1 a frame, in a few periods, nothing I could see. In the attached run there were none. Meshes that lose their colour for a frame in ordinary play are kept; the log says why, once for each reason (`drawn because the game asks about them with a query`, or no depth draw in the next frame). - **How it was made.** The patch and the analysis were made with an AI assistant (Claude). I ran every build and test myself, on one PC, at DLSS Quality. DLAA shows the fault too; I have not yet run the fix at DLAA.
Member

Thank you for finding this and for the patch. We made it into a PR, with your credit in the code and the commit:
#1447. It works the same way, with these changes: it waits 3 frames before it leaves a mesh's depth out (the colour
pass tests depth EQUAL against those draws, so with 1 frame a mesh that blinks would be lost), it decides before actor
motion takes the draw, it keeps draws the game uses for occlusion queries, and it is one table for all of the game's
drawing threads. On an RTX 5090 with DLAA and frame generation, the smear at the top of the Deku Tree vine wall is gone in
both runs and present in both runs of main.

Two questions: is it OK for you that your patch goes into Longshot under its licence (GPL-3.0-or-later)? And do you want a
Co-Authored-By: line on the commit? If yes, please give the name and email to put there. If you can, please also try the
PR's build with DLSS Quality at your spot.

Thank you for finding this and for the patch. We made it into a PR, with your credit in the code and the commit: https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1447. It works the same way, with these changes: it waits 3 frames before it leaves a mesh's depth out (the colour pass tests depth EQUAL against those draws, so with 1 frame a mesh that blinks would be lost), it decides before actor motion takes the draw, it keeps draws the game uses for occlusion queries, and it is one table for all of the game's drawing threads. On an RTX 5090 with DLAA and frame generation, the smear at the top of the Deku Tree vine wall is gone in both runs and present in both runs of main. Two questions: is it OK for you that your patch goes into Longshot under its licence (GPL-3.0-or-later)? And do you want a `Co-Authored-By:` line on the commit? If yes, please give the name and email to put there. If you can, please also try the PR's build with DLSS Quality at your spot.

Thanks for picking this up, and for the credit.

Licence: yes, it is fine for the patch to go into Longshot under GPL-3.0-or-later. As noted above, it was written with an AI assistant and tested by me.

Co-Authored-By: no thanks. No line and no email for me, please. The credit in the code and the commit is plenty.

Trying #1447: I can't run the PR's build. I only run what I build myself, from the released source with my own changes worked into it, so I will meet your version when it is in a release. I'll go back to both spots then (the crawl tunnel in Kokiri Forest and the top of the vine wall in the Deku Tree, at DLSS Quality and at DLAA) and say here if anything is off.

Until then, three things from my own build that bear on your changes (rc.7 with the patch as posted and a few unrelated local changes; RTX 5090, driver 621.14, frame generation off):

  • DLAA is clean too. I ran it today: 30 depth draws a frame left out while the camera was inside Link, 62,648 draws over 2,137 frames. At DLSS Quality last night it was 36,983 over 1,233 frames.
  • The 3-frame wait looks right. With my 1-frame rule, that 15-minute DLAA run had six moments in ordinary play where a mesh's depth was left out for one or two frames (1 to 9 draws each). I saw nothing on screen, but they are probably the blink case you describe, and your wait leaves them alone.
  • Keeping the query draws matters in practice. My log shows meshes that lost their colour in ordinary play being drawn all the same because the game asks about them with a query.
Thanks for picking this up, and for the credit. **Licence:** yes, it is fine for the patch to go into Longshot under GPL-3.0-or-later. As noted above, it was written with an AI assistant and tested by me. **Co-Authored-By:** no thanks. No line and no email for me, please. The credit in the code and the commit is plenty. **Trying #1447:** I can't run the PR's build. I only run what I build myself, from the released source with my own changes worked into it, so I will meet your version when it is in a release. I'll go back to both spots then (the crawl tunnel in Kokiri Forest and the top of the vine wall in the Deku Tree, at DLSS Quality and at DLAA) and say here if anything is off. Until then, three things from my own build that bear on your changes (rc.7 with the patch as posted and a few unrelated local changes; RTX 5090, driver 621.14, frame generation off): - **DLAA is clean too.** I ran it today: 30 depth draws a frame left out while the camera was inside Link, 62,648 draws over 2,137 frames. At DLSS Quality last night it was 36,983 over 1,233 frames. - **The 3-frame wait looks right.** With my 1-frame rule, that 15-minute DLAA run had six moments in ordinary play where a mesh's depth was left out for one or two frames (1 to 9 draws each). I saw nothing on screen, but they are probably the blink case you describe, and your wait leaves them alone. - **Keeping the query draws matters in practice.** My log shows meshes that lost their colour in ordinary play being drawn all the same because the game asks about them with a query.
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot#1370
No description provided.