11 environment and ambient illumination
play

11 Environment and ambient illumination Steve Marschner CS5625 - PowerPoint PPT Presentation

11 Environment and ambient illumination Steve Marschner CS5625 Spring 2020 Real-time environment illumination Now incident radiance field is stored in a texture, not defined by a polygon this makes it easy to do mirror reflections: single


  1. 11 Environment and ambient illumination Steve Marschner CS5625 Spring 2020

  2. Real-time environment illumination Now incident radiance field is stored in a texture, not defined by a polygon • this makes it easy to do mirror reflections: single cubemap lookup Two special kinds of BRDFs are convenient • di ff use BRDFs: irradiance depends only on surface normal (not v ) 
 …leads to irradiance environment maps • rotationally symmetric lobes (e.g. Phong): it’s a convolution of the environment map 
 …leads to prefiltered environment maps

  3. <latexit sha1_base64="lzHQhec/0+3wgVOSm7sGDJyI+ec=">ACQ3icbZDPahRBEMZrEv/EVeMmOYrQuAhZiDszu2uyOYgBL4J7iOAmgZ1l6OmtSZp094zdPUOWIac8jVd9Bh/CZ/Ai4lWwZzaKigUNv/q6vrS3LBjQ2Cz97K6o2bt26v3WndvXd/UF7Y/PIZIVmOGZyPRJQg0KrnBiuRV4kmukMhF4nJy/rOvHJWrDM/XWLnKcSXqeMoZtU6K24/Gsd6OyrJLnpNxzB026Q6JStXtxu1O0BuFz4K9AVnCcP8adgck7AVNdF58hSYO4w1vPZpnrJCoLBPUmGkY5HYnFfhOzSqLWcCL1tRYTCn7Jye4tShohLNrGq2uSRPnDInabdUZY06p8dFZXGLGTibkpqz8y/tVr8X21a2HQ0q7jKC4uKLQelhSA2I7U1ZM41MisWDijT3P2VsDOqKbPOwFbUNFb+xLjMN1r6Y5oqhe+xQuZ+lwxUczRd3M1v3hauqfcNo2Dw35/NKwdrGEQ/oLRbweP+r1w0AveDsHr5dWwho8hMewDSHswQG8gkOYAIMreA8f4KP3yfvifO+L6+ueNc9W/BXeD9+Au1BsHo=</latexit> Standard reflection map For mirror-specular surface, the illumination integral reduces to L r ( v ) = L i ( r ( v , n )) This is a function only of r • so store it in a cubemap and look up using r ( v , n ).

  4. <latexit sha1_base64="IaqHgxQwXRGt6294Fawpmh2WdCM=">ACZnicbVBdb9MwFHUzPrYCpRuaeODFokIa0miStrDuAVGJFyQqMRDdJtV5Dg3nTXbCbZTrYr6d/ZreAWJf8AjPwEnLQgQV7Lu8bn3+PqeOBfc2CD41vC2bty8dXt7p3n7r3W/fbu3qnJCs1gwjKR6fOYGhBcwcRyK+A810BlLOAsvnxd1c8WoA3P1Ee7zGEm6VzxlDNqHRW1R+NI45eYpJqy8sOqJDlfYcKVjcg7CXOKxE/IAvxFJNDlxVhSWbxhkhcjtqdoDsMnwdHfbwGg+MNeNHYTeo/PqB6rjJNptEiSsUKCskxQY6ZhkNvDVMAnNSuptpwJWDVJYSCn7JLOYeqgohLMrKwXuEnjklwml3lMU1+6eipNKYpYxdp6T2wvxbq8j/1aFTYezkqu8sKDYelBaCGwzXLmHE6BWbF0gDLN3V8xu6DO+s8bpJaWPoT426+0dIf81hTvfQtXMnU54qJIgHfzdX86tnCPeW2qR0c9HrDQeVgBfrhLzD87eBprxv2u8H7QWf0dm0l2kaP0GN0gEJ0hEboDTpBE8TQNfqMvqCvje9ey9v3Hq5bvcZG8wD9FR7+Cex5uvk=</latexit> Irradiance environment map For di ff use surface, illumination integral reduces to L r = R Z L i ( l ) ( n · l ) d l π Ω This is a function only of n • so store it in a cubemap and look up using n .

  5. Irradiance environment map environment map irradiance map Gary King in GPU Gems 2 http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter10.html

  6. Irradiance map illumination McGuire et al. HPG ’11 10.1145/2018323.2018327

  7. McGuire et al. HPG ’11 10.1145/2018323.2018327 Irradiance map illumination

  8. <latexit sha1_base64="lIC2K78XcxySqv6DyL9lSW0PkUI=">ACbHicbVDtahQxFM1O/air1q36rwjBRanQ7szsbu36y4IgtWcNvCZhkymTvT0CQzJplhl6Fv5NP4T/QZxEcwM1tFxQshJ+e2/uiQvBjQ2CLx1v49r1Gzc3b3Vv37m7da+3f/E5KVmMGO5yPVZTA0IrmBmuRVwVmigMhZwGl+8avKnF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a general specular surface, approximate the BRDF by a function f r ( v , l ) ( n · l ) ≈ g σ ( l · r ) • where g defines a lobe of width σ that is symmetric around r The illumination integral is Z L r ( v ) ≈ g σ ( l · r ) L i ( l ) d l Ω This depends only on r and the scalar σ • so store it in an array of cubemaps indexed by σ , and look up using r

  9. Irradiance environment mapping Akenine-Möller et al. RTR 3e environment map prefiltered map prefiltered map for specular surface for glossy surface for diffuse surface

  10. Prefiltered environment map environment map prefiltered for Phong Gary King in GPU Gems 2 http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter10.html

  11. blitzcode.net

  12. Prefiltered map variants Many approaches to approximating the BRDF with symmetric lobes • classic is to use a single lobe, loses stretching at grazing angles • many techniques use multiple samples, similar to anisotropic texture filtering • modern thought process is to treat the whole precomputation as approximating more accurate BRDF lobes using multiple samples from arbitrary maps stored in mipmaps

  13. Manson & Sloan 2016

  14. Shadow baking Rendering with no shadows, Floor shaded with irradiance darker diffuse floor from shadow texture Irradiance texture computed using rectangular light

  15. a convex diffuse object in a constant-radiance environment

  16. a non-convex diffuse scene under constant-radiance illumination

  17. a non-convex diffuse object in a constant-radiance environment

  18. a non-convex diffuse scene under constant-radiance illumination

  19. object in a constant-radiance environment with no shadowing

  20. Akenine-Möller et al. RTR 3e

  21. AO Maps slide courtesy of Kavita Bala, Cornell University

  22. Ray traced vertex AO Kavan et al. EGSR 2011 ambient occlusion sampled at vertices, ambient occlusion sampled inside ambient occlusion computed at each interpolated as vertex color triangles, vertex values fit to samples, pixel (ground truth) interpolated as vertex color

  23. NVIDIA OptiX implementation images https://developer.nvidia.com/optix-prime-baking-sample

  24. NVIDIA OptiX implementation images https://developer.nvidia.com/optix-prime-baking-sample

  25. NVIDIA OptiX implementation images https://developer.nvidia.com/optix-prime-baking-sample

  26. EnvMap slide courtesy of Kavita Bala, Cornell University

  27. AO slide courtesy of Kavita Bala, Cornell University

  28. Total slide courtesy of Kavita Bala, Cornell University

  29. Akenine-Möller et al. RTR 3e

  30. Ambient Occlusion: Improvement • At each point find – Fraction of hemisphere that is occluded – Also, average unoccluded direction B � (bent normal) � Use B for lighting (see later) slide courtesy of Kavita Bala, Cornell University

  31. What about B? • The unoccluded direction gives an idea of where the main illumination is coming from slide courtesy of Kavita Bala, Cornell University

  32. SSAO • Restrict the hemisphere – Why? Think of AO in box • Typically add a drop-off as you get to the hemisphere boundary slide courtesy of Kavita Bala, Cornell University

  33. Crytek for Crisis: SSAO • Take z-buffer • Consider sphere around a point p – Distribute samples – Project to screen space and compare to z buffer slide courtesy of Kavita Bala, Cornell University

  34. Martin Mittring, Crysis GmBH http://crytek.com/cryengine/presentations/finding-next-gen-cryengine--2

  35. Martin Mittring, Crysis GmBH http://crytek.com/cryengine/presentations/finding-next-gen-cryengine--2

  36. Martin Mittring, Crysis GmBH http://crytek.com/cryengine/presentations/finding-next-gen-cryengine--2

  37. Hemisphere vs. Sphere John Chapman http://john-chapman-graphics.blogspot.co.uk/2013/01/ssao-tutorial.html

  38. Irradiance map + SSAO McGuire et al. HPG ’11 10.1145/2018323.2018327

  39. Irradiance map + SSAO McGuire et al. HPG ’11 10.1145/2018323.2018327

  40. McGuire et al. HPG ’11 10.1145/2018323.2018327 Irradiance map + SSAO

  41. McGuire et al. HPG ’11 10.1145/2018323.2018327 Irradiance map + SSAO

  42. slide courtesy of Kavita Bala, Cornell University

  43. slide courtesy of Kavita Bala, Cornell University

  44. slide courtesy of Kavita Bala, Cornell University

  45. slide courtesy of Kavita Bala, Cornell University

  46. slide courtesy of Kavita Bala, Cornell University

  47. slide by Frédo Durand, MIT Denoising from 1 image • We can’t take average over Noisy input multiple images

  48. slide by Frédo Durand, MIT Denoising from 1 image • We can’t take average over Noisy input multiple images • Idea 1: take a spatial average - Most pixels have roughly teh same color as their neighbor - Noise looks high frequency => do a low pass • Here: Gaussian blur

  49. slide by Frédo Durand, MIT Gaussian blur • Noise is mostly gone After Gaussian blur • But image is blurry - duh!

  50. slide by Frédo Durand, MIT adapted from slide by Frédo Durand, MIT Gaussian blur • Noise is mostly gone After Gaussian blur • But image is blurry - duh! • Question: how to blur/ smooth/abstract image, but without destroying important features?

Recommend


More recommend