lecture 11 various
play

Lecture 11 - Various Welcome! , = (, ) , - PowerPoint PPT Presentation

INFOMAGR Advanced Graphics Jacco Bikker - November 2019 - February 2019 Lecture 11 - Various Welcome! , = (, ) , + , , ,


  1. INFOMAGR – Advanced Graphics Jacco Bikker - November 2019 - February 2019 Lecture 11 - “Various” Welcome! 𝑱 𝒚, 𝒚 ′ = 𝒉(𝒚, 𝒚 ′ ) 𝝑 𝒚, 𝒚 ′ + න 𝝇 𝒚, 𝒚 ′ , 𝒚 ′′ 𝑱 𝒚 ′ , 𝒚 ′′ 𝒆𝒚′′ 𝑻

  2. Today’s Agenda: ▪ Gamma Correction ▪ Depth of Field ▪ Skybox ▪ Spots, IES Profiles ▪ Russian Roulette

  3. Advanced Graphics – Various 3 MIS Revisited Method 1: direct light sampling ▪ Samples only the part of the hemisphere occupied by unoccluded light sources. ▪ Does so by checking the visibility of a random point on a random light. Method 2: BRDF sampling ▪ Samples only the part of the hemisphere not occupied by light sources ▪ Does so by rejecting samples that happen to hit a light source. Method 1 and 2 can (should!) be summed to sample the full hemisphere exactly once.

  4. Advanced Graphics – Various 4 MIS Revisited angle 1 𝑞𝑒𝑔 = ቐ 𝑡𝑝𝑚𝑗𝑒 𝑏𝑜𝑕𝑚𝑓 0 −𝜌 𝜌 𝑞𝑒𝑔 = cos 𝜄 𝜌 𝜌 𝑏𝑠𝑓𝑏 = න 𝑑𝑝𝑡𝜄 −𝜌 𝜌 −𝜌

  5. Advanced Graphics – Various 5 MIS Revisited Solution: 𝑂 randomly pick a distribution (and its associated pdf). ≈ 1 න 𝑔 𝑦 𝑒𝑦 = 𝐹 𝑔 𝑦 𝑂 ෍ 𝑔 𝑌 𝑗 𝑗=1 𝑂 𝑔 𝑌 𝑗 ≈ 1 𝐹 𝑔 𝑦 𝑂 ෍ 𝑞 𝑌 𝑗 𝑗=1 𝑚𝑏𝑠𝑕𝑓 𝑤𝑏𝑚𝑣𝑓 𝑚𝑏𝑠𝑕𝑓 𝑤𝑏𝑚𝑣𝑓 𝑡𝑛𝑏𝑚𝑚 𝑤𝑏𝑚𝑣𝑓 = 𝑤𝑓𝑠𝑧 𝑚𝑏𝑠𝑕𝑓 𝑚𝑏𝑠𝑕𝑓 𝑤𝑏𝑚𝑣𝑓 ≈ 1

  6. Advanced Graphics – Various 6 MIS Revisited Solution: randomly pick a distribution (and its associated pdf). 𝑂 𝑔 𝑌 𝑗 ≈ 1 𝐹 𝑔 𝑌 𝑂 ෍ This is what we did before. 𝑞 𝑌 𝑗 𝑗=1 𝑂 𝑂 𝑗 𝑔 𝑌 𝑗,𝑘 1 Now, we combine the sampling techniques. 𝐹 𝑔 𝑌 ≈ ෍ ෍ 𝑥 𝑗 𝑌 𝑗,𝑘 𝑂 𝑗 𝑞 𝑗 𝑌 𝑗,𝑘 𝑗=1 𝑘=1 apply a weight to each sample draw 𝑂 𝑗 samples Weights: σ 𝑥 𝑗 = 1 using technique 𝑗 iterate over the available techniques 1 Most basic weight: 𝑂 (i.e., a weighted average of the techniques).

  7. Advanced Graphics – Various 7 MIS Revisited 1 Weights: σ 𝜕 𝑗 = 1 , most basic weight: 𝑂 . Can we do better? Let’s set 𝑂 𝑗 to 1 to simplify things: 𝑂 𝑂 𝑗 𝑂 𝑥 𝑗 (𝑌 𝑗,𝑘 ) 𝑔 𝑌 𝑗,𝑘 1 𝑥 𝑗 (𝑌 𝑗 ) 𝑔 𝑌 𝑗 𝐹 𝑔 𝑌 ≈ ෍ ෍ 𝐺 = ෍ 𝑂 𝑗 𝑞 𝑗 𝑌 𝑗,𝑘 𝑞 𝑗 𝑌 𝑗 𝑗=1 𝑘=1 𝑗=1 apply a weight to each sample draw 𝑂 𝑗 samples using technique 𝑗 We are drawing 𝑌 𝐵 from 𝑞 𝐵 , and we iterate over the are looking up the same 𝑌 𝐵 in 𝑞 𝐶 . available techniques For two pdfs: Objective: minimize variance in the estimator . 𝑂 𝑗 𝑞 𝑗 ( 𝑌 𝑗,𝑘 ) 𝑞 𝑗 ( 𝑌 𝑗 ) 𝑞 𝐵 ( 𝑌 𝐵 ) 𝑥 𝐵 ( 𝑌 𝐵 ) = 𝑥 𝑗 ( 𝑌 𝑗,𝑘 ) = 𝑥 𝑗 ( 𝑌 𝑗 ) = How about this one: 𝑞 𝐵 𝑌 𝐵 +𝑞 𝐶 𝑌 𝐵 σ 𝑙 𝑂 𝑙 𝑞 𝑙 ( 𝑌 𝑗,𝑘 ) σ 𝑙 𝑞 𝑙 ( 𝑌 𝑗 ) 𝑞 𝐶 𝑌 𝐶 This time, each weight is proportional to the pdf (!). 𝑥 𝐶 ( 𝑌 𝐶 ) = 𝑞 𝐵 𝑌 𝐶 +𝑞 𝐶 𝑌 𝐶

  8. Advanced Graphics – Various 8 MIS Revisited Summarizing: 𝑂 𝑔 𝑌 𝐵 𝑔 𝑌 𝐶 𝑔 𝑌 𝑗 𝑔 𝑌 𝐵 𝑔 𝑌 𝐶 = 𝑞 𝐵 𝑌 𝐵 + 𝑞 𝐶 (𝑌 𝐵 ) + 𝐺 = ෍ 𝑥 𝑗 𝑌 𝑗 = 𝑥 𝐵 𝑌 𝐵 + 𝑥 𝐶 𝑌 𝐶 𝑞 𝐵 (𝑌 𝐶 ) + 𝑞 𝐶 𝑌 𝐶 𝑞 𝑗 𝑌 𝑗 𝑞 𝐵 𝑌 𝐵 𝑞 𝐶 𝑌 𝐶 𝑗=1 where 𝑞 𝐵 ( 𝑌 𝐵 ) 𝑥 𝐵 ( 𝑌 𝐵 ) = 𝑔 𝑌 𝐵 𝑞 𝐵 (𝑌 𝐵 ) 𝑔 𝑌 𝐵 𝑔 𝑌 𝐵 𝑞 𝐵 𝑌 𝐵 +𝑞 𝐶 𝑌 𝐵 𝑥 𝐵 𝑌 𝐵 = = 𝑞 𝐵 𝑌 𝐵 𝑞 𝐵 (𝑌 𝐵 ) +𝑞 𝐶 (𝑌 𝐵 ) 𝑞 𝐵 𝑌 𝐵 𝑞 𝐵 𝑌 𝐵 +𝑞 𝐶 (𝑌 𝐵 ) and 𝑞 𝐶 ( 𝑌 𝐶 ) 𝑔 𝑌 𝐶 𝑞 𝐶 (𝑌 𝐶 ) 𝑔 𝑌 𝐶 𝑔 𝑌 𝐶 𝑥 𝐶 ( 𝑌 𝐶 ) = 𝑥 𝐶 𝑌 𝐶 = = 𝑞 𝐶 𝑌 𝐶 𝑞 𝐵 (𝑌 𝐶 ) +𝑞 𝐶 (𝑌 𝐶 ) 𝑞 𝐶 𝑌 𝐶 𝑞 𝐵 𝑌 𝐶 +𝑞 𝐶 (𝑌 𝐶 ) 𝑞 𝐵 ( 𝑌 𝐶 ) +𝑞 𝐶 ( 𝑌 𝐶 ) So: for both sampling strategies, we add to the pdf the pdf of the other strategy for the same point on the hemisphere .

  9. Today’s Agenda: ▪ Gamma Correction ▪ Depth of Field ▪ Skybox ▪ Spots, IES Profiles ▪ Russian Roulette

  10. Advanced Graphics – Various 10 Gamma Correction 1 Human Eye Digital representation of intensities is discrete: for ARGB32, we have 256 levels for red, green and blue. luminance The human eye is more sensitive to differences in luminance for dark shades. When encoding luminance, it is advantageous to have more detail in the lower regions, e.g.: 1 𝑀 = 𝑊 𝛿 ⇒ 𝑊 = 𝑀 𝛿 0 0 For the human eye, 𝛿 = 2.33 is optimal*. 1 values *: Ebner & Fairchild, Development and testing of a color space (IPT) with improved hue uniformity, 1998.

  11. Advanced Graphics – Various 11 Gamma Correction 1 CRT Power Response A classic CRT display converts incoming data to luminance in a non-linear way. luminance 1 𝑀 = 𝑊 𝛿 ⇒ 𝑊 = 𝑀 𝛿 For a typical monitor, 𝛿 = 2.2 . In other words: 1 ▪ If we encode our luminance using 𝑊 = 𝑀 𝛿 , it will be linear on the monitor. 0 ▪ At the same time, this yields a distribution 0 1 values that has more detail for darker shades, which suits the human eye.

  12. Advanced Graphics – Various 12 Gamma Correction 1 Practical Gamma Correction To ensure linear response of the monitor to our synthesized images, we feed the monitor adjusted data: luminance 𝑊 = 𝑀 1/2.2 ≈ 𝑀 What happens if we don’t do this? 1. 𝑀 will be 𝑊 2.2 ; the image will be too dark. 2. A linear gradient will become a quadratic gradient; a quadratic gradient will become a cubic gradient ➔ your 0 lights will appear to have a very small 0 1 values area of influence.

  13. Advanced Graphics – Various 13 Gamma Correction Correct of monitor 𝛿 = 1.0 Correct of monitor 𝛿 = 2.2

  14. Advanced Graphics – Various 14 Gamma Correction 1 Legacy The response of a CRT is 𝑀 = 𝑊 2.2 ; what about modern screens? luminance Typical laptop / desktop screens have a linear response, but expect applications to provide 𝑀 data… So 𝑊 is modified (in hardware, or by the driver): 𝑊 = 𝑊 2 . 𝑀 ⇒ 𝑀 2 𝑀 ⇒ Not all screens take this legacy into account; especially beamers will often use 𝛿 = 1. 0 0 1 values Gamma correct only if the hardware or video driver expects it!

  15. Advanced Graphics – Various 15 Gamma Correction Gamma Corrected Or Not? Black/White r,g,b=192 (75%) checkerboard Open gamma.gif using the windows image previewer, and zoom to the smallest level (1:1). Which bar in the right column is most similar in brightness to the right column? r,g,b=128 (50%) r,g,b=64 (25%)

  16. Advanced Graphics – Various 17 Gamma Correction Consequences How are your digital photos / DVD movies stored? 1. With gamma correction, ready to be sent to a display device that expects 𝑀 2. Without gamma correction, expecting the image viewer to apply 𝑀 For jpegs and mpeg video, the answer is 1: these images are already gamma corrected. ➔ Your textures may require conversion to linear space: 𝑀 = 𝑊 2

  17. Today’s Agenda: ▪ Gamma Correction ▪ Depth of Field ▪ Skybox ▪ Spots, IES Profiles ▪ Russian Roulette

  18. Advanced Graphics – Various 20 Depth of Field Focus A pinhole camera ensures that each pixel receives light from a single direction. For a true pinhole, the amount of light is zero. Actual cameras use a lens system to direct a limited set of directions to each pixel.

  19. Advanced Graphics – Various 21 Depth of Field Focus Objects on the focal plane appear in focus: Light reflected from these objects to the lens end up on a single pixel on the film.

  20. Advanced Graphics – Various 22 Depth of Field Focus Objects before the focal plane appear out of focus: Light reflected from these objects is spread out over several pixels on the film (the ‘circle of confusion’).

  21. Advanced Graphics – Various 23 Depth of Field Focus Objects beyond the focal plane also appear out of focus: Light reflected from these objects is again spread out over several pixels on the film.

  22. Advanced Graphics – Various 24 Depth of Field Circle of Confusion Ray tracing depth of field: Spreading out the energy returned by a single ray over multiple pixels within the circle of confusion.

  23. Advanced Graphics – Various 25 Depth of Field Circle of Confusion Efficient depth of field: We place the virtual screen plane at the focal distance (from the lens). Rays are generated on the lens, and extend through each pixel. ▪ All rays through the pixel will hit the object near the focal plane; ▪ Few rays through the pixel hit the ‘out of focus’ objects. ▪ Rays through other pixels may hit the same ‘out of focus’ objects.

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