Shadows, sea floor and small surface spots flicker together with a still camera (AMD) #74

Open
opened 2026-11-26 11:45:29 +00:00 by PastiiJay · 4 comments
PastiiJay commented 2026-11-26 11:45:29 +00:00 (Migrated from github.com)
Contributor

Imported from PastiiJay/klbf-lab. Originally posted by PastiiJay on 2026-11-26T11:45:29Z.


Same machine as #73. With the camera and the player perfectly still, several things flicker at the same moments: a small object's contact shadow, the sea floor seen through the water, and tiny spots of a wooden floor. Because they flicker together, we think it is one cause, probably a screen-space or shadow resource that is sometimes read before it is finished, or from the previous frame. Ideas welcome.

<!-- greyfinch-sync:PastiiJay/klbf-lab:issue:6625949556 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/issues/74). Originally posted by [PastiiJay](https://github.com/PastiiJay) on 2026-11-26T11:45:29Z. --- Same machine as #73. With the camera and the player perfectly still, several things flicker at the same moments: a small object's contact shadow, the sea floor seen through the water, and tiny spots of a wooden floor. Because they flicker together, we think it is one cause, probably a screen-space or shadow resource that is sometimes read before it is finished, or from the previous frame. Ideas welcome.
HandshakeHackin commented 2026-11-26 11:54:06 +00:00 (Migrated from github.com)
Author
Contributor

Imported from PastiiJay/klbf-lab. Originally posted by HandshakeHackin on 2026-11-26T11:54:06Z.


One way to narrow this down on beta-2 is to capture two consecutive presented frames at the fixed camera, one lit and one dark. In a diagnostics build, set VICTORY_CAPTURE to a folder and VICTORY_CAPTURE_FRAMES to the two frame numbers, with VICTORY_DUMP_TARGETS=1. Match the target by dimensions, format and resource in that run. If it alternates between two resources, keep both identities.

For a suspected R32_UINT shadow-mask table, compare the target values as words rows, especially zero and all_ones. Those count actual words. The PNGs are scaled per image, so an apparently brighter mask alone is ambiguous. Once you have a candidate writer from frame-<n>-ops.txt, VICTORY_DUMP_AFTER=<shader hash> takes a copy immediately after its draw or dispatch. If the mask already differs there, focus on its producer and inputs. If the producer outputs match but the displayed patches differ, the later passes are the place to look. Record whether the flicker survives capture, since readbacks add GPU work and transitions. Per-pass capture · Integer mask counters.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7191310553 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/issues/74#issuecomment-7191310553). Originally posted by [HandshakeHackin](https://github.com/HandshakeHackin) on 2026-11-26T11:54:06Z. --- One way to narrow this down on `beta-2` is to capture two consecutive presented frames at the fixed camera, one lit and one dark. In a diagnostics build, set `VICTORY_CAPTURE` to a folder and `VICTORY_CAPTURE_FRAMES` to the two frame numbers, with `VICTORY_DUMP_TARGETS=1`. Match the target by dimensions, format and resource in that run. If it alternates between two resources, keep both identities. For a suspected R32_UINT shadow-mask table, compare the `target values as words` rows, especially `zero` and `all_ones`. Those count actual words. The PNGs are scaled per image, so an apparently brighter mask alone is ambiguous. Once you have a candidate writer from `frame-<n>-ops.txt`, `VICTORY_DUMP_AFTER=<shader hash>` takes a copy immediately after its draw or dispatch. If the mask already differs there, focus on its producer and inputs. If the producer outputs match but the displayed patches differ, the later passes are the place to look. Record whether the flicker survives capture, since readbacks add GPU work and transitions. [Per-pass capture](https://github.com/PastiiJay/klbf-lab/blob/74a7e38358898b0ec698dc4ae9cfd848bab06525/crates/victory-gpu/src/capture.rs#L311-L319) · [Integer mask counters](https://github.com/PastiiJay/klbf-lab/blob/74a7e38358898b0ec698dc4ae9cfd848bab06525/crates/victory-gpu/src/capture.rs#L938-L973).
PastiiJay commented 2026-11-26 11:56:27 +00:00 (Migrated from github.com)
Author
Contributor

Imported from PastiiJay/klbf-lab. Originally posted by PastiiJay on 2026-11-26T11:56:27Z.


Thanks @HandshakeHackin, that's a much better way in than guessing switches. We're building a diagnostics build now and will capture two consecutive frames, one lit and one dark, at the same fixed camera, with VICTORY_DUMP_TARGETS=1. If a target alternates between two resources, we'll follow it back to its writer with VICTORY_DUMP_AFTER. We'll post what we find here.

One extra detail from today: the sea floor keeps the same flicker rhythm whatever we change on the water path, while the sea surface (#73) changes rhythm with VICTORY_CLAMP_AHEAD=0 / VICTORY_INDIRECT_RAW=1. So these look like two separate causes.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7191360685 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/issues/74#issuecomment-7191360685). Originally posted by [PastiiJay](https://github.com/PastiiJay) on 2026-11-26T11:56:27Z. --- Thanks @HandshakeHackin, that's a much better way in than guessing switches. We're building a diagnostics build now and will capture two consecutive frames, one lit and one dark, at the same fixed camera, with `VICTORY_DUMP_TARGETS=1`. If a target alternates between two resources, we'll follow it back to its writer with `VICTORY_DUMP_AFTER`. We'll post what we find here. One extra detail from today: the sea floor keeps the same flicker rhythm whatever we change on the water path, while the sea surface (#73) changes rhythm with `VICTORY_CLAMP_AHEAD=0` / `VICTORY_INDIRECT_RAW=1`. So these look like two separate causes.
PastiiJay commented 2026-11-26 12:15:05 +00:00 (Migrated from github.com)
Author
Contributor

Imported from PastiiJay/klbf-lab. Originally posted by PastiiJay on 2026-11-26T12:15:05Z.


Capture results (same still-camera run as #73), and it's a separate cause from the sea, as suspected:

The sand, contact shadow and deck spots all live in the G-buffer albedo (1280x720, R8G8B8A8_TYPELESS), which toggles between two states: one with decals (wet sand, worn rug) and one without (dry sand, plain rug). Within a state the frames differ by 4.5–7.7; across states by 9–17.5. The likely writer is a deferred-decal pass: 64 indirect draws, vertex 167501e87c356551, pixel shaders 144249440a4b420e to fa3534fe1e406e51. It has no render target and writes the albedo through UAVs, depth-tested, followed by compute 565cc0b38920b229. The draw list is identical in both states, so the decals are recorded every frame but their result is lost on some frames. Our guess is submission order, or a missing UAV/RT barrier against the G-buffer lists that overwrite them. Next: VICTORY_DUMP_AFTER on those decal shaders.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7191761190 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/issues/74#issuecomment-7191761190). Originally posted by [PastiiJay](https://github.com/PastiiJay) on 2026-11-26T12:15:05Z. --- Capture results (same still-camera run as #73), and it's a separate cause from the sea, as suspected: The sand, contact shadow and deck spots all live in the G-buffer albedo (1280x720, R8G8B8A8_TYPELESS), which toggles between two states: one with decals (wet sand, worn rug) and one without (dry sand, plain rug). Within a state the frames differ by 4.5–7.7; across states by 9–17.5. The likely writer is a deferred-decal pass: 64 indirect draws, vertex `167501e87c356551`, pixel shaders `144249440a4b420e` to `fa3534fe1e406e51`. It has no render target and writes the albedo through UAVs, depth-tested, followed by compute `565cc0b38920b229`. The draw list is identical in both states, so the decals are recorded every frame but their result is lost on some frames. Our guess is submission order, or a missing UAV/RT barrier against the G-buffer lists that overwrite them. Next: `VICTORY_DUMP_AFTER` on those decal shaders.
PastiiJay commented 2026-11-27 13:20:07 +00:00 (Migrated from github.com)
Author
Contributor

Imported from PastiiJay/klbf-lab. Originally posted by PastiiJay on 2026-11-27T13:20:07Z.


Thanks for the report. One thing to check first: the game needs its shaders prepared before the first start. Without that step they are translated during play, which can cause missing objects, wrong faces and stutter.

Could you run .\scripts\play-scarlett.ps1 -OnlyPrecompile once, wait for it to finish, then start the game normally? Also check that -NoPrecompile is not in your launch settings.

If it still happens after that, please post the output of the run so we can see where it goes wrong.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7219350942 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/issues/74#issuecomment-7219350942). Originally posted by [PastiiJay](https://github.com/PastiiJay) on 2026-11-27T13:20:07Z. --- Thanks for the report. One thing to check first: the game needs its shaders prepared before the first start. Without that step they are translated during play, which can cause missing objects, wrong faces and stutter. Could you run `.\scripts\play-scarlett.ps1 -OnlyPrecompile` once, wait for it to finish, then start the game normally? Also check that `-NoPrecompile` is not in your launch settings. If it still happens after that, please post the output of the run so we can see where it goes wrong.
Sign in to join this conversation.
No labels
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.

Reference
PastiiJay/klbf-lab#74
No description provided.