feat(rtx): add maxSampledLights to Interactive renderer#340
Merged
jeffamstutz merged 1 commit intoJul 15, 2026
Merged
Conversation
Interactive summed direct lighting over ALL light instances per hit (one shadow ray each), so many-light scenes were O(N) and slow. Add a maxSampledLights renderer param (uint, default 8, <=0 = all): when the scene has more light instances than the cap, importance-sample that many via the world Pick-Power CDF and reweight by 1/(K*pPick) instead of looping all of them. E[stochastic] == the all-lights sum, so the accumulated image converges; small scenes keep the exact deterministic loop. HDRI MIS is unchanged (escape side stays deterministic, so pLight=envPdf with the reweight is MIS-consistent). Uniform-pick fallback when total Pick Power is zero.
jeffamstutz
approved these changes
Jul 15, 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.
Interactive summed direct lighting over ALL light instances per hit (one shadow ray each), so many-light scenes were O(N) and slow.
Add a
maxSampledLightsrenderer param (int, default 8, <=0 => all): when the scene has more light instances than the cap, importance-sample that many via the world Pick-Power CDF instead of looping all of them.This gives back performances and predictability on low lights count scenes -- more common sci-viz case -- while preserving correctness on many lights scenes, still at the expense of more convergences frames.