Shadows in computer graphics ppt

formation of shadows ppt and how are shadows made ppt
Dr.ShaneMatts Profile Pic
Dr.ShaneMatts,United States,Teacher
Published Date:23-07-2017
Your Website URL(Optional)
Comment
MIT EECS 6.837 Computer Graphics Wojciech Matusik A cartoon has been removed due to copyright restrictions. Real-Time Shadows MIT EECS 6.837 – Durand 1 Why are Shadows Important? • Depth cue • Scene Lighting • Realism • Contact Image removed due to copyright restrictions. points 2 Shadows as a Depth Cue © source unknown. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. 3 Shadows as the Origin of Painting © source unknown. All rights reserved. This content is excluded from our Creative This image is in the public domain. Author: David Allan (744-1796). Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. 4 Shadow in Ray Tracing • Trace secondary (shadow) rays towards each light source • If the closest hit point is smaller than the distance to the light then the point is in shadow 5 Today • Shadow Maps – Shadow/View Duality – Texture Mapping • Shadow Volumes • Deep Shadow Maps • Alias-free Shadow Maps 6 Shadow Maps Are Important • Both in high-end production software... – Pixar’s RenderMan • ... and in real-time rendering (e.g. games) © source unknown. All rights reserved. This content is © Pixar. All rights reserved. This content is excluded from our Creative Commons excluded from our Creative Commons license. For more license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. information, see http://ocw.mit.edu/help/faq-fair-use/. 7 Shadow/View Duality • A point is lit if it is visible from the light source • Shadow computation similar to view computation 8 Shadow Mapping • Texture mapping with depth information • 2 passes – Compute shadow map == depth from light source • You can think of it as a z-buffer as seen from the light – Render final image, check shadow map © Addison-Wesley. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. to see if points are Foley et al. “Computer Graphics Principles and in shadow Practice” 9 Shadow Map Look Up • We have a 3D point (x,y,z) WS • How do we look up the depth from the shadow map? (x',y',z') (x,y,z) LS WS • Use the 4x4 perspective projection matrix from the light source to get (x',y',z') LS • ShadowMap(x',y') z'? © Addison-Wesley. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. Foley et al. “Computer Graphics Principles and 10 Practice” Shadow Map Look Up Questions? • We have a 3D point (x,y,z) WS • How do we look up the depth from the shadow map? (x',y',z') (x,y,z) LS WS • Use the 4x4 perspective projection matrix from the light source to get (x',y',z') LS • ShadowMap(x',y') z'? © Addison-Wesley. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. Foley et al. “Computer Graphics Principles and 11 Practice” Limitations of Shadow Maps 1. Field of View 2. Bias (Epsilon) 3. Aliasing © Addison-Wesley. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. 12 1. Field of View Problem • What if point to shadow is outside field of view of shadow map? – Use 6 shadow maps on the faces of a cube – ... or use only spot lights © Addison-Wesley. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. 13 2. The Bias (Epsilon) Nightmare • For a point visible from the light source ShadowMap(x’,y’)  z’ – But due to rounding errors the depths never agree exactly • How can we avoid erroneous self-shadowing? – Add bias (epsilon) © Addison-Wesley. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. 14 2. Bias (Epsilon) for Shadow Maps ShadowMap(x’,y’) + bias z’ Choosing a good bias value can be very tricky Correct image Not enough bias Way too much bias (“surface acne”) 15 3. Shadow Map Aliasing • Under-sampling of the shadow map – Jagged shadow edges 16 3. Shadow Map Filtering • Should we filter the depth? (weighted average of neighboring depth values) • No... filtering depth is not meaningful Surface at z = 49.8 50.2 50.0 50.0 49.8? X Filter Compare 22.9 1 50.1 1.2 1.1 1.3 1.4 1.2 Ordinary texture map filtering. Does not work for depth maps. Image by MIT OpenCourseWare. 17 3. Percentage Closer Filtering • Instead we need to filter the result of the shadow test (weighted average of comparison results) Surface at z = 49.8 50.2 50.0 50.0 0 0 0 49.8? X Compare Filter 0.55 0 1 1 50.1 1.2 1.1 1 1 1 1.3 1.4 1.2 Sample transform step Image by MIT OpenCourseWare. 18 3. Percentage Closer Filtering • 5x5 samples • Nice antialiased shadow • Using a bigger filter produces fake soft shadows • Setting bias is tricky 19 3. Percentage Closer Filtering • 5x5 samples • Nice antialiased shadow • Using a bigger filter produces fake soft shadows • Setting bias is tricky Questions? 20

Advise: Why You Wasting Money in Costly SEO Tools, Use World's Best Free SEO Tool Ubersuggest.