1 Ray Tracing - Bounding Volumes Ray Tracing - Bounding Volumes - - PDF document

1
SMART_READER_LITE
LIVE PREVIEW

1 Ray Tracing - Bounding Volumes Ray Tracing - Bounding Volumes - - PDF document

Computer Graphics as Virtual Photography real camera photo Photographic Photography: scene (captures processing print light) Ray Tracing: Intersection processing camera Computer 3D synthetic tone model Graphics: models image


slide-1
SLIDE 1

1

Ray Tracing: Intersection

Computer Graphics as Virtual Photography

camera (captures light) synthetic image camera model (focuses simulated lighting)

processing

photo processing tone reproduction real scene 3D models Photography: Computer Graphics: Photographic print

Ray Tracing: Intersection

  • We only talked about ray intersection with spheres

and planes

  • What about?

– Boxes – Cylinders – Cones – Triangles – Spline surfaces – Irregular shapes

Ray Tracing - Object - Ray Intersection

  • For each ray, intersection test needs to be

made for each object

– This could costly if you have many

  • bjects…consider if object has n polygons, n

very large! – Solutions

  • Adaptive Depth Control
  • Bounding Volume
  • Spatial Subdivision

Ray Tracing – Adaptive Depth Control

  • Indices of diffuse/reflection/refraction get

multiplied together as the ray tracer recurses

  • Depending on material properties, this

attenuation can get very small

  • Keep running product and stop when below

a threshold

Ray Tracing - Bounding Volumes

  • Place simple objects (i.e., sphere or box)

around complex objects

– Suitability depends on object being enclosed!

  • Do initial intersection tests on bounding
  • bjects.
  • If ray intersects bounding volume, then test

complex bounded object

  • Can be nested
slide-2
SLIDE 2

2

Ray Tracing - Bounding Volumes

[Watt/Watt,235]

Ray Tracing - Bounding Volumes

[Watt/Watt,236]

Ray Tracing - Spatial Subdivision

  • Motivation

– Without spatial subdivision, for each ray, you will need to query all objects/polygons and test for intersection – With spatial subdivision, you know which

  • bjects are in each volume so you only test
  • bjects that are in the volumes where a ray is

traveling.

Ray Tracing - Spatial Subdivision

  • Subdivide your scene volume into hierarchical

regions

– Octrees – BSP Trees

  • Create a tree structure that indicates for each region:

– if the region is empty – the object present at that particular region

  • Test ray intersection with region volume

Ray Tracing - Octrees

  • Recursively subdivide volume into equal

regions.

  • If subregion is empty or contains a single
  • bject, then stop
  • Otherwise, further subdivide.
  • Continue until each subregion is empty or

contains a single object.

Ray Tracing - Octrees

[Foley/Van Dam]

slide-3
SLIDE 3

3

Ray Tracing – Oct(quad)trees

  • Subdivisions represented as a tree

[Watt/Watt,244]

Ray Tracing - Oct(quad)trees

  • Quadtree applet

http://njord.umiacs.umd.edu:1601/users/brabec/qu adtree/points/pointquad.html

Ray Tracing -- Octrees

  • Images from

http://www.flipcode.com/tutorials/tut_octrees.shtml

Ray Tracing -- Octrees Ray Tracing -- Octrees Ray Tracing -- Octrees

Shows viewing frustum and which “octants” need to be checked.

slide-4
SLIDE 4

4

Ray Tracing - BSP Trees

  • Binary Space Partitioning Trees (BSP

Trees)

– Like Octrees but divides space into a pair of subregions – Subregions need not be equally spaced – Planes separating regions can be placed at

  • bject boundaries.

Ray Tracing - Spatial Subdivision

  • Octrees vs BSP Trees

[Watt/Watt,246]

Ray Tracing - BSP Trees

  • BSP Trees – Each non-terminal node represents a single

partitioning plane that divides space in two

[Watt/Watt,247]

Ray Tracing - BSP Trees

  • BSPTree applet

http://symbolcraft.com/graphics/bsp/index.html

Ray Tracing - Spatial Subdivision

  • Advantages

– Efficient means for finding objects within your space – Compact representation

  • Disadvantages

– Preprocessing required – If scene changes, must rebuild your tree – Not foolproof

Ray Tracing - Spatial Subdivision

  • Potential Problems - can double testing or miss small items

[Watt/Watt,247]

slide-5
SLIDE 5

5

Ray Tracing - Spatial Subdivision

  • Octrees vs BSP trees

– BSP Trees are generally more balanced than Octrees – BSP Traversal more efficient – BSP Trees have additional storage overhead as must store subdivision planes