dynamic shadows and lighting for walkthrus of large models

15
1 Dynamic Shadows and Lighting for Walkthrus of Large Models Brandon Lloyd COMP 258 December 2002

Upload: asasia

Post on 25-Feb-2016

32 views

Category:

Documents


1 download

DESCRIPTION

Dynamic Shadows and Lighting for Walkthrus of Large Models. Brandon Lloyd COMP 258 December 2002. Why Are Shadows Important?. Why Are Shadows Important?. Shadow Maps. Eye. Light. Shadow Maps. Advantages Only one additional render pass Very easy to use Disadvantages Aliasing problems - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Dynamic Shadows and Lighting for Walkthrus of Large Models

1

Dynamic Shadows and Lighting for Walkthrus of Large Models

Brandon Lloyd

COMP 258December 2002

Page 2: Dynamic Shadows and Lighting for Walkthrus of Large Models

2

Why Are Shadows Important?

Page 3: Dynamic Shadows and Lighting for Walkthrus of Large Models

3

Why Are Shadows Important?

Page 4: Dynamic Shadows and Lighting for Walkthrus of Large Models

4

Shadow Maps

Eye Light

Page 5: Dynamic Shadows and Lighting for Walkthrus of Large Models

5

Shadow Maps

• Advantages– Only one additional

render pass– Very easy to use

• Disadvantages– Aliasing problems– Resolution restricted to

available memory– Requires a user-set bias.

Page 6: Dynamic Shadows and Lighting for Walkthrus of Large Models

6

Perspective Shadow Maps

• Better utilizes available samples by warping depth map

• Find the volume that can contribute shadows to the view

• Fit light frustum to the volume in camera’s post-perspective space

• Render depth map in camera’s post-perspective space.

Perspective

Page 7: Dynamic Shadows and Lighting for Walkthrus of Large Models

7

Perspective Shadow Maps

Standard Shadow Map Perspective Shadow Map

Page 8: Dynamic Shadows and Lighting for Walkthrus of Large Models

8

Perspective Shadow Maps

Standard Shadow Map Perspective Shadow Map

Page 9: Dynamic Shadows and Lighting for Walkthrus of Large Models

9

Perspective Shadow Maps

Standard Shadow Maps Perspective Shadow Maps

Page 10: Dynamic Shadows and Lighting for Walkthrus of Large Models

10

Benefits of Using Cg

Page 11: Dynamic Shadows and Lighting for Walkthrus of Large Models

11

Benefits of Using Cg

Page 12: Dynamic Shadows and Lighting for Walkthrus of Large Models

12

Shadow Volumes

0

1 12 2

1

0

• Extrude shadow frusta from occluder edges to infinity

• Count crossings from eye to a point: – Front faces: +1– Back faces: -1

• If crossings > 0 then point is in shadow

Page 13: Dynamic Shadows and Lighting for Walkthrus of Large Models

13

Shadow Volumes

• Advantages:– No aliasing. Crisp

shadow edges– Can be done on

commodity hardware– Light need not be

restricted to a frustum

Page 14: Dynamic Shadows and Lighting for Walkthrus of Large Models

14

Shadow Volumes

• Advantages:– No aliasing. Crisp

shadow edges– Can be done on

commodity hardware– Light need not be

restricted to a frustum• Disadvantages:

– Needs CPU– FILL!!! 4.8 billion pixels per

second / (1024 * 1024 ) 4600 screen fills per second

Page 15: Dynamic Shadows and Lighting for Walkthrus of Large Models

15

Possible Solutions

• Calculate intersection of shadow frusta with object bounding boxes

• Utilize CPU to calculate shadow polygons– Use GPUs to obtain visible set from eye and light– Intersect each eye polygon with overlapping light

frusta– Use stencil to fuse shadow polygons