Realistic Image Synthesis SS2018 – MIS and Path Tracing
Realistic Image Synthesis
- MIS and Path Tracing -
Realistic Image Synthesis - MIS and Path Tracing - Philipp - - PowerPoint PPT Presentation
Realistic Image Synthesis - MIS and Path Tracing - Philipp Slusallek Karol Myszkowski Gurprit Singh Realistic Image Synthesis SS2018 MIS and Path Tracing MULTIPLE IMPORTANCE SAMPLING (MIS) Realistic Image Synthesis SS2018 MIS and Path
Realistic Image Synthesis SS2018 – MIS and Path Tracing
Realistic Image Synthesis SS2018 – MIS and Path Tracing
Realistic Image Synthesis SS2018 – MIS and Path Tracing
– Sampling directions – Sampling the surface p(y|)= cosx/ p(y)= cosy/rxy
2
x x y y x
Realistic Image Synthesis SS2018 – MIS and Path Tracing
– Combining multiple importance distributions
– Weight two or more estimators – Weights are determined analytically
– Approach with two estimators and weights 𝜕𝑗 (σ 𝜕𝑗 = 1) – Weight inversely proportional to variance (similar for more estimators)
= =
M m N i i m i m m
m
1 1
Realistic Image Synthesis SS2018 – MIS and Path Tracing
– Choose samples first – Assign weights according to probabilities/variance of each estimator
– No other combination can be much better [Veach '97] – Motivation
1 𝑞𝑗
– Must be able to evaluate probability of sample according to other probabilities densities
j i i
j j i i i
Realistic Image Synthesis SS2018 – MIS and Path Tracing
– Variance is additive – may have impact on already good estimators – Try to sharpen the weighting, avoid contribution with low probability
– Reduced weight for samples with low probability
– Adaptively partitions the integration domain according to pi(x) – But typically too many samples are thrown away to be effective
=
maximum is if 1
i i
p w
=
| if
max max k k k i i i
p p p p p p w
=
k k i i
p p w
Realistic Image Synthesis SS2018 – MIS and Path Tracing
– Two orthogonal surfaces, one is a light source
– Most samples near light will have very shallow angle, cos near zero
– Most samples far from light will not hit the light source
Realistic Image Synthesis SS2018 – MIS and Path Tracing
– Small contribution for large light sources and highly specular surfaces
– No contribution if light source is not hit (highly diffuse, small LS)
– Combined advantages of both methods – Principle: High weight, for high probability – Here: Power heuristics
Realistic Image Synthesis SS2018 – MIS and Path Tracing
– Image of a light source on surfaces with different roughness
more diffuse more specular
Realistic Image Synthesis SS2018 – MIS and Path Tracing
Realistic Image Synthesis SS2018 – MIS and Path Tracing
– Short form – leaving out arguments – To be applied to the entire domain, all possible 𝑦, 𝜕 ∈ 𝑇 × Ω+
Ω+ 𝑔 𝑠𝑀 𝑧 𝑦, 𝜕𝑗 , −𝜕𝑗 𝑑𝑝𝑡𝜄𝑗𝑒𝜕𝑗
with ray tracing op. 𝑧 𝑦, 𝜕𝑗
with 𝑼𝑌 = 𝑼𝑌 𝑦, 𝜕 =
Ω+ 𝑔 𝑠𝑌 𝑧 𝑦, 𝜕𝑗 , −𝜕𝑗 𝑑𝑝𝑡𝜄𝑗𝑒𝜕𝑗
(formally derived "solution")
– Definition:
– Cannot be done in closed form (except for trivial solutions)
– Can be approximated by mapping to finite dimensional space
Realistic Image Synthesis SS2018 – MIS and Path Tracing
– 𝑀 = 𝑀𝑓 +
Ω+ 𝑔 𝑠𝑀 𝑧 𝑦, 𝜕𝑗 , −𝜕𝑗 𝑑𝑝𝑡𝜄𝑗𝑒𝜕𝑗
– 𝑀 = 𝑀𝑓+ 𝑼𝑀 = 𝑀𝑓 + 𝑼(𝑀𝑓+ 𝑼𝑀) = 𝑀𝑓+ 𝑼𝑀𝑓+ 𝑼𝑼𝑀𝑓 + ⋯ – 𝑀 = σ𝑗=0
∞ 𝑼𝑗 𝑀𝑓
with 𝑼 < 1 (energy conservation (at most))
– 𝑗 = 0: Direct emission from light sources – 𝑗 = 1: Light reflected once – 𝑗 = 𝑜: Light reflected n times
– Select points and directions and shoot ray – At hit point:
Realistic Image Synthesis SS2018 – MIS and Path Tracing
– Abort sequence with a certain probability 𝛽 – Need to correct for the missed contribution – In rendering, often choose (1 – alpha) to be:
– Conclusion
] [ ) 1 ( ) 1 ( ] [ else ) 1 ( ) (
n n n n n
F E F E F E x F F = − − + = − =
Realistic Image Synthesis SS2018 – MIS and Path Tracing
– Effects of Russian Roulette – 5000 rays per pixel; perfect reflection, with highly occluded areas
1. Fixed max. depth for rays (bias depends on max. depth and scene)
hitting a light source. Need very high max. depth, which is costly
2. RR with fixed kill probability
3. RR with kill probability proportional to importance (throughput) of ray
4. “Efficiency-optimized RR” [Veach PhD thesis, Chapter10]
– Strategy (3) slightly less efficient than (4), but easier to implement
Realistic Image Synthesis SS2018 – MIS and Path Tracing
– http://www.cs.utah.edu/~thiago/cs7650/hw12/
input 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
Realistic Image Synthesis SS2018 – MIS and Path Tracing
– Provides radiance [Watt per area and solid angle]
– Energy falling on a pixel, patch irradiance, …
– Choose initial samples according to Measurement Equation
– With sensor's sensitivity function M(...) – Measuring pixel values (energy on the film of a camera) – Measuring flux/power on a surface patch
i i
shutter pixel aperture lens
i i
+
area patch
Realistic Image Synthesis SS2018 – MIS and Path Tracing
– Gathering approach
– Measuring device collects photons – Here: Sampling with many ray paths
– Sample over lens aperture and according to optical properties
– Sample over opening time, consider moving camera and objects
– Sample glossy parts of the BRDF
– Sample light sources
Realistic Image Synthesis SS2018 – MIS and Path Tracing
Realistic Image Synthesis SS2018 – MIS and Path Tracing
– Unique mapping of point on image plane to points on focal plane – Determined with straight ray through center of the lens
– Choose point 𝑄𝑐 on image plane and 𝑄𝑚 on lens – Compute point 𝑄
𝑔 by shooting ray through the lens center
– Sample scene with ray from 𝑄𝑚 through 𝑄
𝑔
Lens Image plane Focal plane
𝑄
𝑐
𝑄𝑚 𝑄
𝑔
Realistic Image Synthesis SS2018 – MIS and Path Tracing
Realistic Image Synthesis SS2018 – MIS and Path Tracing
– Shutter opening time (𝑢0 ≤ 𝑢 ≤ 𝑢1) – Assumes instantaneous opening and closing
time instance
– Assign ray a time 𝑢 between 𝑢0 and 𝑢1 – Transform objects in the scene to the positions at 𝑢
– Compute intersection with object
Realistic Image Synthesis SS2018 – MIS and Path Tracing
Realistic Image Synthesis SS2018 – MIS and Path Tracing
– Monte Carlo Integration
– Only point-wise evaluation
– No use of importance sampling or filtering (yet)
– Combinatoric explosion of additional rays with depth – Deeper rays contribute less – Maximum damage:
Realistic Image Synthesis SS2018 – MIS and Path Tracing
– Randomly decide to absorb (Russian Roulette) – Randomly decide which reflection term to sample (e.g. diffuse, glossy) – Randomly sample this term recursively
– Very low probability to hit the light source
– At every hit point: Try to gather some energy from light sources
Realistic Image Synthesis SS2018 – MIS and Path Tracing
(figure by Kajiya)
Realistic Image Synthesis SS2018 – MIS and Path Tracing
– Split scene into separate strata
– Light sources: Directed sampling on light's surfaces
– Non light sources: Directional sampling
– What happens if a directional sample hits a light source ????
Realistic Image Synthesis SS2018 – MIS and Path Tracing
– Split scene into separate strata
– Light sources: Directed sampling on light's surfaces
– Non light sources: Directional sampling
– What happens if a directional sample hits a light source ???? – IT MUST NOT BE COUNTED !!!!
Realistic Image Synthesis SS2018 – MIS and Path Tracing
– Start at the measuring device – Propagate path according to measurement function and BRDFs – Measure
– (Only at end of path) – At every hit point
– Start at the lights, choose power per sample – Propagate light according to emission functions and BRDFs – Measure
– (Only at end of path when photon would be “absorbed“) – At every hit point