Presentation is loading. Please wait.

Presentation is loading. Please wait.

Importance Resampling for Global Illumination Justin Talbot, David Cline, and Parris Egbert Brigham Young University Provo, UT.

Similar presentations


Presentation on theme: "Importance Resampling for Global Illumination Justin Talbot, David Cline, and Parris Egbert Brigham Young University Provo, UT."— Presentation transcript:

1 Importance Resampling for Global Illumination Justin Talbot, David Cline, and Parris Egbert Brigham Young University Provo, UT

2 Terms Importance Sampling (IS) Variance reduction technique for Monte Carlo integrationVariance reduction technique for Monte Carlo integration Sampling Importance Resampling (SIR) Developed in statistical literatureDeveloped in statistical literature Two stage technique for generating samples from a difficult distributionTwo stage technique for generating samples from a difficult distribution Resampled Importance Sampling (RIS) Novel variance reduction technique for Monte Carlo integration using SIR to generate samplesNovel variance reduction technique for Monte Carlo integration using SIR to generate samples

3 Outline Related Work Related Work Importance Resampling Importance Resampling Resampled Importance Sampling Resampled Importance Sampling Selection of parameters Selection of parameters Results Results Conclusion Conclusion

4 Related Work – IS Multiple Importance Sampling [Veach and Guibas 1995] Multiple Importance Sampling [Veach and Guibas 1995] Weighted Importance Sampling [Bekaert et al. 2000] Weighted Importance Sampling [Bekaert et al. 2000] Combined Correlated and Importance Sampling [Szécsi 2004] Combined Correlated and Importance Sampling [Szécsi 2004]

5 Related Work - SIR Sampling Importance Resampling [Rubin 1987] Sampling Importance Resampling [Rubin 1987] Importance Resampling [Smith and Gelfand 1992] Importance Resampling [Smith and Gelfand 1992]

6 Related Work - Resampling Reducing Shadow Rays [Lafortune and Willems 1995] Reducing Shadow Rays [Lafortune and Willems 1995] Direct Lighting Calculations [Shirley et al. 1996] Direct Lighting Calculations [Shirley et al. 1996] Bidirectional Importance Sampling [Burke 2004, Burke et al. 2005] Bidirectional Importance Sampling [Burke 2004, Burke et al. 2005]

7 Importance Resampling Goal: generate samples from a distribution with pdf g, where Goal: generate samples from a distribution with pdf g, where g is not (necessarily) normalized.g is not (necessarily) normalized. g can only be evaluated.g can only be evaluated.

8 Importance Resampling First, First, Generate M “fake” samples, X 1 …X M, from a source distribution with pdf pGenerate M “fake” samples, X 1 …X M, from a source distribution with pdf p Second, Second, Weight samples, w(X i ) = g(X i )/p(X i )Weight samples, w(X i ) = g(X i )/p(X i ) Select a “real” sample Y with probability proportional to its weightSelect a “real” sample Y with probability proportional to its weight

9 Importance Resampling For M=1, the distribution of Y is p For M=1, the distribution of Y is p As M → ∞, the distribution of Y will approach g. As M → ∞, the distribution of Y will approach g. For any finite M>1, the distribution will be a blend of p and g. For any finite M>1, the distribution will be a blend of p and g.

10 Importance Resampling p = 2/ ∏ g = cos(θ) + sin 4 (6θ)

11 Importance Resampling Provides a way to generate samples from a “difficult” distribution. Provides a way to generate samples from a “difficult” distribution. Caveat: Distribution is an approximation for any finite M Caveat: Distribution is an approximation for any finite M

12 Resampled Importance Sampling Importance Resampling for Global Illumination? Importance Resampling for Global Illumination? Use Importance Resampling to generate samples for Monte Carlo integration Use Importance Resampling to generate samples for Monte Carlo integration Can generate samples from more difficult distributionsCan generate samples from more difficult distributions Sampling distribution can match function being integrated betterSampling distribution can match function being integrated better Lower variance (better importance sampling)Lower variance (better importance sampling)

13 Notation f – function to be integrated f – function to be integrated g – sampling density g – sampling density May be unnormalizedMay be unnormalized Can be evaluatedCan be evaluated p – source density p – source density Can easily be sampled using standard techniques (CDF inversion)Can easily be sampled using standard techniques (CDF inversion) M – number of fake samples per real sample M – number of fake samples per real sample N – number of real samples N – number of real samples

14 Resampled Importance Sampling Formulate as weighted IS Formulate as weighted IS To be unbiased, weight must account for: To be unbiased, weight must account for: g is unnormalized Y i are only approximately distributed

15 Resampled Importance Sampling Correct weight: Average of the weights computed in the resampling step Correct weight: Average of the weights computed in the resampling step This estimate is unbiased for any M>0! This estimate is unbiased for any M>0!

16 Resampled Importance Sampling When M=1, reduces to standard IS using p When M=1, reduces to standard IS using p As M → ∞, approaches standard IS using g (normalized) As M → ∞, approaches standard IS using g (normalized)

17 Variance Some intuition, see paper for the gory details Some intuition, see paper for the gory details Compared to importance sampling Compared to importance sampling Using g (instead of p) reduces variance The weighting term increases variance

18 Variance For a fixed N, RIS is at least as good as standard importance sampling. For a fixed N, RIS is at least as good as standard importance sampling. Assuming g is a better sampling density than p Assuming g is a better sampling density than p

19 Efficiency Efficiency - Variance reduction per time Efficiency - Variance reduction per time Increasing M means decreasing N and vice versa. Increasing M means decreasing N and vice versa. There is an efficiency optimal trade off between M and N There is an efficiency optimal trade off between M and N

20 Efficiency If efficiency optimal M > 1, then RIS is better If efficiency optimal M > 1, then RIS is better Generally occurs when: Generally occurs when: g is a lot better than p AND/OR Computing g and p is much cheaper than computing f

21 Example - Direct Lighting Direct Lighting: accounts for light arriving at a surface directly from a light source Direct Lighting: accounts for light arriving at a surface directly from a light source To use RIS, we must choose To use RIS, we must choose p – like standard importance samplingp – like standard importance sampling g M N

22 Example - Choosing g Remember, RIS is better when: Remember, RIS is better when: g is a lot better than pg is a lot better than pAND/OR Computing g and p is much cheaper than computing fComputing g and p is much cheaper than computing f So, we want a g that is very similar to f and cheap to compute So, we want a g that is very similar to f and cheap to compute An obvious(?) choice is: An obvious(?) choice is: g must be real-valued, so take luminance g must be real-valued, so take luminance

23 Example - Choosing M and N N=100, M=1 (Better shadows, color) N=1, M=450 (Better direct lighting) ↔

24 Robustly choosing M and N Finding the true optimal values of M and N can be difficult: Finding the true optimal values of M and N can be difficult: There are different optimal values of M and N for each pixelThere are different optimal values of M and N for each pixel Requires estimatingRequires estimating T X – Time to compute fake sample, T X – Time to compute fake sample, T Y – Time to compute real sample, T Y – Time to compute real sample, and variance and variance for each pixel. See paper for detailsSee paper for details

25 Robustly choosing M and N Instead, we approximate a single pair for the entire image using just T X and T Y : Instead, we approximate a single pair for the entire image using just T X and T Y : M’ = T Y /T xM’ = T Y /T x N’ = Remainder of timeN’ = Remainder of time Using M’ and N’ will result in no more than 2 times the variance of the true optimal values Using M’ and N’ will result in no more than 2 times the variance of the true optimal values For common scenes, the bound will be much smaller.For common scenes, the bound will be much smaller.

26 Results – Direct Lighting RIS using estimated optimal values: N’=64.8, M’=3.37 57% variance reduction (equal time)

27 Results – Direct Lighting N=100, M=1 N=64.8, M=3.37 (N*M≈218) N=1, M=450

28 Results II 34% variance reduction

29 Results 10-70% variance reduction 10-70% variance reduction Variance reduction is scene dependent Variance reduction is scene dependent Using approximate optimal values of M and N may be worse than standard importance sampling Using approximate optimal values of M and N may be worse than standard importance sampling

30 Concluding Thoughts Resampled Importance Sampling Resampled Importance Sampling New general unbiased variance reduction techniqueNew general unbiased variance reduction technique Demonstrated how to choose parameters robustlyDemonstrated how to choose parameters robustly Demonstrated successful variance reduction on some scenesDemonstrated successful variance reduction on some scenes

31 Concluding Thoughts RIS is better than IS when: RIS is better than IS when: g is much better than p g is much better than pAND/OR Computing g and p is much cheaper than computing f Computing g and p is much cheaper than computing f Intuition: RIS takes advantage of differences in variance or computation expense Intuition: RIS takes advantage of differences in variance or computation expense

32 Concluding Thoughts Future Work Future Work Application to other problems in rendering or other fieldsApplication to other problems in rendering or other fields Development of better choices of g and pDevelopment of better choices of g and p Combining RIS and Multiple Importance SamplingCombining RIS and Multiple Importance Sampling Stratifying RISStratifying RIS

33 Questions


Download ppt "Importance Resampling for Global Illumination Justin Talbot, David Cline, and Parris Egbert Brigham Young University Provo, UT."

Similar presentations


Ads by Google