Files
WoWee/include/rendering/renderer.hpp
Kelsi 9490ce98c5 fix(water): break the refraction feedback loop; halve the capture cost
The refraction copy was taken from the finished frame, which already had
the water composited into it, so the water sampled its own output every
frame. A moving object left one sharp copy per frame — a train of ghosts
rather than a wake — and the display brightness the water divided back
out compounded through the loop, so the surface pumped as the camera
moved.

Draw the water in a continuation of the scene pass instead. The frame now
runs scene, copy, water, UI: the copy is taken at the one point where the
scene is finished and the water is not yet over it. The copy is also
same-frame rather than a frame behind, and being pre-post-processing it
carries no baked-in brightness, so the shader drops both the divide that
compensated for it and the temporal lag.

Two supporting changes. The capture scales with a blit when the scene is
not rendered at the history's resolution, which FSR does — previously the
smaller scene was copied into the corner of a larger history and sampled
as though it filled it. And the history is now half resolution: a quarter
of the pixels copied per frame and a quarter of the sampling footprint,
which is not visible through a surface that displaces the sample by a few
rippling pixels regardless.

Water stays in the scene pass under MSAA, where a continuation pass would
have to resolve a second time; that path keeps the old end-of-frame copy.
2026-07-31 07:22:15 -07:00

16 KiB