Conversation
Hemisphere-kernel SSAO against the depth prepass's depth and a new view-space normal target, depth-aware blurred and multiplied into ambient. The depth prepass gains an MRT normal output for it, and the old flat ambient-occlusion scalar becomes an optional multiplier on top of the real per-pixel result instead of a stand-in for it. Blending is left on globally by the renderer; the SSAO passes render to alpha-less R16F targets, so leaving it enabled here silently blended every write away to zero. Disable it for the pass like the depth prepass already does for its own MRT writes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pbr.slang.SceneAmbient::occlusiondefaults to1.0(no extra attenuation) and stays available as an optional multiplier on top of SSAO for artist tuning.Fix folded in
While bringing up the feature, SSAO's raw/blur render targets read back as all-zero regardless of the occlusion math, which showed up as the whole scene going black with SSAO enabled. Root cause: the renderer leaves
GL_BLENDenabled globally, the SSAO targets are single-channelGL_R16F(no alpha), and the shader's undefined alpha meant every write blended away to the framebuffer's zeroed initial contents instead of landing.Ssao::process()now disables blending for the pass, the same way the depth prepass already does for its own MRT writes.Test plan
pre-commit run --all-filespasses (clang-format, cpplint, shellcheck, etc.).