Presentation is loading. Please wait.

Presentation is loading. Please wait.

Ray Tracing via Markov Chain Monte-Carlo Method

Similar presentations


Presentation on theme: "Ray Tracing via Markov Chain Monte-Carlo Method"β€” Presentation transcript:

1 Ray Tracing via Markov Chain Monte-Carlo Method
Toshiya Hachisuka, Anton S. Kaplanyan, Carsten Dachsbacher, Multiplexed Metropolis Light Transport, SIGGRAPH 2014. Toshiya Hachisuka, Henrik Wann Jensen, Robust Adaptive Photon Tracing Using Photon Path Visibility, ACM TOG 2011. Jungpyo Hong

2 Contents Basic Backgrounds
Metropolis-Hastings Method Metropolis Light Transport (MLT) Primary Sample Space (PSS) Multiplexed Metropolis Light Transport (MMLT) Multiple Importance Sampling Multiplexed Primary Sample Space Robust Adaptive Photon Tracing Problem Specification Replica Exchange Monte-Carlo

3 Metropolis-Hastings (MH) Method
A kind of Markov Chain Monte-Carlo (MCMC) method A sampling method from a unknown probability distribution P π‘₯ You can compute a value of function 𝑓 π‘₯ , while P π‘₯ ∝ 𝑓 π‘₯ So it is difficult to calculate the normalize constant βˆ«π‘“ π‘₯ 𝑑π‘₯ Arbitrary jumping distribution π‘ž π‘₯ π‘₯ β€² is needed

4 Metropolis-Hastings (MH) Method
Algorithm From current state π‘₯ 𝑑 , pick a target state 𝑧 𝑧~π‘ž 𝑧 π‘₯ 𝑑 , π‘₯ 0 is an arbitrary point Calculate 𝑓 π‘₯ 𝑑 , 𝑓 𝑧 ,π‘ž π‘₯ 𝑑 𝑧 , π‘ž 𝑧 π‘₯ 𝑑 Calculate an acceptance probability π‘Ž π‘₯ 𝑑 ,𝑧 = min 𝑓 𝑧 π‘ž π‘₯ 𝑑 𝑧 𝑓 π‘₯ 𝑑 π‘ž 𝑧 π‘₯ 𝑑 ,1 Accepted: π‘₯ 𝑑+1 =𝑧 Rejected: π‘₯ 𝑑+1 = π‘₯ 𝑑 𝑓 π‘₯ π‘₯ 𝑑 π‘ž 𝑧 π‘₯

5 Metropolis-Hastings (MH) Method
Algorithm From current state π‘₯ 𝑑 , pick a target state 𝑧 𝑧~π‘ž 𝑧 π‘₯ 𝑑 , π‘₯ 0 is an arbitrary point Calculate 𝑓 π‘₯ 𝑑 , 𝑓 𝑧 ,π‘ž π‘₯ 𝑑 𝑧 , π‘ž 𝑧 π‘₯ 𝑑 Calculate an acceptance probability π‘Ž π‘₯ 𝑑 ,𝑧 = min 𝑓 𝑧 π‘ž π‘₯ 𝑑 𝑧 𝑓 π‘₯ 𝑑 π‘ž 𝑧 π‘₯ 𝑑 ,1 Accepted: π‘₯ 𝑑+1 =𝑧 Rejected: π‘₯ 𝑑+1 = π‘₯ 𝑑 𝑓 π‘₯ π‘₯ 𝑑 π‘Ž π‘₯ 𝑑 ,𝑧 = min 𝑓 𝑧 π‘ž π‘₯ 𝑑 𝑧 𝑓 π‘₯ 𝑑 π‘ž 𝑧 π‘₯ 𝑑 ,1 𝑧 π‘₯

6 Metropolis-Hastings (MH) Method
Algorithm From current state π‘₯ 𝑑 , pick a target state 𝑧 𝑧~π‘ž 𝑧 π‘₯ 𝑑 , π‘₯ 0 is an arbitrary point Calculate 𝑓 π‘₯ 𝑑 , 𝑓 𝑧 ,π‘ž π‘₯ 𝑑 𝑧 , π‘ž 𝑧 π‘₯ 𝑑 Calculate an acceptance probability π‘Ž π‘₯ 𝑑 ,𝑧 = min 𝑓 𝑧 π‘ž π‘₯ 𝑑 𝑧 𝑓 π‘₯ 𝑑 π‘ž 𝑧 π‘₯ 𝑑 ,1 Accepted: π‘₯ 𝑑+1 =𝑧 Rejected: π‘₯ 𝑑+1 = π‘₯ 𝑑 𝑓 π‘₯ π‘₯ 𝑑 π‘₯ 𝑑+1 After a sufficient steps, π‘₯ 𝑑 will follows 𝑃 π‘₯ βˆπ‘“ π‘₯ π‘₯ 𝑑+10 π‘₯

7 Metropolis Light Transport (MLT)
Use MH to sample paths while rendering! Idea Pick paths which contributes more (radiance) on the image very important not such important

8 Metropolis Light Transport (MLT)
Algorithm From a current path π‘₯ 𝑑 , pick a target path 𝑧 𝑧 is mutated path from π‘₯ 𝑑 Calculate the acceptance probability π‘Ž π‘₯ 𝑑 ,𝑧 = min 𝑓 𝑧 π‘ž π‘₯ 𝑑 𝑧 𝑓 π‘₯ 𝑑 π‘ž 𝑧 π‘₯ 𝑑 ,1 𝑓 π‘₯ is an radiance of path π‘₯ π‘₯ 𝑑+1 =𝑧 if accepted, π‘₯ 𝑑+1 = π‘₯ 𝑑 if rejected Problem: how to mutate paths (well)? π‘ž is often symmetric so that π‘ž π‘₯ 𝑑 𝑧 =π‘ž 𝑧 π‘₯ 𝑑 (Metropolis method) π‘₯ 𝑑 𝑧

9 Primary Sample Space (PSS)
MLT has a hard time to cover all possible mutations Idea Mutate the paths in another transformed spaces!

10 Primary Sample Space (PSS)
Veach, Eric, and Leonidas J. Guibas. "Metropolis light transport."Β Proceedings of the 24th annual conference on Computer graphics and interactive techniques, 1997. MLT has a hard time to cover all possible mutations Idea Mutate the paths in another transformed spaces!

11 Primary Sample Space (PSS)
Primary sample spaces are defined as a hypercube 𝑒= 𝑒 1 , …, 𝑒 𝑂 π‘˜ where π‘˜ is a length of path π‘₯ 𝑒 𝑖 ∈ 0, 1 𝑒 𝑖 are the parameters which select the shape of path π‘₯ Two MCMC papers today uses PSS

12 Multiplexed Metropolis Light Transport
Toshiya Hachisuka, Anton S. Kaplanyan, Carsten Dachsbacher ACM TOG (SIGGRAPH 2014), 2014.

13 Multiple Importance Sampling (MIS)
Weighted sum of many importance samplings

14 Multiple Importance Sampling (MIS)
(Ordinary) importance sampling For known PDF 𝑃 π‘₯ , sample 𝑁 times: π‘₯ 1 … π‘₯ 𝑁 βˆ«π‘“ π‘₯ 𝑑π‘₯β‰ˆ 1 𝑁 𝑓 π‘₯ 𝑖 𝑃 π‘₯ 𝑖 Works better if π‘ƒβ‰ˆπ‘“ Multiple importance sampling For 𝐾 known PDF 𝑃 π‘˜ π‘₯ ​ π‘˜=1..𝐾 , sample 𝑁 π‘˜ times each: π‘₯ 1 … π‘₯ 𝑁 π‘˜ βˆ«π‘“ π‘₯ 𝑑π‘₯β‰ˆ 𝑑=1 𝐾 1 𝑁 𝑑 𝑖=1 𝑁 πœ” π‘˜ π‘₯ π‘˜,𝑖 𝑓 π‘₯ π‘˜,𝑖 𝑃 π‘˜ π‘₯ π‘˜,𝑖 πœ” π‘˜ is a MIS weight function such that π‘˜=1 𝐾 πœ” π‘˜ π‘₯ =1

15 Multiple Importance Sampling (MIS)
By using MIS, we can use different PDFs according to the situation VEACH, E., AND GUIBAS, L. J Optimally combining sampling techniques for Monte Carlo rendering. In SIGGRAPH ’95, 419–428.

16 Arbitrary distribution
Pros and Cons Multiple Importance Sampling + : Can use various techniques according to the situation β€’ : We need to know sampling PDFs exactly So β€˜Sampling from radiance’ is impossible Metropolis Light Transport + : Can sample from unknown function value (like radiance distribution) β€’ : Path tracing (or other single technique) only Multiple techniques Arbitrary distribution MC via MIS Yes No MLT ?

17 Expanding Primary Sample Space
Transform

18 Expanding Primary Sample Space
Multiplexed Primary Sample Space technique 1 Transform technique 2 technique 3

19 Expanding Primary Sample Space
Multiplexed Primary Sample Space technique 1 Transform technique 2 technique 3

20 Expanding Primary Sample Space
Multiplexed Primary Sample Space technique 1 Transform technique 2 technique 3 (Ordinary) path mutation

21 Expanding Primary Sample Space
Multiplexed Primary Sample Space technique 1 Transform technique 2 technique 3 Inter-technique mutation

22 Multiplexed MLT (MMLT)
Multiplexed Metropolis Light Transport Set type of technique as a MC state, too! technique 1 Ordinary MLT π‘Ž 𝑒 𝑑 ,𝑧 = min 𝑓 𝑧 𝑓 𝑒 𝑑 ,1 By adapting MIS, π‘Ž ( 𝑒 𝑑 ,π‘˜), 𝑧, π‘˜ β€² = min πœ” π‘˜ β€² 𝑧 𝑓(𝑧) 𝑃 π‘˜ β€² (𝑧) πœ” π‘˜ 𝑒 𝑑 𝑓( 𝑒 𝑑 ) 𝑃 π‘˜ ( 𝑒 𝑑 ) ,1 technique 2 technique 3

23 Overall Algorithm Initialize current state with any (visible) path and technique Mutate current state to make target state Calculate its radiance Calculate its acceptance probability Accept or reject the target Loop from 2 until converged

24 Metropolis Light Transport Result
Experiment MMLT do better than MLT when various materials are mixed Metropolis Light Transport Result

25 Multiplex Metropolis Light Transport Result
Experiment MMLT do better than MLT when various materials are mixed Multiplex Metropolis Light Transport Result

26 Experiment β€’ Door MLT (RMSE: 0.0314) PSSMLT (RMSE: 0.0517) MMLT

27 Experiment PSSMLT MLT MMLT

28 Robust Adaptive Photon Tracing Using Photon Path Visibility
Toshiya Hachisuka, Henrik Wann Jensen ACM TOG, (Volume 30 Issue 5, presented at SIGGRAPH 2013) 2011.

29 Problem Statement (Progressive) Photon Mapping Pros: can handle
specular-diffuse-specular problem State of the Art in Photon Density Estimation SIGGRAPH 2012 Course Kavita Bala, Computer Sicence, Cornel University From Presentation of Prof. Sungeui Yoon

30 Problem Statement (Progressive) Photon Mapping
Cons: cannot handle scene with small indirect lighting Kavita Bala, Computer Sicence, Cornel University From Presentation of Prof. Sungeui Yoon MCMC may be handle this?

31 More Problem Statement
Why photon mapping cannot handle such scene? Too many photons are wasted by invalidation Light Window Valid lights Camera Invalid light

32 Applying Metropolis Method
Unlike before, this paper uses β€˜visibility function’ on sampling Sample visible paths more Visibility function 𝑉(𝑒): 1 if photon path 𝑒 is visible, else 0 Normalized visibility function 𝐹 𝑒 = 𝑉(𝑒) βˆ«π‘‰ 𝑒 𝑑𝑒 = 𝑉(𝑒) 𝑉 𝑐 𝑒 Use MCMC method to sample from function 𝐹(𝑒) Acceptance probability: min 1, 𝐹 𝑧 𝐹 𝑒 ?

33 Replica Exchange Monte-Carlo
Directly applying MCMC is dangerous Because 𝐹(𝑒) is very sparse function 𝐹(𝑒) Too far to reach! Jumping probability 𝑒 1 𝑒 2 𝑒 3 𝑒 4 𝑒 5 𝑒 6 Visible Invisible

34 Replica Exchange Monte-Carlo
Let’s think about 𝑄 independent MCMC 𝑄 functions to be sampled: 𝐹 1 … 𝐹 𝑄 𝑄 independent states: 𝑒 1 … 𝑒 𝑄 Replica exchange Monte-Carlo allows to exchange states inter-distribution Acceptance probability π‘Ž 𝑒 𝑝 , 𝑒 π‘ž = min 1, 𝐹 𝑖 𝑒 π‘ž 𝐹 𝑗 𝑒 𝑝 𝐹 𝑖 𝑒 𝑝 𝐹 𝑗 𝑒 π‘ž If it is accepted, 𝑒 𝑝 and 𝑒 π‘ž are exchanged

35 Replica Exchange Monte-Carlo
This paper uses two importance function 𝐹 𝑒 is a normalized visibility function 𝐼 𝑒 =1 is a constant function 𝑒 𝐼 , 𝑒 𝐹 is a state of constant/visibility function π‘Ž 𝑒 𝐼 , 𝑒 𝐹 = min 1, 𝐹 𝑒 𝐼 𝐼 𝑒 𝐹 𝐹 𝑒 𝐹 𝐼 𝑒 𝐼 = min 1, 𝐹 𝑒 𝐼 𝑉 𝑐 =𝑉 𝑒 𝑙 It means that accept (exchange state) if path from uniform dist. is visible reject if it is invisible

36 Overall Algorithm Uniformly sample any path
Exchange to current path if it is visible If it is not, do regular MCMC method Target path = Mutate the current path Accept if it is visible -> change to the current path Reject if it is not

37 Experiment Photon sampled by uniform distribution
Photon sampled by MCMC

38 by uniform distribution
Experiment Photon sampled by uniform distribution Photon sampled by MCMC

39 Experiment Photon sampled by uniform distribution
Photon sampled by MCMC

40 Experiment RMSE of previous scene

41 Thank you! Please ask a question if you have

42 Quiz 1. (T/F) In the first paper β€œMultiplexed Metropolis Light Transport”, MMLT algorithm fuses multiple importance sampling and Markov Chain Monte-Carlo method. 2. (T/F) In the second paper β€œRobust Adaptive Photon Tracing Using Photon Path Visibility”, the algorithm uses only Metropolis method to do MCMC sampling.


Download ppt "Ray Tracing via Markov Chain Monte-Carlo Method"

Similar presentations


Ads by Google