Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration β€’ In general, with a...

1

Transcript of Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration β€’ In general, with a...

Page 1: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration β€’ In general, with a single sample (primary estimator) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

Russian Roulette and Splitting

Page 12: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration β€’ In general, with a single sample (primary estimator) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

Importance Sampling the BSDF

Page 19: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration β€’ In general, with a single sample (primary estimator) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

Next Event Estimation

Page 23: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration β€’ In general, with a single sample (primary estimator) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

Putting it all together

Page 38: Realistic Image Synthesis - Path Tracing...Solution: Monte Carlo integration β€’ In general, with a single sample (primary estimator) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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) Ξ© 𝑓𝑓π‘₯π‘₯π‘‘π‘‘β‰ˆπ‘₯π‘₯ 𝑓𝑓π‘₯π‘₯

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…