rendering monte carlo integration i
play

Rendering: Monte Carlo Integration I Bernhard Kerbl Research - PowerPoint PPT Presentation

Rendering: Monte Carlo Integration I Bernhard Kerbl Research Division of Computer Graphics Institute of Visual Computing & Human-Centered Technology TU Wien, Austria With slides based on material by Jaakko Lehtinen, used with


  1. ΰΆ± Rendering: Monte Carlo Integration I Bernhard Kerbl Research Division of Computer Graphics Institute of Visual Computing & Human-Centered Technology TU Wien, Austria With slides based on material by Jaakko Lehtinen, used with permission

  2. Today’s Goal Integrating the cosine-weighted radiance 𝑀 𝑗 (𝑦, πœ•) at a point 𝑦 Integral of the light function over the hemisphere, w.r.t. direction/solid angle πœ• This is easier said than done! How do we integrate over the hemisphere? 𝑀 𝑗 (𝑦, πœ•) depends on lights, geometry… how can we integrate that? Rendering – Monte Carlo Integration I 2

  3. Today’s Goal The solution involves methods from statistics, probability and calculus that are combined to achieve Monte Carlo Integration This is a lot to take in, some of the concepts are complex We choose to explore them in an illustrative way because grasping the underlying ideas makes their application much easier We will try to present the bare necessities you need to write a rendering routine two versions: a formal and an intuitive one Rendering – Monte Carlo Integration I 3

  4. Fundamentals Recap Calculus Derivatives Integrals Probability and Statistics Discrete/Continuous Random Variables Uniform/Non-Uniform Distributions Probability Density Function Expected Value and Variance Rendering – Monte Carlo Integration I 4

  5. Derivatives Derivative 𝑔′(𝑦) of 𝑔(𝑦) gives the rate of change of 𝑔(𝑦) at point 𝑦 Answers the question: how does 𝑧 = 𝑔(𝑦) change within an 𝑔 𝑦+𝑒𝑦 βˆ’π‘”(𝑦) = 𝑒𝑧 infinitesimally small range 𝑒𝑦 around 𝑦 𝑦+π‘’π‘¦βˆ’π‘¦ 𝑒𝑦 Closed- form solutions don’t always exist (discontinuous functions) Functions of multiple variables can be derived w.r.t. any of them, yielding a partial derivative (indicated by e.g. πœ–π‘¦ instead of 𝑒𝑦 ) Rendering – Monte Carlo Integration I 5

  6. Indefinite Integral Basic notation: 𝐺 𝑦 = Χ¬ 𝑔 𝑦 𝑒𝑦 𝐺 𝑦 is any function that fulfills 𝐺 𝑦 β€² = 𝑔 𝑦 , thus it is generally called the β€œanti - derivative” of 𝑔 𝑦 By this definition, solutions can include arbitrary constants 𝑑 , e.g.: 2 3 𝑦 2 𝑦 𝑒𝑦 = + 𝑑 Χ¬ 3 𝑦 2 Χ¬ 𝑦 𝑒𝑦 = 2 + 𝑑 Χ¬ cos 𝑦 𝑒𝑦 = sin 𝑦 + 𝑑 Rendering – Monte Carlo Integration I 6

  7. Definite Integral: An interpretation 𝑐 𝑔 𝑦 𝑒𝑦 , with Basic notation: Χ¬ 𝑏 the variable of integration 𝑦 the integration interval [𝑏, 𝑐] for 𝑦 the function 𝑔 𝑦 to integrate ( integrand ) the differential 𝑒𝑦 for 𝑦 Informally: β€œThe area under the curve” [1] The differential is an β€œinfinitesimal range”, making 𝑔 𝑦 β‹… 𝑒𝑦 an infinitesimal area. The integral is the sum of these areas in [𝑏, 𝑐] Rendering – Monte Carlo Integration I 7

  8. Definite Integral: An interpretation 𝑐 𝑔 𝑦 𝑒𝑦 , with Basic notation: Χ¬ 𝑏 the variable of integration 𝑦 Δ𝑦 the integration interval [𝑏, 𝑐] for 𝑦 the function 𝑔 𝑦 to integrate ( integrand ) the differential 𝑒𝑦 for 𝑦 𝑔(𝑦) Informally: β€œThe area under the curve” [1] The differential is an β€œinfinitesimal range”, making 𝑔 𝑦 β‹… 𝑒𝑦 an infinitesimal area. The integral is the sum of these areas in [𝑏, 𝑐] Rendering – Monte Carlo Integration I 8

  9. Definite Integral: An interpretation 𝑐 𝑔 𝑦 𝑒𝑦 , with Basic notation: Χ¬ 𝑏 the variable of integration 𝑦 Δ𝑦 the integration interval [𝑏, 𝑐] for 𝑦 the function 𝑔 𝑦 to integrate ( integrand ) the differential 𝑒𝑦 for 𝑦 𝑔(𝑦) Informally: β€œThe area under the curve” [1] The differential is an β€œinfinitesimal range”, making 𝑔 𝑦 β‹… 𝑒𝑦 an infinitesimal area. The integral is the sum of these areas in [𝑏, 𝑐] Rendering – Monte Carlo Integration I 9

  10. Definite Integral: An interpretation 𝑐 𝑔 𝑦 𝑒𝑦 , with Basic notation: Χ¬ 𝑏 the variable of integration 𝑦 Δ𝑦 the integration interval [𝑏, 𝑐] for 𝑦 the function 𝑔 𝑦 to integrate ( integrand ) the differential 𝑒𝑦 for 𝑦 𝑔(𝑦) Informally: β€œThe area under the curve” [1] The differential is an β€œinfinitesimal range”, making 𝑔 𝑦 β‹… 𝑒𝑦 an infinitesimal area. The integral is the sum of these areas in [𝑏, 𝑐] Rendering – Monte Carlo Integration I 10

  11. Definite Integral: An interpretation 𝑐 𝑔 𝑦 𝑒𝑦 , with Basic notation: Χ¬ 𝑏 the variable of integration 𝑦 Δ𝑦 = 𝑒𝑦 the integration interval [𝑏, 𝑐] for 𝑦 the function 𝑔 𝑦 to integrate ( integrand ) the differential 𝑒𝑦 for 𝑦 𝑔(𝑦) Informally: β€œThe area under the curve” [1] The differential is an β€œinfinitesimal range”, making 𝑔 𝑦 β‹… 𝑒𝑦 an infinitesimal area. The integral is the sum of these areas in [𝑏, 𝑐] Rendering – Monte Carlo Integration I 11

  12. Solving Definite Integrals With a solution for the indefinite integral 𝐺 𝑦 = Χ¬ 𝑔 𝑦 𝑒𝑦 , 𝑐 𝑔 𝑦 𝑒𝑦 = 𝐺 𝑐 βˆ’ 𝐺(𝑏) we can solve Χ¬ 𝑏 Example: Unit circle: 𝑦 2 + 𝑧 2 = 1 , area is 𝜌 1 1 βˆ’ 𝑦 2 𝑔 𝑦 = 𝑧 = Χ¬ 𝑔 𝑦 𝑒𝑦 = 1 2 ( 1 βˆ’ 𝑦 2 β‹… 𝑦 + sin βˆ’1 𝑦) 𝑧 1 𝑔 𝑦 𝑒𝑦 = 𝐺 1 βˆ’ 𝐺 0 = 𝜌 Χ¬ 0 4 𝑦 0 1 Rendering – Monte Carlo Integration I 12

  13. Solving Definite Integrals With a solution for the indefinite integral 𝐺 𝑦 = Χ¬ 𝑔 𝑦 𝑒𝑦 , 𝑐 𝑔 𝑦 𝑒𝑦 = 𝐺 𝑐 βˆ’ 𝐺(𝑏) we can solve Χ¬ 𝑏 1 Example: 𝝆 𝑧 Unit circle: 𝑦 2 + 𝑧 2 = 1 , area is 𝜌 πŸ“ 1 βˆ’ 𝑦 2 𝑔 𝑦 = 𝑧 = 0 𝑦 1 Χ¬ 𝑔 𝑦 𝑒𝑦 = 1 2 ( 1 βˆ’ 𝑦 2 β‹… 𝑦 + sin βˆ’1 𝑦) 1 𝑔 𝑦 𝑒𝑦 = 𝐺 1 βˆ’ 𝐺 0 = 𝜌 Χ¬ 0 4 Rendering – Monte Carlo Integration I 13

  14. Remarks on Definite Integrals To generalize to π‘œ - D, we will talk about β€œvolume” rather than area 𝐸 for integral over entire domain 𝐸 We use subscript-only symbol Χ¬ Integrating 1 over range [𝑏, 𝑐] gives the length/volume of the range Integrating 1 over an π‘œ -D domain gives the volume of the domain A domain 𝐸 with X ∈ [0, 2] , 𝑍 ∈ [2, 5] in and Z ∈ [1, 1.5] , we have: 2 Χ¬ 5 Χ¬ 1.5 1 𝑒𝑦 𝑒𝑧 𝑒𝑨 = 2 Γ— 3 Γ— 0.5 = 3 π‘Šπ‘π‘š 𝐸 = Χ¬ 𝐸 1 𝑒𝐸 = Χ¬ 0 2 1 Rendering – Monte Carlo Integration I 14

  15. Random Variables We indicate random variables with capital letters π‘Œ, 𝑍, … and some Greek symbols for special random variables Random variables are drawn from some domain of possible results We define an outcome, or β€œevent” for draws from random variables. π‘Œ 𝑗 marks an observed outcome of a given random variable π‘Œ Random variables can be discrete or continuous. Functions of random variables can themselves be seen as random variables Rendering – Monte Carlo Integration I 15

  16. Uniform and Non-Uniform Distributions The occurrence of values drawn from a random variable usually follows a given probability distribution If a random variable has a uniform distribution, all possible outcomes are equally likely to occur (e.g., a fair die or fair coin) For non-uniform distributions, the probability of certain values is significantly higher than others (e.g., population body height) Rendering – Monte Carlo Integration I 16

  17. Discrete Random Variables In daily life, we are mostly confronted with discrete random results A coin flip Toss of a die Cards in a deck Each possible outcome of a random variable is associated with a specific probability π‘ž . Probabilities must sum up to 1 (100%) 1 E.g., a fair die: π‘Œ ∈ 1,2,3,4,5,6 and π‘ž 1 = π‘ž 2 = β‹― = π‘ž 6 = 6 Rendering – Monte Carlo Integration I 17

  18. Continuous Random Variables A continuous random variable π‘Œ with a given range [𝑏, 𝑐) can assume any value π‘Œ 𝑗 that fulfills 𝑏 ≀ π‘Œ 𝑗 < 𝑐 Working with continuous variables generalizes the methodology for many complex evaluations that depend on probability theory There are infinitely many possible outcomes and, consequently, the observation of any specific event has with vanishing probability How can we find the probabilities for continuous variables? [2] Rendering – Monte Carlo Integration I 18

  19. Cumulative Distribution Function (CDF) For continuous variables, we cannot assign probabilities to values 0 1 ? If π‘Œ can take on any value with equal probability, what is the probability of π‘Œ = 0.5 ? The cumulative distribution function (CDF) lets us compute the probability of a variable taking on a value in a specified range [2] We use notation 𝑄 π‘Œ 𝑦 for the CDF of π‘Œ ’s distribution, which yields the probability of π‘Œ taking on any value ≀ 𝑦 Rendering – Monte Carlo Integration I 19

  20. Probability for a Range with CDF 𝑄 π‘Œ 𝑐 βˆ’ 𝑄 π‘Œ 𝑏 = 𝑄𝑠 𝑏 ≀ π‘Œ 𝑗 ≀ 𝑐 Read as: π‘’β„Žπ‘“ π‘žπ‘ π‘π‘π‘π‘π‘—π‘šπ‘—π‘’π‘§ 𝑝𝑔 π‘Œ π‘’π‘π‘™π‘—π‘œπ‘• π‘π‘œ π‘π‘œπ‘§ π‘€π‘π‘šπ‘£π‘“ 𝑔𝑠𝑝𝑛 0 𝑒𝑝 𝑐, π‘›π‘—π‘œπ‘£π‘‘ π‘’β„Žπ‘“ π‘žπ‘ π‘π‘π‘π‘π‘—π‘šπ‘—π‘’π‘§ 𝑝𝑔 π‘Œ π‘’π‘π‘™π‘—π‘œπ‘• π‘π‘œ π‘π‘œπ‘§ π‘€π‘π‘šπ‘£π‘“ 𝑔𝑠𝑝𝑛 0 𝑒𝑝 𝑏 1 Example: uniform variable ΞΎ generates values in range [0, 1): 𝑄 𝜊 𝑦 = 𝑦 𝑧 𝑄(𝑦) 𝑄 𝜊 0.75 βˆ’ P 𝜊 0. 5 = 0.25 𝑦 0 1 Rendering – Monte Carlo Integration I 20

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend