Improve hdri sampling - #363
Merged
Merged
Conversation
Replace Shade with EvalBsdf so materials return only their reflection response, including the incoming-angle factor. Let Quality and Interactive handle light brightness, sampling probabilities, and combination weights.
Include the HDRI map's estimated average brightness in Light Pick power, using the existing sampling-table normalization. Give black maps zero power. Allocate samples according to map brightness as well as light settings, targeting lower noise without changing expected image brightness. Test brightness, intensity scale, scene radius, and black maps.
Add an environment sample favoring directions near the surface normal whenever an HDRI exists, even when Light Pick selects another light. Combine it with brightness-based sampling and reflected rays reaching the environment without double-counting illumination. This adds sampling work to reduce noise on matte surfaces and under broad skies.
Reflect samples from behind the surface onto its outward-facing side and read the environment at the new direction. Keep hidden HDRIs illuminating surfaces without appearing as camera backgrounds. Guard zero-probability contributions against invalid division.
Port Quality's sample folding, surface-oriented environment sampling, and exact sampling probabilities to Interactive. Combine these with reflected rays without double-counting illumination. Share the folding helper while preserving Interactive's all-lights or reweighted-subset sampling, rather than Quality's single-light selection. Include hidden HDRIs in reflected illumination. Correct overly bright coarse maps and invalid results with hidden environments, while targeting lower noise under broad skies.
jeffamstutz
approved these changes
Sep 16, 2026
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.
Helps getting better value from each HDRI sample at low sample counts.
Below is rendering 1spp, this PR vs current next_release branch of VisRTX
