Blend layers with RenderVKBlendHitLighting: blocky dark mosaic where the GI cache has no cells #1499

Closed
opened 2026-11-08 22:52:37 +00:00 by TheSlowly · 0 comments
Collaborator

A semi-transparent cloud mesh (legacy, tint alpha 0.87, under a house in a sky region) gets a blocky light/dark mosaic and a dark band on its underside with RenderVKBlendHitLighting on (default). Off, it is smooth.

A/B on the live viewer:

  • RenderVKBlendHitLighting 0: smooth, bright
  • RenderVKGI 0: smooth, bright
  • RenderVKGIHitAmbient 0: still blocky
  • RenderVKGICache 0: no mosaic, but the whole underside nearly black (~42 vs ~168)
  • RenderVKGIDebug 6: the cache covers the underside in patches (red = no cell), matching the mosaic

Cause (clean_surface_light.glsl, giForwardRefl / blendHitEnv under CLEAN_BLEND_HIT): where the cells around P have no estimate, the fallback ambient is the probes x g_bh_occ, the one occlusion ray along the reflection direction R. Seen from below, R points at the ground, so g_bh_occ is 0 and those spots get no ambient at all, right next to cells that do have the cache's light.

The mirror-direction ray suits the specular share, but the diffuse fallback on a face looking down at sunlit ground probably shouldn't hang on it.

Workaround: RenderVKBlendHitLighting 0.

Possible fixes (the uncovered share's diffuse fallback; the specular can keep the R ray):

  1. Take the opaque pixel's occlusion there (giFwdScreenOcc), as the non-blend-hit path does: no extra ray, and the sealed-room glass case (fix-blend-ambient-occlusion, the blend-gi-occ check) still holds where the pixel behind is enclosed.
  2. A second occlusion ray along the layer's normal (or one cosine-distributed sample) for the diffuse share only: one more ray per layer on GI frames, and it judges the layer's own surroundings rather than the surface behind it.
  3. Plain probes for the uncovered share: simplest, but brings the sky leak back into sealed rooms, so probably not.

off / on / GIDebug 6 / cache off

A semi-transparent cloud mesh (legacy, tint alpha 0.87, under a house in a sky region) gets a blocky light/dark mosaic and a dark band on its underside with `RenderVKBlendHitLighting` on (default). Off, it is smooth. A/B on the live viewer: - `RenderVKBlendHitLighting` 0: smooth, bright - `RenderVKGI` 0: smooth, bright - `RenderVKGIHitAmbient` 0: still blocky - `RenderVKGICache` 0: no mosaic, but the whole underside nearly black (~42 vs ~168) - `RenderVKGIDebug` 6: the cache covers the underside in patches (red = no cell), matching the mosaic Cause (clean_surface_light.glsl, `giForwardRefl` / `blendHitEnv` under `CLEAN_BLEND_HIT`): where the cells around P have no estimate, the fallback ambient is the probes x `g_bh_occ`, the one occlusion ray along the reflection direction R. Seen from below, R points at the ground, so `g_bh_occ` is 0 and those spots get no ambient at all, right next to cells that do have the cache's light. The mirror-direction ray suits the specular share, but the diffuse fallback on a face looking down at sunlit ground probably shouldn't hang on it. Workaround: `RenderVKBlendHitLighting` 0. Possible fixes (the uncovered share's diffuse fallback; the specular can keep the R ray): 1. Take the opaque pixel's occlusion there (`giFwdScreenOcc`), as the non-blend-hit path does: no extra ray, and the sealed-room glass case (fix-blend-ambient-occlusion, the blend-gi-occ check) still holds where the pixel behind is enclosed. 2. A second occlusion ray along the layer's normal (or one cosine-distributed sample) for the diffuse share only: one more ray per layer on GI frames, and it judges the layer's own surroundings rather than the surface behind it. 3. Plain probes for the uncovered share: simplest, but brings the sky leak back into sealed rooms, so probably not. ![off / on / GIDebug 6 / cache off](https://git.slipstreamviewer.org/attachments/15271b8a-944b-46d9-bfd9-642ba418d315)
TheSlowly added this to the Slipstream project 2026-11-08 22:52:37 +00:00
Sign in to join this conversation.
No milestone
No project
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
sky_line/Slipstream#1499
No description provided.