1 Octrees Spatial Subdivision Subdivision algorithm Volume is - - PDF document

1
SMART_READER_LITE
LIVE PREVIEW

1 Octrees Spatial Subdivision Subdivision algorithm Volume is - - PDF document

Photon Mapping Combines backward/ reverse ray tracing Photon Mapping with stochastic ray tracing Used to simulate the interaction of light with a variety transparent substances (caustics) Glass Water Diffuse


slide-1
SLIDE 1

1

Photon Mapping

Photon Mapping

 Combines “backward”/ “reverse” ray tracing

with stochastic ray tracing

 Used to simulate the interaction of light with

a variety transparent substances (caustics)

 Glass  Water  Diffuse Inter-reflections between illuminated

  • bjects

 Effects of particulate matter

 Smoke  Water vapor

Photon Mapping - Motivation

Without With

Photon Mapping

 Henrik Wann Jensen 95/96  Simulates the transport of individual photons

emitted from light sources

 Photons bounce off specular surfaces  Photons deposited on diffuse surfaces  Photons collected by ray tracing from eye  http://www.ypoart.com/

Spatial Subdivision

 The collected photons will need to be

stored in an efficient, 3D accessible data structure

 Spatial subdivision algorithms subdivide

the 3D space for quick and easy query.

Spatial Subdivision

 Subdivide your scene volume into hierarchical regions

 Octrees  BSP Trees  K-D Trees

 Create a tree structure that indicates for each region:

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

 Used in

 Ray Tracing  Collision detection (animation)  Photon Mapping

slide-2
SLIDE 2

2

Spatial Subdivision

 Subdivision algorithm

 Recursively subdivide volume  If subregion is empty or contains a predefined #

  • f objects, then stop

 Otherwise, further subdivide.

 Continue until each subregion is empty or

contains a predefined #of objects.

 Use tree to represent subdivision hierarchy

Octrees

 Volume is subdivided into 4 equal

regions.

 Each iteration results in 8 subdivisions.

Octrees

[Foley/Van Dam]

Oct(quad)trees

 Subdivisions represented as a tree [Watt/Watt,244]

Oct(quad)trees

 Quadtree applet

http://njord.umiacs.umd.edu:1601/users/brab ec/quadtree/points/pointquad.html

Octrees

 Images from http://www.flipcode.com/tutorials/tut_octrees.shtml

slide-3
SLIDE 3

3 Octrees Octrees BSP Trees

 Binary Space Partitioning Trees (BSP

Trees)

 Like Octrees but divides space into a pair

  • f subregions

 Subregions need not be equally spaced  Planes separating regions can be placed at

  • bject boundaries.

Spatial Subdivision

 Octrees vs BSP Trees [Watt/Watt,246]

BSP Trees

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

partitioning plane that divides space in two

[Watt/Watt,247 ]

K-d Trees

 K-d Tree is a BSP where dividing planes

are axis aligned

 K-d Tree applet

http://donar.umiacs.umd.edu/quadtree/ points/kdtree.html

slide-4
SLIDE 4

4

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

Spatial Subdivision

 Octrees vs BSP trees

 BSP Trees are generally more balanced

than Octrees

 BSP Traversal more efficient  BSP Trees have additional storage

  • verhead as must store subdivision planes

 Now back to photon mapping

Photon Mapping

 Pass 1 – Shoot and Store Photons

 photons are shot from the light into the

scene.

 Photons are allowed to interact with

  • bjects in the environment

 Where photons fall are stored in a special

data structure called a “photon map”

 1000s of photons not billions

 Statistical approximation based on density

Photon Mapping

 Shooting photons

point directional square general [Jensen 2002]

Photon Mapping

 Photon Scattering

[Jensen 2002]

Photon Map

 The photon  Placed in k-d tree for efficient access

slide-5
SLIDE 5

5 Photon Mapping

 Pass 2 – Gather illumination

 Use ray tracing  Direct illumination determined by ray

tracing

 Indirect illumination determined by

stochastically sampling photon map

 Gather photon within a volume in the required

direction.

Monte Carlo methods

 Driven by chance / randomness  Rendering and Monte Carlo

 Multiple rays per pixel

 See how many reach a light

 Multiple rays from light

 See how many reach the eye

 Photon Mapping

 Goes from both sides

Photon Mapping - Caustics

 Pattern of light focused on a surface after

having original light path bent by intermediate surface.

[Jensen]

Caustics

Reflective caustics Refractive caustics Yves Poissant

Photon Mapping

 Three separate photon maps

 Global – photon emitted toward all objects  Caustics – specular to diffuse interactions  Volume – for volumetric effects

Photon Mapping

caustic global

slide-6
SLIDE 6

6 Example

[Jensen 1996]

Example -- Caustics

[Jensen 1996]

The Light of Mies van der Rohe

2000ET

Photon Mapping in real time

 But doesn’t this take a long time.

 No, grasshopper…not with GPUs…  Let’s go to the video.

Want to learn more? Summary

 Fixing ray tracing

 Spawning complex structures (cones,

cylinders, etc.)

 Stochastic sampling (distributed ray

tracing, monte carlo)

 “backwards” ray tracing (Photon Mapping)

 Questions