CS 655 Computer Graphics - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

CS 655 Computer Graphics

Description:

There are combined radiosity/ray tracing approaches to global illumination, as ... to Ls(x,Yr), the surface radiance leaving point x in the direction of the ray Yr. ... – PowerPoint PPT presentation

Number of Views:15
Avg rating:3.0/5.0
Slides: 22
Provided by: cs6
Category:

less

Transcript and Presenter's Notes

Title: CS 655 Computer Graphics


1
CS 655 Computer Graphics
  • Photon Mapping

2
Photon Mapping
  • Photon mapping is a a technique for simulating
    global illumination.
  • There are combined radiosity/ray tracing
    approaches to global illumination, as well as
    stochastic techniques (e.g. path tracing)
  • Ray tracing extended with Monte Carlo techniques
  • Very time consuming.
  • Noisy results.
  • Radiosity extended with directional capabilities
  • Requires too much storage.
  • Doesnt handle specular reflections correctly.

3
Photon Mapping
  • Idea
  • Photons are emitted from light sources.
  • Each photon is traced through the scene using
    path tracing.
  • Every time a photon hits a surface it is stored
    in the photon map.
  • Photons are either absorbed or reflected.
  • Reflected photon directions are computed using
    the BRDF of the surface.
  • After the photon map is created, the scene is ray
    traced.
  • The photon map information is used by the ray
    tracer.

4
Photon Mapping
  • Constructing the Photon Map
  • The photon map is created in the first pass.
  • Two photon maps are kept the caustics photon
    map and the global photon map.
  • The Caustics Photon Map
  • Used to store photons corresponding to caustics.
  • Created by emitting photons toward specular
    objects and storing these as they hit diffuse
    surfaces.
  • Requires a high density of photons.

5
Photon Mapping
  • The Global Photon Map
  • Created by emitting photons towards all objects.
  • Doesnt require as much precision as caustics
    map.
  • Shadow photons are created by tracing rays from
    the light source through the scene, and keeping
    track of shadow information.
  • The shadow photons are later used to reduce
    shadow rays.
  • Photons are stored in a balanced kd-tree. This
    provides efficiency (O(M log2 N) to locate M
    photons in a tree with N photons).
  • Each photon is represented with 20 bytes.

6
Photon Mapping
  • Pass 2 Rendering
  • Rendering is done using Monte Carlo ray tracing.
  • Pixel intensities are the average of the sample
    rays sent through the pixel.
  • The radiance returned by each ray is computed at
    the first surface intersected, and is equal to
    Ls(x,Yr), the surface radiance leaving point x in
    the direction of the ray Yr.

7
Photon Mapping
  • Pass 2 Rendering (cont)
  • Ls(x,Yr) is computed using the rendering
    equation
  • where
  • Le is the radiance emitted by the surface and is
    taken directly from the surface definition.
  • Li is the incoming radiance in the direction Yi.
  • fr is the BRDF.
  • Lr is the integral portion of the equation.

8
Photon Mapping
  • Pass 2 Rendering (cont)
  • The value of the integral, Lr, can be solved
    using path tracing, but this is expensive.
    Instead, the photon map is used.
  • Lr is split into several components
  • where
  • Li,1 represents contributions from the light
    sources.
  • Li,c represents contributions from the light
    sources via specular reflection (caustics).
  • Li,d represents light which has been reflected
    diffusely at least once (indirect soft
    illumination).
  • Li Li,1 Li,c Li,d .

9
Photon Mapping
  • Pass 2 Rendering (cont)
  • The BRDF is separated into diffuse and specular
    components
  • fr,s represents the specular component of the
    BRDF.
  • fr,d represents the diffuse component of the
    BRDF.
  • fr fr,s fr,d .
  • The integral is computed in two different ways
  • Accurate computation used
  • When the surface is seen directly by the eye.
  • Within a few specular reflections.
  • When the distance between the ray origin and
    intersection point is small.
  • Approximate evaluation used
  • When the ray has been reflected diffusely.
  • If the weight of the ray is low.

10
Photon Mapping
  • Pass 2 Rendering (cont)
  • The pieces of the equation
  • The contribution via direct illumination by the
    light sources.
  • Computed by using the shadow information in the
    shadow map.
  • The radiance reflected off specular surfaces.
  • Computed using standard Monte Carlo ray
    tracing.
  • Caustics on diffuse surfaces.
  • Computed using the caustic photon map.

11
Photon Mapping
  • Pass 2 Rendering (cont)
  • The pieces of the equation (cont)
  • Incoming light which has been reflected diffusely
    at least once.
  • Computed using the global photon map.

12
Photon Mapping
  • Pass 2 Rendering (cont)
  • Estimating Radiance using the Photon Map
  • The photon map can be used to compute the
    radiance leaving a surface in a given direction.
  • Works well with diffuse to slightly glossy
    surfaces.
  • For highly glossy surfaces, lots of photons would
    be needed.
  • To compute the radiance, Lr, leaving an
    intersection point x at a surface with BRDF fr
  • Find the N photons with the shortest distance to
    x.
  • Each photon p represents flux DFp arriving at x
    from direction Yi,p.
  • Putting this into the rendering equation we
    get
  • Center a sphere at x and expand until it contains
    N photons and has radius r. The area is then
    approximated with pr2.

13
Photon Mapping
  • Data structure
  • Struct photon long energy // packed
    energy (RGB) float position3 // photon
    position float theta, phi // photon
    direction char normal3 // surface normal
    char key // kd-tree parameter struct
    photon left, right // rest of kd-tree

14
Photon Mapping
  • Advantages of Photon Mapping
  • Can be implemented into traditional ray tracers
    by adding an additional module to the existing
    code.
  • Photon maps are geometry independent.
    Calculation time for the maps is generally low,
    allowing an efficient method to recalculate maps
    during animated scenes.
  • Results are comparable to or better than
    combination radiosity/ray tracing methods, and it
    is much more efficient.
  • Photon mapping also reduces shadow ray
    computation by marking shadow photons.
  • Caustics can be realized directly by using a
    separate photon map with higher density.

15
Photon Mapping
16
Photon Mapping
  • An example
  • Museum
  • 5000 polygons and spheres.
  • 1 procedural object.
  • Two small spherical area light sources.
  • 390,000 caustic photons.
  • 165,000 global photons (9 MB).
  • 298 seconds for 1st pass, 51 minutes for 2nd.
  • Contains
  • Caustics from glass onto rough surface.
  • Caustics from cylinder to wall.
  • Color bleeding between walls.

17
Photon Mapping
18
Photon Mapping
19
Photon Mapping
 
20
Photon Mapping
 
21
Photon Mapping
 
Write a Comment
User Comments (0)
About PowerShow.com