1 / 10

Shadows

Shadows. CS418 Computer Graphics John C. Hart. Shadowing. Shadows indicate light occlusion Fix object positions relative to each other. Perspective Distortion. screen. y. y view. y clip. -z. z view. 1. Shadow Buffer. Williams, SIGGRAPH 78 Render scene twice from viewpoint

nuwa
Download Presentation

Shadows

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 CS418 Computer Graphics John C. Hart

  2. Shadowing • Shadows indicate light occlusion • Fix object positions relative to each other

  3. Perspective Distortion screen y yview yclip -z zview 1

  4. Shadow Buffer • Williams, SIGGRAPH 78 • Render scene twice from viewpoint (x,y,z)screen = WPV(x,y,z)world • Once with light source on • Once only with ambient • Save a z-buffer • Render scene from light position (x,y,z)light= WlPlVl(x,y,z)world • Save only z-buffer • For each viewpoint image pixel compute (x,y,z)vis=WlPlVl V-1P-1W-1 (x,y,z)screen • If zvis < zlight at (x,y)vis= (x,y)light • Then pixel is in shadow RGB Depth Viewpoint Light Position

  5. Shadow Buffer • Williams, SIGGRAPH 78 • Render scene twice from viewpoint (x,y,z)screen = WPV(x,y,z)world • Once with light source on • Once only with ambient • Save a z-buffer • Render scene from light position (x,y,z)light= WlPlVl(x,y,z)world • Save only z-buffer • For each viewpoint image pixel compute (x,y,z)vis=WlPlVl V-1P-1W-1 (x,y,z)screen • If zvis < zlight at (x,y)vis= (x,y)light • Then pixel is in shadow

  6. Shadow Buffer • Williams, SIGGRAPH 78 • Render scene twice from viewpoint (x,y,z)screen = WPV(x,y,z)world • Once with light source on • Once only with ambient • Save a z-buffer • Render scene from light position (x,y,z)light= WlPlVl(x,y,z)world • Save only z-buffer • For each viewpoint image pixel compute (x,y,z)vis=WlPlVl V-1P-1W-1 (x,y,z)screen • If zvis < zlight at (x,y)vis= (x,y)light • Then pixel is in shadow

  7. Shadow Buffer • Williams, SIGGRAPH 78 • Render scene twice from viewpoint (x,y,z)screen = WPV(x,y,z)world • Once with light source on • Once only with ambient • Save a z-buffer • Render scene from light position (x,y,z)light= WlPlVl(x,y,z)world • Save only z-buffer • For each viewpoint image pixel compute (x,y,z)vis=WlPlVl V-1P-1W-1 (x,y,z)screen • If zvis < zlight at (x,y)vis= (x,y)light • Then pixel is in shadow

  8. Shadow Buffer • Williams, SIGGRAPH 78 • Render scene twice from viewpoint (x,y,z)screen = WPV(x,y,z)world • Once with light source on • Once only with ambient • Save a z-buffer • Render scene from light position (x,y,z)light= WlPlVl(x,y,z)world • Save only z-buffer • For each viewpoint image pixel compute (x,y,z)vis=WlPlVl V-1P-1W-1 (x,y,z)screen • If zvis < zlight at (x,y)vis= (x,y)light • Then pixel is in shadow

  9. Numerical Analysis

  10. Percentage Closer Filtering • Reeves, Salesin, Cook, SIGGRAPH 87 • Shadow aliasing occurs when numerical inaccuracy and discretization causes sample to compare to the wrong depth near an edge • Can be fixed by comparing sample in a neighborhood (e.g. 3x3 pixels) and filtering the binary shadow answer • Can also be extended to generate soft shadows

More Related