1 / 32

Shadowing

Shadowing. SET09115 Intro Graphics Programming. Breakdown. Basics Occluders and receivers Types of shadows General Techniques Blob shadows Multiple point lights Other Techniques Using textures Volumetric shadowing. Recommended Reading. Real-Time Rendering

daxia
Download Presentation

Shadowing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Shadowing SET09115 Intro Graphics Programming

  2. Breakdown • Basics • Occluders and receivers • Types of shadows • General Techniques • Blob shadows • Multiple point lights • Other Techniques • Using textures • Volumetric shadowing

  3. Recommended Reading • Real-Time Rendering • Chapter 9 is about global illumination • Section 9.1 about shadowing • Section 9.2 about ambient occlusion • Not covering in lecture

  4. Basics

  5. Why do we mean by Shadowing? • Shadowing is when we add to a rendered scene darkened areas to imply the occlusion of light • Something in the scene is blocking the current lighting model from fully illuminating a particular area • Shadowing is essentially the removal of light from a scene • Actually, shadowing in rendering is the adding of dark area to a normally rendered lit scene

  6. Example

  7. Why do we want Shadowing? • Shadowing adds realism to a rendered scene • Up until now, we have used lighting and texturing to add realism • Any 3D scene without shadowing looks wrong, artificial • Goal of any 3D rendering is to look correct, real even if cheating • Shadowing can also be a gameplay feature

  8. Example • Splinter Cell • http://www.youtube.com/watch?v=gaRN5Dr_jBI • Thief • http://www.youtube.com/watch?v=AP8EyFmWg44

  9. Occluders and Receivers • A shadow is created when a light source is occluded on a surface • There are three parts to consider • The light source • The occluder • The receiver

  10. Types of Shadows • There are two types of shadows that can form part of a scene • Hard Shadows • Soft Shadows • Our task is to add the correct type of shadowing, and in a realistic manner • This can be complicated

  11. Hard Shadows • Hard shadows are those caused by point lights • Have definite outlines • Have a single uniform colour • Quite easy to work out in relation to soft shadows

  12. Soft Shadows • Soft shadows are caused by other lighting mechanisms • Area lights • Light volumes • Soft shadows have a blurring effect at the edges • Difficult to get right • And expensive

  13. Umbra and Penumbra • A soft shadow is made of two parts • Umbra • Penumbra • The hard shadow is not the umbra • Light changes based on size of light

  14. Questions?

  15. General Techniques

  16. Shadow Blobs • The simplest technique for shadowing is to project a blob onto the ground plane • Size of blob changes based on distance • Eye is quite forgiving, and will accept this as a reasonable shadow

  17. Example • Super Mario 64 • http://www.youtube.com/watch?v=DTzs9bcNgMQ

  18. Planar Shadows • A better technique is to do a two stage render • Shadow pass renders a projection onto a plane • Shadow is rendered onto the ground plane

  19. Example • Oblivion • http://www.youtube.com/watch?v=OBbW86Hl7wI

  20. Light Viewer • Another technique is to perform a render pass using the light’s position as the render position • Generate the depth map from this render pass • Use this depth map to determine what parts of the scene are to be shadowed • This provides a similar approach to standard projection lighting

  21. Multiple Point Lights • Another common technique • Soft shadows can be created by using multiple point lights in a scene • Each point light creates a shadow • Shadows are accumulated and then used in the final render

  22. Questions?

  23. Other Techniques

  24. Using Textures • We can do some pre-processing and work out light maps for a scene • Pre-process as in before running the application • Much faster than using real-time, dynamic shadows

  25. Using Textures • When performing a render, we can generate the shadow map during the shadowing stage • For fixed scenes, these shadow maps can be reused • Pre-process

  26. Stencil Buffer • Buffer commonly used for shadowing techniques • Stencil buffer is another per-pixel buffer, similar to the depth buffer • The information contained in the stencil buffer can be set for various uses • Number of failed pixel writes due to occlusion • Simplest use of the stencil buffer is to determine which areas cannot be rendered to during a render pass • For example shadowed regions

  27. Volumetric Shadows • Volumetric shadows are one of the techniques used by the stencil buffer • The stencil buffer can be incremented based on depth information when renders are performed

  28. Example

  29. Good Shadowing • http://www.youtube.com/watch?v=PjqsYzBrP-M

  30. Questions?

  31. To do this week… • I’m not going to produce a practical for this week or next • Concentrate on the coursework • I will put the practicals together and post on WebCT over the next few weeks • So you can see what to do • I’ve added some new geometry code to WebCT • Drawing spheres and torus’ for lighting and texturing

  32. Summary • Shadowing is another technique for adding realism • And another technique where we cheat to gain realism • We have only really scratched the surface with techniques here • Read Real-Time Rendering if you are interested • Maths is in there as well • We aren’t looking at shadowing as part of the assessment • We will be impressed if you add it though

More Related