image formation

18
Raycasting (animated gif)

Upload: nehru-richardson

Post on 02-Jan-2016

16 views

Category:

Documents


0 download

DESCRIPTION

Image Formation. (Forward) Ray Tracing. (Backward) Ray Tracing. When the ray hits an object, a secondary ray, ("shadow" ray), is shot towards the light sources. Shadow Ray. Determine if that point on the object is in a shadow. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Image Formation

Raycasting (animated gif)

Page 2: Image Formation

Image Formation

(Forward) Ray Tracing (Backward) Ray Tracing

Page 3: Image Formation

Shadow RayWhen the ray hits an object, a secondary ray, ("shadow" ray), is shot towards the light sources

Determine if that point on the object is in a shadow.

If this shadow ray hits another object before it hits a light source, then the first intersection point is in the shadow of the second object. Only apply the ambient term for that light source at the point of intersection

Page 4: Image Formation

Reflected RayWhen a ray hits an object, a reflected ray is generated and tested against all of the objects in the scene.

If the reflected ray hits an object then a local illumination model is applied at the point of intersection and the result is carried back to the first intersection point.

Page 5: Image Formation

Transmitted RayIf the intersected object is transparent, then a transmitted ray is generated and tested against all the objects in the scene.

If the transmitted ray hits an object then a local illumination model is applied at the point of intersection and the result is carried back to the first intersection point.

Page 6: Image Formation

Ray TreeThe reflective and/or transmitted rays are continually generated until the ray leaves the scene without hitting any object or a preset recursion level has been reached. This then generates a ray tree.

DEMO

Page 7: Image Formation
Page 8: Image Formation

Example

Page 9: Image Formation

Ray Trace vs. Rasterization

Page 10: Image Formation

AABB tree

Page 11: Image Formation

How can AABB Tree Help Tracing

Page 12: Image Formation

Fast Ray-AABB Overlap Tests with Plucker Coordinates

Mahovsky and Wyvill [2003]

Page 13: Image Formation

Standard MethodRay (O,D)

y=y0

y=y1

y

y

d

oyt

0

0

?

?

0y

tdo

tdo

tdo

d

d

d

t

o

o

o

zz

yy

xx

z

y

x

z

y

x

y

y

d

oyt

1

1Similarly,

Page 14: Image Formation

],[

],[

],[

10

10

10

uuzslabray

ttyslabray

ssxslabray

0

t

0

t

],[],[],[ 101010 uuttssAABBray

Page 15: Image Formation

Ray vs. Directed Line

CW

CCW

Here, it is looking from the head of ray

Page 16: Image Formation

Ray-Polygon Intersection with Plucker Coordinates

Page 17: Image Formation

MMM Ray vs. AABBRepresent a line this way … is the Plucker coordinate way

(MMM: minus,minus,minus)

x

z

Page 18: Image Formation

Hw: XXX Ray vs. AABB

想想若是 ray來自其他方位,該如何測試 ?