CPSC 441 Computer Graphics: Photon Mapping - PowerPoint PPT Presentation

1 / 76
About This Presentation
Title:

CPSC 441 Computer Graphics: Photon Mapping

Description:

Start with a camera, light(s), and geometry in scene. Send rays from camera into scene ... Evaluation of the Specular and Glossy term ... – PowerPoint PPT presentation

Number of Views:77
Avg rating:3.0/5.0
Slides: 77
Provided by: jch63
Category:

less

Transcript and Presenter's Notes

Title: CPSC 441 Computer Graphics: Photon Mapping


1
CPSC 441 Computer Graphics Photon Mapping
  • Jinxiang Chai

2
Review Ray Tracing
  • Start with a camera, light(s), and geometry in
    scene
  • Send rays from camera into scene
  • Through pixels on image plane
  • When intersection occurs
  • Solve for Phong reflection model at p
  • Shadow Rays
  • Transmission Rays
  • Reflection Rays
  • Recurse

3
Review Recursive Ray Tracing
3
L1
L2
4
1
2
4
Review Ray Tracing
  • Start with a camera, light(s), and geometry in
    scene
  • Send rays from camera into scene
  • Through pixels on image plane
  • When intersection occurs
  • Solve for Phong reflection model at p
  • Shadow Rays
  • Transmission Rays
  • Reflection Rays
  • Recurse

5
Review Recursive Ray Tracing
3
L1
L2
4
1
2
6
Review Ray Tracing
  • Start with a camera, light(s), and geometry in
    scene
  • Send rays from camera into scene
  • Through pixels on image plane
  • When intersection occurs
  • Solve for Phong reflection model at p
  • Shadow Rays
  • Transmission Rays
  • Reflection Rays
  • Recurse

7
Review Recursive Ray Tracing
3
L1
L2
4
1
2
8
Review Recursive Ray Tracing
3
L1
L2
4
1
2
9
Review Recursive Ray Tracing
3
L1
L2
4
1
2
10
Review Recursive Ray Tracing
3
L1
L2
4
1
2
11
Review Recursive Ray Tracing
3
L1
L2
4
1
2
12
Review Ray Tracing
  • Start with a camera, light(s), and geometry in
    scene
  • Send rays from camera into scene
  • Through pixels on image plane
  • When intersection occurs
  • Solve for Phong reflection model at p
  • Shadow Rays
  • Transmission Rays
  • Reflection Rays
  • Recurse

13
Review Recursive Ray Tracing
3
L1
L2
4
1
2
14
Review Recursive Ray Tracing
3
L1
L2
4
1
2
15
Review Ray Tracing
  • A Ray Tree describes the increase in the number
    of rays sent each recursion
  • When do you stop?
  • When a ray hits nothing
  • Return background color
  • When a ray hits a non-transmitting and
    non-reflecting object
  • At some maximum depth
  • Return background color

16
Outline
  • Rendering equation
  • Photon map

17
Ray tracing and photon mapping
What are differences between two rendered
pictures?
18
Ray tracing and photon mapping
caustics
Color bleeding
What are differences between two rendered
pictures?
19
The Rendering Equation
20
The Rendering Equation
21
Global Illumination
  • Various Rendering techniques solve some portion
    of the rendering equation
  • If a technique approximates the integral, it is
    part of the family of Global Illumination

22
Global Illumination
  • Ray Tracing
  • Radiosity
  • Photon Mapping

23
Radiosity
  • Solves geometry term in form factor
  • Approximates integral completely for
    diffuse-diffuse
  • No reflection or transmission

24
Ray Tracing
  • Works well for reflection and refraction
  • solves geometry eq. through ray intersection
    tests
  • solves emission properly
  • only solves integral for reflection and
    refraction to maxDepth
  • Diffuse reflectance ignored

25
Photon mapping
26
Photon mapping
Two difficulties - Q how to compute the
incoming radiance Li? - Q how to
efficiently evaluate the integral?
27
Photon mapping
Two difficulties - Q how to compute the
incoming radiance Li? A Compute Li based
on precomputed photon map - Q how to
efficiently evaluate the integral? A
Compute the integral based on monte carlo ray
tracing
28
Photon mapping
  • Is often used to simulate the interaction of
    light with a variety transparent substances
    (caustics)
  • - glass
  • - water
  • - Diffuse inter-reflections between
    illuminated objects
  • - Effects of particulate matter, e.g.
    smoke

29
Photon mapping
  • Phase I shoot and store photons
  • - photons are shot from the light into the
    scene
  • - photons are allowed to interact with
    objects in the environment
  • - where photons fall are stored in special
    data structure called a photon map
  • - 10000s of photons not billions (Statistical
    approximation based on density)

30
Photon mapping
  • Phase I shoot and store photons
  • - photons are shot from the light into the
    scene
  • - photons are allowed to interact with
    objects in the environment
  • - where photons fall are stored in special
    data structure called a photon map
  • - 10000s of photons not billions (Statistical
    approximation based on density)

31
Shooting photons
Point light source
directional light
square light
general light
32
Shooting photons
Point light source
directional light
square light
general light
The power of light
The number of photons
The power of an emitted photon
33
Pseudocode for Emission of Photons from Point
Light Source
34
Pseudocode for Emission of Photons from Point
Light Source
  • Basic idea
  • Radiant intensity as a probability function.
  • Generate photons by sampling the probability
    function.

35
Photon mapping
  • Phase I shoot and store photons
  • - photons are shot from the light into the
    scene
  • - photons are allowed to interact with
    objects in the environment
  • - where photons fall are stored in special
    data structure called a photon map
  • - 10000s of photons not billions (Statistical
    approximation based on density)

36
Photon tracing
  • Photons are only stored when it hits diffuse
    surface
  • Specular surface does not store any photons.

37
Photon map
38
Photon map
What information does each photon store?
39
Photon map
  • The photon

Placed in K-D tree for efficient access
40
Three photon maps
  • Caustic photon map
  • - interact with at least one specular surface
  • Global photon map
  • - interact with diffuse surfaces only
  • Volume photon map
  • - indirect illumination of participating
    medium

41
Global photon map
  • Basic idea
  • - Launch photons from the light sources in all
    directions
  • - Store a photon (position, power and
    direction) in each intersection of the photon
    with the scene.
  • - Compute the kind of interaction with the
    surface by using the Russian roulette.

42
Global photon map
  • The types of interactions are
  • - Diffusion the photon is reflected in a
    random direction (projected hemisphere) or taking
    into account a BRDF.
  • - Reflection Perfect reflection of the
    photon.
  • - Refraction The photon is refracted using
    Snell's law.
  • - Absorption We don't launch that photon
    again.

The Russian roulette method decides which
interaction to consider in function of the
material.
43
Caustics photon map
  • The global photon map has very weak caustics
    effects. We need to construct an additional map
    only for caustics.
  • - Launch the rays only over the objects that
    can generate caustics.
  • - Store the photons when they hit a diffuse
    surface only if previously it hit a reflective or
    refractive surface.

44
Caustics and global photon map
The global photon map
The caustics photon map
45
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 volume in the required direction)

46
Rendering using photon map
47
Rendering using photon map
Two main issues - How to compute incoming
radiance Li? - How to evaluate the integral
efficiently?
48
Basic idea radiance estimate
49
Basic idea radiance estimate
How to evaluate reflected radiance based on the
photon map?
50
Basic idea radiance estimate
Evaluate the radiance based on nearby photons
51
Basic idea radiance estimate
Evaluate the radiance based on nearby
photons Find N photons with the shortest
distance to the intersection point
52
Radiance estimate using photon map
53
Radiance estimate using photon map
54
Radiance estimate using photon map
55
Radiance estimate using photon map
56
Radiance estimate using photon map
locally flat surface
57
Radiance estimate using photon map
locally flat surface
58
Radiance estimated using photon map
200000 photons
100 photons
500 photons
59
Photon mapping rendering
60
Photon mapping rendering
61
Photon mapping rendering
Li,l direct illumination by light from the light
sources Li,c causticsindirect illumination from
the light sources via specular surface Li,d
indirect illumination from the light sources
(diffuse inter-reflection)
62
Light sources
63
Light sources
Li,l
Li,c
Li,d
64
Photon mapping rendering
65
Photon mapping rendering
Diffuse surfaces
Specular surfaces
66
Photon mapping the
rendering equation
67
Photon mapping the
rendering equation
68
Accurate evaluation of the direct illumination
Similar to the evaluation of shadow rays in ray
tracing
69
Photon mapping the
rendering equation
70
Evaluation of the Specular and Glossy term
Similar to the evaluation of reflection rays in
ray tracing
71
Photon mapping the
rendering equation
72
Evaluation of the caustics
Evaluate this term using the caustics photon map
directly
73
Photon mapping the
rendering equation
74
Evaluation of the indirect diffuse illumination
Accurate evaluation of the integral using monte
carlo ray tracing method
75
Results
  • global photon map
  • 200000 photons
  • 100 photons for estimate

Ray tracing
76
Cornell box with water
Write a Comment
User Comments (0)
About PowerShow.com