1 / 21

Shadows & occlusion

Shadows & occlusion. Shadow - occlusion duality Floor shadows Shadow buffer Soft shadows From point visibility Convex occluders Occluder fusion Cell-to-cell visibility. Lecture Objectives. Why study visibility and shadows? Define terminology Hidden, detected, guarded, clear

dick
Download Presentation

Shadows & occlusion

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. Shadows & occlusion • Shadow - occlusion duality • Floor shadows • Shadow buffer • Soft shadows • From point visibility • Convex occluders • Occluder fusion • Cell-to-cell visibility

  2. Lecture Objectives • Why study visibility and shadows? • Define terminology • Hidden, detected, guarded, clear • From-point and from-cell visibility • Shadow region, umbra, penumbra • Understand principles, properties, proofs • Occlusion by a triangle • Testing against convex occluders • Apparent convexity and hoops • Occluder fusion • Umbra and penumbra of convex occluders • Clarify relation between visibility and shadows • Relate and motivate from-point and from-cell visibility • Conservative & approximate from-point visibility algorithms • Conservative & approximate from-cell visibility algorithms • Relation to shadows, umbra, penumbra

  3. Motivation • Visibility • Most objects in a scene are hidden from any given view point • Rendering them wastes GPU cycles • Need efficient techniques for rejecting what is obviously hidden • Rejection tests can be exact, conservative (reject more), approximate • Shadows • Objects in the shadow do not reflect direct illumination • Want to know which light sources illuminate an object • Need a quick test for being in the shadow • Visibility and shadows are defined in terms of occluders • Surfaces or objects that may block the passage of light • When placed between the object and the viewer/light

  4. Shadows provide depth clues

  5. 4x4 matrix formulation (review) S(u,v,w) T(u,v,w) R(U,V,W) RZ(a) = M•P

  6. Rotation matrix • ||U||=||V||=1 • U•V = 0 • W=UV • R = { U V W }, 3x3 matrix • R’ = R, inverse = transpose • Rotation to map Z to W • U:=YW or XW • U:=U/||U|| • V:=WxU • RZtoW={ U V W } • Rotation to map W to Z axis • RZtoW inverse R R’

  7. Floor shadow • Compute the shadow S of point P on the floor (z=0) with light coming in direction L P L S = P + (Pz/Lz) L Write the shadow projection as a 4x4 matrix S

  8. Floor shadows • Depth cue, realism, light position • Draw object twice • Second time: projected on the ground • Does not support self-shadows P L S = P + (Pz/Lz) L Durand&Cutler, MIT

  9. Aliasing Shadow-castikng fragments must be in light frustum E Shadow map (supports self-shadows) • Pre-render from light : store z-buffer as shadow map (texture) • While rendering, check whether fragments are in shadow • Use GPU to perform the check (compare z to texture)

  10. Shadow volumes on GPU • Heidmann (IRIS Universe 1991), Everitt (nVidia 2002) • Shadow volume = triangles facing light + silhouette extrusions • Brabec-Seidel (EUROGRAPHICS 2003) • Add silhouette identification in hardware

  11. point source area source umbra penumbra umbra Soft shadows (area light sources) • Polygonal area light source Polygons cast curved shadows Assarsson et al.

  12. point source area source umbra penumbra umbra Hard vs. soft shadows

  13. How can we compute (pen)umbras? • Difficult because they involve cells of 3D space partition by planes and curved surfaces (even if the shape and light source is polygonal)

  14. Polygons cast curved shadows!

  15. Soft Shadow volumes • Using graphics hardware Ulf Assarsson1, Michael Dougherty2, Michael Mounier2, and Tomas Akenine-Möller1 1Department of Computer Engineering Chalmers University of Technology 2Xbox Advanced Technology Group,Microsoft

  16. Shadow Volume • A wedge for each “silhouette” edge

  17. Rasterize the edges

  18. Results • www.ce.chalmers.se/staff/tomasm/soft/

  19. Texture Map • Glue a picture on a surface • Associate with each vertex P the (u,v) coordinate of the corresponding pixel in the image Express P in the camera coordinate system P P’ Use the perspective to get P’ v C u Camera parameters for the picture E

  20. Shadow buffer • Pre-compute z-buffer for scene from the position of the light source • As you rasterize a point on a triangle, check whether it is visible from the light • Compute its P’ in the perspective-transformed space of the camera • Check whether Z[P’X,P’Y] < P’Z E

  21. Shadow map • From Durand & Cutler

More Related