#1171 GI: glass reads the radiance cache smoothly (no cell grid) #1173

Manually merged
sky_line merged 1 commit from TheSlowly/Slipstream:gi-forward-cache-smooth into main 2026-10-29 02:07:09 +00:00
Collaborator

Fixes #1171: with GI on, glass showed the radiance cache's cell grid (squares on windows, polygons on tilted or curved panes).

A forward-lit surface has no GI pixel of its own. giForwardRefl took its ambient and its reflection occlusion from the one cache cell at the fragment, unfiltered.

  • giCacheForward blends the 8 cells around the point (trilinear). Cells with no estimate yet drop out, and the probes stand in for their share, so there's no seam where the cache's cover ends.
  • RenderVKGIForwardCacheFilter (live): 2 = trilinear (default), 1 = the 4 in-plane cells (cheaper), 0 = as before.
  • Cost: up to 8 hash finds instead of 1, on forward GI fragments only.

Tested in-world on the observatory windows and dome (0 vs 2).

Fixes #1171: with GI on, glass showed the radiance cache's cell grid (squares on windows, polygons on tilted or curved panes). A forward-lit surface has no GI pixel of its own. `giForwardRefl` took its ambient and its reflection occlusion from the one cache cell at the fragment, unfiltered. - `giCacheForward` blends the 8 cells around the point (trilinear). Cells with no estimate yet drop out, and the probes stand in for their share, so there's no seam where the cache's cover ends. - `RenderVKGIForwardCacheFilter` (live): 2 = trilinear (default), 1 = the 4 in-plane cells (cheaper), 0 = as before. - Cost: up to 8 hash finds instead of 1, on forward GI fragments only. Tested in-world on the observatory windows and dome (0 vs 2).
A forward-lit surface (alpha-blend glass, forward frames) has no GI pixel of its own: its
ambient and its reflection occlusion (GI / probe irradiance) came from the ONE radiance-cache
cell at the fragment. On glass, which is mostly reflection, every cell got its own flat tint:
squares on a window facing an axis, triangles / polygons where a tilted or curved pane cuts
the cubes; their size followed RenderVKGICacheCellSize.

giCacheForward weights the 8 cells around P by their centres (trilinear, in the cell's
distance level and face bucket); cells without an estimate drop out and the probes stand for
their share (giForwardRefl mixes toward the probe irradiance by the found weight), so the
cache's cover ends without a seam either. giCellKey is split into giCellLevel / giCellAxis /
giCellBucket / giCellKeyQ (same keys).

RenderVKGIForwardCacheFilter (live, GI_FWD_FILTER_SHIFT bits 26-27): 2 trilinear (default),
1 the 4 cells of the face's own layer (half the finds; a tilted face keeps a step where it
crosses a layer -- the #1052 occlusion cull's in-plane rule), 0 the single cell as before.

Cost: forward GI fragments only: up to 8 hash finds instead of 1 (corners under 1e-3 weight
skipped), next to the probe walk and SSR they already run. Deferred surfaces unchanged.
sky_line referenced this pull request from a commit 2026-10-29 02:06:49 +00:00
Owner

Merged to main as 71dc58b9b2 by cherry-pick (with review nits in ac757d72fc), after review and an aggregate build. Thanks! Commit messages were reworded to drop other viewers' names (repo rule: no viewer names in commits/PRs/tickets); credit goes in the release notes and About.

Merged to main as 71dc58b9b2 by cherry-pick (with review nits in ac757d72fc), after review and an aggregate build. Thanks! Commit messages were reworded to drop other viewers' names (repo rule: no viewer names in commits/PRs/tickets); credit goes in the release notes and About.
sky_line manually merged commit 71dc58b9b2 into main 2026-10-29 02:07:09 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 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
sky_line/Slipstream!1173
No description provided.