beta-amd: black smears on vehicles close to the camera come from the TAA disocclusion mask (RDNA 2, RX 6900 XT) #145

Open
opened 2026-11-27 23:49:35 +00:00 by github-bot · 1 comment
Owner

@⁠MalarkZA on GitHub · 2026-11-27 23:48 UTC · original

What you see

Parked vehicles close to the camera have ragged black smears on and around them: across the body, the windows and the edges (a sedan's roof and side, a pickup's open door, a boat trailer, a dark convertible almost entirely). A few steps back they disappear. It shows on cars, pickups, motorcycles and passing traffic; some nearby vehicles never get it. It doesn't depend on VICTORY_HALF_VIEWS (posted in #86). Standing still or a short pan away and back doesn't clear it; once, it shifted after the game's long idle camera pan.

Machine and build

GPU AMD Radeon RX 6900 XT 16 GB (RDNA 2), driver 32.0.21045.29003
CPU / RAM Ryzen 7 5700X, 64 GB
OS Windows 11 26H2 (build 26300.9711)
Build beta-amd at 4c79ac5 + the aperture-segment fix from #127, --profile diag --features diagnostics, plus two local diagnostic additions (below)
Launch play.ps1 defaults (Series X, memory hooks off, probe rays on, ray tracing off), hand-played

How we traced it

We added a local hotkey: with VICTORY_CAPTURE set, F9 captures the next frames like VICTORY_CAPTURE_FRAMES does (picture, ops listing and, with VICTORY_DUMP_TARGETS=1, every target), so a frame can be captured the moment something shows up in play. We captured a "near" frame (smears visible) and a "far" frame a few steps back (same vehicles, no smears) and compared the targets. Shader names come from shaders.rpf via VICTORY_DUMP_MATCH / victory.exe translate.

The first target that differs between near and far is the mask written by TAA_UtilitiesCS_Disocclusion. Near, it covers the nearby vehicles completely; far, it only has a thin rim around the player. The rest of the TAA chain carries those shapes through to the screen:

Order Shader What it does here
1 TAA_UtilitiesCS_ReconstructSurfaces 11bbed94ee7a3243 Writes a reprojected-depth texture (R32_UINT, image_atomic_umax) from depth and motion vectors. It skips pixels whose motion is under 0.01 or over 0.2, so it only writes moving pixels.
2 TAA_UtilitiesCS_Disocclusion 488b12f581b37bfc Reads depth (R32G8X24: a depth-plane view and a stencil-plane view, format 22, plane 1), last frame's object-class map (R8_UINT, ping-pong), motion vectors and the texture from 1. Writes this frame's class map and an R8_UNORM disocclusion mask. The mask lights up on near vehicles.
3 TAA_UtilitiesCS_SceneColorTemporalResolveDualOutputWithLumaDOFAware b2b1ea29bc3987db Half-res, reads the mask; writes R16G16_FLOAT and R32_UINT targets
4 TAA_UtilitiesCS_ComputeShadingChange e7fbf3641855150d R16G16 → half-res R8 mask (vehicle shapes)
5 TAA_UtilitiesCS_FilterShadingChange 773e5dd5d74eba77 Filters that mask
6 TAA2_PrepareFrameStats e535cfd7baac93b8 Full-res, reads the albedo, both masks and the motion vectors; writes an RGBA8 parameter target, lit exactly where the smears are
7 TAA2_Resolve df11dcd012cd7382 The resolve: the smears are in its output

From the console code (disassembled with the VICTORY_INSPECT tool): Disocclusion takes the nearest depth in each 3×3 neighbourhood and reprojects it with the motion vector. It flags a pixel if last frame's class there shares no bits with this frame's 3×3 classes. Otherwise it flags it when c/(1+d−z_now) − c/(1+d−z_prev), clamped to 0..1, is over a threshold, with z_prev read from the texture in 1. The constants and threshold come from its constant buffers.

Ruled out

  • Depth: the depth buffer is correct in near frames; every vehicle is cleanly present.
  • Motion vectors: correct; parked vehicles show none, only the player moves.
  • Class map: the class map Disocclusion writes is the same in near and far frames and between consecutive frames. Vehicles are classified as vehicles either way.
  • Stencil writes: the stencil writes into this depth target (references, masks, shaders) are the same in near and far frames.
  • The reprojected-depth texture: see the experiment below.

An experiment that didn't fix it

In the lab, the texture from step 1 is about zero on static pixels (it only writes moving ones), and we suspected that zero made Disocclusion see a large depth change on anything near. We tried a local switch: F8 toggles a copy of the depth plane into that texture just before ReconstructSurfaces, through a scratch buffer, so static pixels hold real depth.

  • The fill ran every frame while on (logged, no misses).
  • The texture was full of depth in the capture.
  • The mask and the smears didn't change.

So that texture's zeros aren't the cause.

What we couldn't check

  • The threshold and constants: the capture PNGs are normalised per image, so we couldn't read the threshold or per-pixel values, and couldn't evaluate the formula ourselves.
  • How the R32_UINT texture is read: Disocclusion reads it and does float maths on the result, so the console treats the bits as a float. If the translated shader converted that load by value instead of reinterpreting the bits, the comparison would come out roughly as observed: far depth would pass and near depth would fail. We haven't checked how the translator handles this load, so take this as a question, not a finding.

What we can share

The near/far captures (ops listings and all targets) and the console logs of these runs, on request. The F9 capture hotkey is a small change we can send as a PR if it's useful to others.

**@⁠MalarkZA** on GitHub · 2026-11-27 23:48 UTC · [original](https://github.com/PastiiJay/klbf-lab/issues/145) **What you see** Parked vehicles close to the camera have ragged black smears on and around them: across the body, the windows and the edges (a sedan's roof and side, a pickup's open door, a boat trailer, a dark convertible almost entirely). A few steps back they disappear. It shows on cars, pickups, motorcycles and passing traffic; some nearby vehicles never get it. It doesn't depend on `VICTORY_HALF_VIEWS` (posted in #86). Standing still or a short pan away and back doesn't clear it; once, it shifted after the game's long idle camera pan. **Machine and build** | | | |---|---| | GPU | AMD Radeon RX 6900 XT 16 GB (RDNA 2), driver 32.0.21045.29003 | | CPU / RAM | Ryzen 7 5700X, 64 GB | | OS | Windows 11 26H2 (build 26300.9711) | | Build | `beta-amd` at `4c79ac5` + the aperture-segment fix from #127, `--profile diag --features diagnostics`, plus two local diagnostic additions (below) | | Launch | `play.ps1` defaults (Series X, memory hooks off, probe rays on, ray tracing off), hand-played | **How we traced it** We added a local hotkey: with `VICTORY_CAPTURE` set, F9 captures the next frames like `VICTORY_CAPTURE_FRAMES` does (picture, ops listing and, with `VICTORY_DUMP_TARGETS=1`, every target), so a frame can be captured the moment something shows up in play. We captured a "near" frame (smears visible) and a "far" frame a few steps back (same vehicles, no smears) and compared the targets. Shader names come from `shaders.rpf` via `VICTORY_DUMP_MATCH` / `victory.exe translate`. The first target that differs between near and far is the mask written by `TAA_UtilitiesCS_Disocclusion`. Near, it covers the nearby vehicles completely; far, it only has a thin rim around the player. The rest of the TAA chain carries those shapes through to the screen: | Order | Shader | What it does here | |---|---|---| | 1 | `TAA_UtilitiesCS_ReconstructSurfaces` `11bbed94ee7a3243` | Writes a reprojected-depth texture (R32_UINT, `image_atomic_umax`) from depth and motion vectors. It skips pixels whose motion is under 0.01 or over 0.2, so it only writes moving pixels. | | 2 | `TAA_UtilitiesCS_Disocclusion` `488b12f581b37bfc` | Reads depth (R32G8X24: a depth-plane view and a stencil-plane view, format 22, plane 1), last frame's object-class map (R8_UINT, ping-pong), motion vectors and the texture from 1. Writes this frame's class map and an R8_UNORM disocclusion mask. **The mask lights up on near vehicles.** | | 3 | `TAA_UtilitiesCS_SceneColorTemporalResolveDualOutputWithLumaDOFAware` `b2b1ea29bc3987db` | Half-res, reads the mask; writes R16G16_FLOAT and R32_UINT targets | | 4 | `TAA_UtilitiesCS_ComputeShadingChange` `e7fbf3641855150d` | R16G16 → half-res R8 mask (vehicle shapes) | | 5 | `TAA_UtilitiesCS_FilterShadingChange` `773e5dd5d74eba77` | Filters that mask | | 6 | `TAA2_PrepareFrameStats` `e535cfd7baac93b8` | Full-res, reads the albedo, both masks and the motion vectors; writes an RGBA8 parameter target, lit exactly where the smears are | | 7 | `TAA2_Resolve` `df11dcd012cd7382` | The resolve: the smears are in its output | From the console code (disassembled with the `VICTORY_INSPECT` tool): Disocclusion takes the nearest depth in each 3×3 neighbourhood and reprojects it with the motion vector. It flags a pixel if last frame's class there shares no bits with this frame's 3×3 classes. Otherwise it flags it when `c/(1+d−z_now) − c/(1+d−z_prev)`, clamped to 0..1, is over a threshold, with `z_prev` read from the texture in 1. The constants and threshold come from its constant buffers. **Ruled out** - **Depth:** the depth buffer is correct in near frames; every vehicle is cleanly present. - **Motion vectors:** correct; parked vehicles show none, only the player moves. - **Class map:** the class map Disocclusion writes is the same in near and far frames and between consecutive frames. Vehicles are classified as vehicles either way. - **Stencil writes:** the stencil writes into this depth target (references, masks, shaders) are the same in near and far frames. - **The reprojected-depth texture:** see the experiment below. **An experiment that didn't fix it** In the lab, the texture from step 1 is about zero on static pixels (it only writes moving ones), and we suspected that zero made Disocclusion see a large depth change on anything near. We tried a local switch: F8 toggles a copy of the depth plane into that texture just before ReconstructSurfaces, through a scratch buffer, so static pixels hold real depth. - The fill ran every frame while on (logged, no misses). - The texture was full of depth in the capture. - **The mask and the smears didn't change.** So that texture's zeros aren't the cause. **What we couldn't check** - **The threshold and constants:** the capture PNGs are normalised per image, so we couldn't read the threshold or per-pixel values, and couldn't evaluate the formula ourselves. - **How the R32_UINT texture is read:** Disocclusion reads it and does float maths on the result, so the console treats the bits as a float. If the translated shader converted that load by value instead of reinterpreting the bits, the comparison would come out roughly as observed: far depth would pass and near depth would fail. We haven't checked how the translator handles this load, so take this as a question, not a finding. **What we can share** The near/far captures (ops listings and all targets) and the console logs of these runs, on request. The F9 capture hotkey is a small change we can send as a PR if it's useful to others.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 23:49:35 +00:00
Author
Owner

@⁠PastiiJay on GitHub · 2026-11-28 00:03 UTC · original

Really clear trace, thank you. Comparing the near and far frames target by target is exactly what helps place it in the TAA disocclusion mask. We're looking into it, and you'll be credited for the find.

**@⁠PastiiJay** on GitHub · 2026-11-28 00:03 UTC · [original](https://github.com/PastiiJay/klbf-lab/issues/145#issuecomment-7230610877) Really clear trace, thank you. Comparing the near and far frames target by target is exactly what helps place it in the TAA disocclusion mask. We're looking into it, and you'll be credited for the find.
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/PastiiJay--klbf-lab#145
No description provided.