direct illumination
play

Direct Illumination & Monte Carlo Integration CS295, Spring - PowerPoint PPT Presentation

Direct Illumination & Monte Carlo Integration CS295, Spring 2017 Shuang Zhao Computer Science Department University of California, Irvine CS295, Spring 2017 Shuang Zhao 1 Announcement Homework 1 will be out on Thursday, Apr 13


  1. Direct Illumination & Monte Carlo Integration CS295, Spring 2017 Shuang Zhao Computer Science Department University of California, Irvine CS295, Spring 2017 Shuang Zhao 1

  2. Announcement • Homework 1 will be out on Thursday, Apr 13 • Check course website for additional readings CS295, Spring 2017 Shuang Zhao 2

  3. Last Lecture • Radiometry • Physics of light • BRDFs • How materials reflects light CS295, Spring 2017 Shuang Zhao 3

  4. Today’s Lecture • Direct illumination • Monte Carlo integration I CS295, Spring 2017 Shuang Zhao 4

  5. Direct Illumination CS295 Realistic Image Synthesis CS295, Spring 2017 Shuang Zhao 5

  6. Direct and Indirect Illumination Today’s focus [scratchpixel.com] CS295, Spring 2017 Shuang Zhao 6

  7. Recap: BRDF • The B idirectional R eflectance D istribution F unction (BRDF) Convention: all vectors point away from x CS295, Spring 2017 Shuang Zhao 7

  8. Reflected Radiance Convention: all vectors point away from x CS295, Spring 2017 Shuang Zhao 8

  9. Incident and Exitant Radiance Exitant Incident • L r ( x , ω o ): all reflected light leaving x (exitant) • L i ( x , ω i ): all light entering x (incident) • Other exitant quantities • L e ( x , ω o ) : all emitted light leaving x (nonzero for light sources) • L ( x , ω o ) : all light leaving x CS295, Spring 2017 Shuang Zhao 9

  10. Incident and Exitant Radiance • In general: • y is computed by tracing a ray from x in direction ω • Recap: invariant of radiance (in vacuum) CS295, Spring 2017 Shuang Zhao 10

  11. Direct Illumination CS295, Spring 2017 Shuang Zhao 11

  12. Example: Uniform Spherical Light Spherical light source with radius r and L e ( x , ω ) ≡ L 0 Diffuse surface f r ( ω i ↔ ω o ) ≡ k d / π Recall: CS295, Spring 2017 Shuang Zhao 12

  13. Example: Uniform Spherical Light • For a spherical light source with fixed radiant power Ф 0 (i.e., ): • Further, when r goes to zero (point source): Recall: CS295, Spring 2017 Shuang Zhao 13

  14. Computing Direct Illumination • Challenges • y changes discontinuously with ω i due to occlusion Object 1 Object 2 • f r can be complicated (e.g., microfacet BRDFs) CS295, Spring 2017 Shuang Zhao 14

  15. Monte Carlo Integration I CS295 Realistic Image Synthesis CS295, Spring 2017 Shuang Zhao 15

  16. Monte Carlo Integration • A powerful framework for computing integrals • Numerical • Nondeterministic (i.e., using randomness) • Scalable to high-dimensional problems CS295, Spring 2017 Shuang Zhao 16

  17. Recap: Random Variables • (Discrete) random variable X • Possible outcomes: x 1 , x 2 , …, x n • with probabilities p 1 , p 2 , …, p n such that • E.g., “fair” coin • Outcomes: x 1 = “head”, x 2 = “tail” • Probabilities: p 1 = p 2 = ½ CS295, Spring 2017 Shuang Zhao 17

  18. Recap: Random Variables • (Continuous) random variable X • Possible outcomes: [ a , b ] • with probability density p ( x ) such that CS295, Spring 2017 Shuang Zhao 18

  19. Recap: Expected Value & Variance • Expected value: • Variance: CS295, Spring 2017 Shuang Zhao 19

  20. Recap: Expected Value & Variance Let X and Y be two random variables, then: Today’s focus CS295, Spring 2017 Shuang Zhao 20

  21. Recap: Strong Law of Large Numbers Let x 1 , x 2 , …, x n be n independent observations (aka. samples ) of X “Actual” mean Sample mean CS295, Spring 2017 Shuang Zhao 21

  22. Example: Evaluating π • Let X be a point uniformly distributed in the square • Probability for X inside S : Unit circle π /4 S • Let • Then Circle area = π Square area = 4 CS295, Spring 2017 Shuang Zhao 22

  23. Example: Evaluating π • (Simple) solution for Unit circle computing π : S • Generating n independent samples of Y based on n i.i.d. X samples • Computing their mean Circle area = π Square area = 4 CS295, Spring 2017 Shuang Zhao 23

  24. Example: Evaluating π Unit circle S Circle area = π Square area = 4 CS295, Spring 2017 Shuang Zhao 24

  25. Integral • f(x): one-dimensional function CS295, Spring 2017 Shuang Zhao 25

  26. Deterministic Integration • Quadrature rules: • Problem: • Scales poorly with high dimensionality (more on this in the next lecture) CS295, Spring 2017 Shuang Zhao 26

  27. Monte Carlo Integration: Overview • Goal: Estimating • Idea: Constructing random variable • Such that • is called an unbiased estimator of • But how? CS295, Spring 2017 Shuang Zhao 27

  28. Monte Carlo Integration • Let p () be any probability density function over [ a , b ] and X be a random variable with density p • Let , then: • To estimate : strong law of large numbers CS295, Spring 2017 Shuang Zhao 28

  29. Monte Carlo Integration • Goal: to estimate • Pick a probability density function • Generate n independent samples: • Evaluate for j = 1, 2, …, n • Return sample mean: CS295, Spring 2017 Shuang Zhao 29

  30. How to pick density function p ()? • In theory • (Almost) anything • In practice: • Uniform distributions (almost) always work • As long as the domain is bounded • Choice of p() greatly affects the effectiveness (i.e., convergence rate) of the resulting estimator • More in later lectures CS295, Spring 2017 Shuang Zhao 30

  31. Monte Carlo Integration “Hello World” • Estimating • Algorithm: • Draw x 1 , x 2 , …, x n from U[0, 1) independently • Return CS295, Spring 2017 Shuang Zhao 31

  32. Monte Carlo Integration “Hello World” • Estimating CS295, Spring 2017 Shuang Zhao 32

Recommend


More recommend