Skip to content

GPU: the least indirect light where the title's ray-traced probes have none - #116

Open
starnotes-xj wants to merge 1 commit into
Zettrox:mainfrom
starnotes-xj:fix/ambient-only
Open

starnotes-xj wants to merge 1 commit into
Zettrox:mainfrom
starnotes-xj:fix/ambient-only

Conversation

@starnotes-xj

Copy link
Copy Markdown

The title's indirect diffuse light comes from probes filled by tracing rays, which do not run here: CS_ScreenProbes_TemporalResolve leaves whatever its unwritten inputs held, so anything the sun does not reach directly is black — and in the prologue it is not even black but blown out, because the title's exposure reads that garbage.

This replaces the resolve's output with a constant right after it runs (raised, not added), so the title's own lighting still applies the surfaces' colours and its exposure sees a sane average.

Ported from Belobug's AMD fork (belobug/VIctory-Belobug-AMD, commit 4f45ab8): the same pass — root constants (level, tint) and a UAV of the R9G9B9E5 light texture, one dispatch per resolve. Here it is hooked into State::dispatch, and the list's cached heap, root signature and pipeline are invalidated so the next draw sets its own.

VICTORY_AMBIENT=<level> sets the light (0.6 by default, 0 none, off keeps the title's output).

Measured (RTX 4060 Laptop, 8 GB, NVIDIA 621.14)

  • Prologue cell and the opening cutscene with VICTORY_AMBIENT=0: the whole frame washes out to white; only subtitles are readable.
  • The same frames at the default 0.6: exposed image — dark corners readable, faces lit, the window no longer the only thing visible.
  • 2 fps in the world either way (the pass is 1 dispatch of 2560x1440 / 8x8).

Still black after this: eyes, and surfaces lit only by the title's reflections (those rays do not run yet).

Checks

  • cargo test -p victory-gpu --release: 112 passed, 0 failed (the new ambient_pass_builds needs a D3D12 device and returns early without one).
  • cargo clippy --release -p victory-gpu: clean.
  • In-game: the log line ambient light level=0.6 width=2560 height=1440 and the diff in the images above.

…e none

The title's indirect diffuse light comes from probes it fills by tracing
rays, which do not run here: the program that resolves them
(CS_ScreenProbes_TemporalResolve) leaves whatever its unwritten inputs
held, and what the sun does not reach directly is black. Its output is
replaced by a constant right after it runs: raised, not added, so the
title's own lighting still applies the surfaces' colours and its
exposure reads a sane average instead of garbage.

Ported from Belobug's VIctory fork (belobug/VIctory-Belobug-AMD, 4f45ab8),
whose ambient.rs is the same pass: root constants (level, tint) and a
UAV of the R9G9B9E5 light texture, one dispatch per resolve. On this tree
the pass is hooked into State::dispatch, and the list's cached heap, root
signature and pipeline are invalidated so the next draw sets its own.

VICTORY_AMBIENT=<level> sets the light (0.6 by default, 0 none, `off`
keeps the title's output).

Measured on an RTX 4060 (8 GB): the prologue cell and the first cutscene
went from a white, blown-out frame with VICTORY_AMBIENT=0 to an exposed
image at 0.6 — dark corners readable, the window no longer the only
visible thing. Still black: eyes and other surfaces lit only by the
title's reflections (those rays do not run yet).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant