Fix delta emitter sample weights in the direct integrator - #1863
Open
JurriaanD wants to merge 1 commit into
Open
Fix delta emitter sample weights in the direct integrator#1863JurriaanD wants to merge 1 commit into
JurriaanD wants to merge 1 commit into
Conversation
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.
Description
Fixes #1861
The direct illumination integrator computes the (MIS) weight of emitter samples as
Float mis = dr::select(ds.delta, Float(1.f), mis_weight( ds.pdf * m_frac_lum, bsdf_pdf * m_frac_bsdf) * m_weight_lum); result[active_e] += mis * bsdf_val * emitter_val;where
m_frac_lum = emitter_samples / (emitter_samples + bsdf_samples)m_frac_bsdf = bsdf_samples / (emitter_samples + bsdf_samples)m_weight_lum = 1 / emitter_samplesThe weight of delta emitters is simply set to 1 so we are adding
1 * bsdf * Lito the output for each sample. The more samples you take the brighter the output will be.My fix consists of moving the multiplication by
m_weight_lumdown one line so that it is also applied for delta emitter samples.This bug is only present in the direct illumination integrator as far as I can tell.
Testing
I added a test that constructs a scene with
The scene is rendered with the direct integrator with
emitter_samples=1andemitter_samples=10. The test asserts that the color of the center pixel is the same in both renders.Checklist
cuda_*andllvm_*variants. If you can't test this, please leave below