realistic image synthesis - path tracing...solution: monte carlo integration โข in general, with a...
TRANSCRIPT
![Page 1: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/1.jpg)
Realistic Image Synthesis
- Path Tracing -
Pascal Grittmann
Philipp SlusallekKarol Myszkowski
Gurprit Singh
![Page 2: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/2.jpg)
What are we computing? โ The physical phenomenon
ยฉ Giuseppe Milo (CC-BY)
![Page 3: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/3.jpg)
What are we computing? โ The mathematical formulationGiven:A point visible to the camera
Compute:Incident light from all directions, reflected to the camera
![Page 4: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/4.jpg)
What are we computing? โ The mathematical formulationGiven:A point visible to the cameraprevious point
Compute:Incident light from all directions, reflected to the camera previous point
Recursive problem!
![Page 5: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/5.jpg)
Reminder: Rendering Equation
๐ฟ๐ฟ๐๐ ๐ฅ๐ฅ,๐๐๐๐ = ๐ฟ๐ฟ๐๐ ๐ฅ๐ฅ,๐๐๐๐ + ๏ฟฝฮฉ๐๐ ๐ฅ๐ฅ,๐๐๐๐,๐๐๐๐ ๐ฟ๐ฟ๐๐ ๐ฅ๐ฅ,๐๐๐๐ cos ๐๐๐๐ ๐๐๐๐๐๐
Outgoing radiance from ๐ฅ๐ฅ in direction ๐๐๐๐
Emitted radiance from ๐ฅ๐ฅ in direction ๐๐๐๐
Bidirectional scattering distribution function โ BSDF (how much light is reflected
from ๐๐๐๐ towards ๐๐๐๐? )
Incident radiance at ๐ฅ๐ฅfrom direction ๐๐๐๐
The mysterious cosine term
Integral over sphere of all directions
![Page 6: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/6.jpg)
Why the cosine term?
โข Definition of radiance: โข โflux per unit solid angle per unit
projected areaโ
โข We are interested in:โข โflux per unit solid angle per unit
projected areaโ
cos ๐๐๐๐
๐๐๐๐๐๐๐๐
๐๐๐๐
๐๐
๐ฅ๐ฅ
โ๐๐๐๐
๐ฅ๐ฅ
โ๐๐๐๐
![Page 7: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/7.jpg)
Challenges
โข Recursive high dimensional โข Discontinuities (object and shadow boundaries)
![Page 8: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/8.jpg)
Solution: Monte Carlo integration
โข In general, with a single sample (primary estimator)
๏ฟฝฮฉ๐๐ ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ โ
๐๐ ๐ฅ๐ฅ๐๐ ๐ฅ๐ฅ
โข Applied to rendering:
๐ฟ๐ฟ๐๐ ๐ฅ๐ฅ1,๐๐๐๐ โ ๐ฟ๐ฟ๐๐ ๐ฅ๐ฅ1,๐๐๐๐ +๐๐ ๐ฅ๐ฅ1,๐๐๐๐,๐๐๐๐ cos ๐๐๐๐
๐๐ ๐๐๐๐๐ฟ๐ฟ๐๐ ๐ฅ๐ฅ2,โ๐๐๐๐
Estimated recursively! High (infinite) dimensionality
๐ฅ๐ฅ1
๐ฅ๐ฅ2
![Page 9: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/9.jpg)
How to sample ๐๐๐๐?
โข Ideally proportionally to the full integrandโข ๐๐ ๐๐๐๐ โ ๐๐ ๐ฅ๐ฅ,๐๐๐๐,๐๐๐๐ ๐ฟ๐ฟ๐๐ ๐ฅ๐ฅ,๐๐๐๐ cos ๐๐๐๐
โข Usually not possible Limit to one or more factorsโข Simplest method: cosine
โข ๐๐ ๐๐๐๐ โ cos ๐๐๐๐โข Often also possible (approximately, at least): BSDF times cosine
โข ๐๐ ๐๐๐๐ โ ๐๐ ๐ฅ๐ฅ,๐๐๐๐,๐๐๐๐ cos ๐๐๐๐
![Page 10: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/10.jpg)
When to terminate?
โข In reality, all surfaces reflect lightโข We cannot track infinitely long paths, need to terminate recursion at
some pointโข Options:
โข Maximum path length (biased)โข Russian roulette (unbiased, later)
![Page 11: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/11.jpg)
Russian Roulette and Splitting
![Page 12: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/12.jpg)
Russian roulette
โข Randomly terminate the path with some probability ๐๐โข Unbiasedโข Increases variance (i.e., noise in the image)
โข Given an estimator ๐น๐น, replace by ๐น๐น๐ ๐ ๐ ๐ :
with probability ๐๐
with probability (1 โ ๐๐)๐น๐น๐ ๐ ๐ ๐ = ๏ฟฝ
1๐๐๐น๐น
0
![Page 13: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/13.jpg)
What criterion to use?
โข Fixed probabilityโข Current path throughputโข Efficiency-optimized RR (Veach 97):
โข Based on statistics of surrounding pixels
โข โAdjoint driven Russian roulette and splittingโ Vorba et al 201โข Based on statistics from a pre-pass, combined with splitting
![Page 14: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/14.jpg)
Russian roulette experimentsinput scene path depth < 11 path depth < 101
RR with p=0.3 efficiency optimized p = throughput / 0.01
32.6min
53.2min
28.8min
10.6min
Thiago Ize (University of Utah, currently Solid Angle)http://www.cs.utah.edu/~thiago/cs7650/hw12/
![Page 15: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/15.jpg)
Splitting
โข Use more samples for the next recursion than the current oneโข Often done at the first point (the one visible to the camera)โข Trade off: anti-aliasing vs variance
No splitting Splitting
![Page 16: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/16.jpg)
Example: Direct illumination
Sampling projected solid angle4 eye rays per pixel100 shadow rays
Sampling light source area4 eye rays per pixel100 shadow rays
![Page 17: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/17.jpg)
Example: Splitting for direct illumination
Stratified random sample locations4 eye rays per pixel
16 shadow ray
Stratified random sample locations64 eye rays per pixel
1 shadow ray
![Page 18: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/18.jpg)
Importance Sampling the BSDF
![Page 19: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/19.jpg)
Simplest method: cosine hemisphere samplingโข PDF proportional to the cosine:
โข ๐๐ ๐๐๐๐ = cos ๐๐๐๐๐๐
โข Ideal for diffuse surfaces
โข Given two uniform samples ๐ข๐ข1,๐ข๐ข2:โข ๐๐๐๐ = 2๐๐๐ข๐ข1โข ๐๐๐๐ = cosโ1 ๐ข๐ข2โข (Derivation in Assignment 3)
ยฉ William Sherif
![Page 20: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/20.jpg)
Example: Phong BRDF
โข Simple glossy BRDFโข Multiplies by a cosine lobe around the perfect reflection
๐๐ ๐ฅ๐ฅ,๐๐๐๐,๐๐๐๐ =๐๐ + 22๐๐
cos๐๐ ๐ผ๐ผ๐๐
โข ๐ผ๐ผ๐๐ is the angle formed by ๐๐๐๐ and ๐๐๐๐โข ๐๐๐๐ is the prefect reflection of ๐๐๐๐ ๐ผ๐ผ๐๐
ฮธโ๐๐๐๐
๐๐๐๐
๐๐๐๐๐๐
![Page 21: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/21.jpg)
Sampling the cosine lobe
โข Step 1: sample the cosine lobe about ๐ง๐ง axis โข ๐๐ ๐๐โฒ = cos๐๐ ๐๐โฒ ๐๐+1
2๐๐
โข Step 2: compute ๐๐๐๐โข Reflect ๐๐๐๐ about ๐๐
โข Step 3: transform ๐๐โฒ to coordinate system where ๐๐๐๐ is the ๐ง๐ง axisโข Matrix multiplication
๐ผ๐ผ๐๐ฮธ
โ๐๐๐๐๐๐๐๐
๐๐๐๐๐๐
๐ง๐ง
๐๐โฒ
![Page 22: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/22.jpg)
Next Event Estimation
![Page 23: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/23.jpg)
Reduce variance by connecting to points on the light source
Sampling ๐๐๐๐ from the hemisphere
Sampling ๐๐๐๐ as a direction to a point on the light
![Page 24: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/24.jpg)
But it is a point, not a directionโฆ
โข We sample a direction ๐๐๐๐ by sampling a point ๐ฆ๐ฆ on the lightโข With some pdf ๐๐ ๐ฆ๐ฆ defined on the surface area of the lightโข But our integral is over the (hemi-) sphereโข We need to perform a change of variables
![Page 25: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/25.jpg)
From surface area to hemisphere
โข Projected unit surface area at the light sourceโข cos ๐๐๐ฆ๐ฆ
โข Compute surface area on unit hemisphereโข Similar triangles 1
๐๐
โข 2D 1๐๐2
โข We must also account for the visibility!โข ๐๐ ๐ฅ๐ฅ,๐ฆ๐ฆ
โข Result: cos ๐๐๐ฆ๐ฆ๐๐2
๐๐ ๐ฅ๐ฅ,๐ฆ๐ฆ
๐ฆ๐ฆ
๐ฅ๐ฅ
๐๐
๐๐๐๐๐๐
![Page 26: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/26.jpg)
How to select the light source
โข Total powerโข Uniformly โข Estimated unoccluded contributionโข Estimated occluded contribution (prepass)โข Clustering to support many lights
![Page 27: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/27.jpg)
What if a BSDF sample hits the light
โข Cannot count both: would yield twice the actual value!โข Could average both and divide by two high varianceโข Or: use MIS
![Page 28: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/28.jpg)
Multiple Importance Sampling (MIS)Veach & Guibas 1995
![Page 29: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/29.jpg)
Combining multiple sampling techniques
โข Sampling the BSDF
โข Sampling the light surfacep(y)= cosฮธy/rxy
2
x
y
p(ฯ)= cosฮธx/ฯ
x
y
ฮธx
![Page 30: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/30.jpg)
Both techniques perform well for different effects
Light surface BSDF MIS
Light surface BSDF MIS
![Page 31: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/31.jpg)
How to combine them?
โข Form an affine combination of the estimators:
๏ฟฝ๐ก๐กโ๐๐
๏ฟฝ๐๐
๐๐๐ก๐ก
๐ค๐ค๐ก๐ก ๐ฅ๐ฅ๐ก๐ก,๐๐๐๐ ๐ฅ๐ฅ๐ก๐ก,๐๐
๐๐๐ก๐ก ๐๐๐ก๐ก ๐ฅ๐ฅ๐ก๐ก,๐๐
โข Theoretically, any weighting functions ๐ค๐ค๐ก๐ก ๐ฅ๐ฅ work, provided:โข ๐ค๐ค๐ก๐ก ๐ฅ๐ฅ = 0 if ๐๐๐ก๐ก ๐ฅ๐ฅ = 0โข โ๐ก๐ก ๐ค๐ค๐ก๐ก ๐ฅ๐ฅ = 1 โ๐ฅ๐ฅ
![Page 32: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/32.jpg)
First, all densities need to be in the same measureโข ๐๐ ๐๐ = cos ๐๐
๐๐has unit ๐ ๐ ๐๐โ1 (density on the hemisphere)
โข ๐๐ ๐ฆ๐ฆ has unit ๐๐โ2 (density on surface area)
โข Applying the same logic as before, we can transform them:
โข ๐๐ ๐ฆ๐ฆ|๐๐ = cos ๐๐๐๐
cos ๐๐๐ฆ๐ฆ๐๐2
![Page 33: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/33.jpg)
Balance heuristic
โข Provably good choice: minimizes upper bound of the variance
๐ค๐ค๐ก๐ก ๐ฅ๐ฅ =๐๐๐ก๐ก๐๐๐ก๐ก ๐ฅ๐ฅ
โ๐๐ ๐๐๐๐๐๐๐๐ ๐ฅ๐ฅ
![Page 34: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/34.jpg)
Power, maximum, and cuttoff heuristics
โข Can sometimes perform better for low-variance techniquesโข Amplify the weights to remove residual noise from โbadโ techniques
โข Maximum: only consider technique with largest ๐๐๐ก๐ก๐๐๐ก๐ก ๐ฅ๐ฅโข Cutoff: Balance, but set ๐๐๐ก๐ก๐๐๐ก๐ก ๐ฅ๐ฅ to zero if below some threshold
โข Power heuristic: ๐ค๐ค๐ก๐ก ๐ฅ๐ฅ = ๐๐๐ก๐ก๐๐๐ก๐ก ๐ฅ๐ฅ2
โ๐๐ ๐๐๐๐๐๐๐๐ ๐ฅ๐ฅ 2
![Page 35: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/35.jpg)
Comparison โ Image of a light source on surfaces with different roughness
more diffusemore specular
![Page 36: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/36.jpg)
Optimal weights
โข It is possible to derive the optimal set of functions ๐ค๐ค๐ก๐ก ๐ฅ๐ฅโข Result: linear system involving many integralsโข Kondapaneni et al 2019โข (Our recent SIGGRAPH paper)
![Page 37: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/37.jpg)
Putting it all together
![Page 38: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/38.jpg)
A less basic path tracer
โข Given a point visible to the cameraโข (1) Compute direct illumination
โข Select light source and point on the lightโข Trace a shadow ray for ๐๐ ๐ฅ๐ฅ,๐ฆ๐ฆโข Sample BSDF and check if a light was intersectedโข Compute MIS weights and add estimate
![Page 39: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/39.jpg)
A less basic path tracer
โข Given a point visible to the cameraโข (1) Compute direct illumination
โข Select light source and point on the lightโข Trace a shadow ray for ๐๐ ๐ฅ๐ฅ,๐ฆ๐ฆโข Sample BSDF and check if a light was intersectedโข Compute MIS weights and add estimate
โข (2) Terminate with Russian roulette
![Page 40: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/40.jpg)
A less basic path tracer
โข Given a point visible to the cameraโข (1) Compute direct illumination
โข Select light source and point on the lightโข Trace a shadow ray for ๐๐ ๐ฅ๐ฅ,๐ฆ๐ฆโข Sample BSDF and check if a light was intersectedโข Compute MIS weights and add estimate
โข (2) Terminate with Russian rouletteโข (3) Continue the path
โข Could sample a new direction from the BSDF, or re-use the one from (1)
โข Go back to (1), repeat until RR terminates
![Page 41: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration โข In general, with a single sample (primary estimator) ฮฉ ๐๐๐ฅ๐ฅ๐๐โ๐ฅ๐ฅ ๐๐๐ฅ๐ฅ](https://reader035.vdocuments.us/reader035/viewer/2022071108/5fe32f9019bad715a62abe31/html5/thumbnails/41.jpg)
Many improvements possible
โข Splitting (e.g., at first intersection)โข Combine multiple light sampling strategies (via MIS)โข Store statistics to approximate ๐ฟ๐ฟ๐๐ for importance sampling (โguidingโ,
later)โข And so onโฆ