Procedurally Reconstructing 3D Trees From 2D Images

Download Report

Transcript Procedurally Reconstructing 3D Trees From 2D Images

Rendering Caustics Using Photon
Mapping and Ray Tracing
D. Narayan Brooks
[email protected]
Computer Science Department,
UC Santa Cruz
CS 260 – Professor Alex Pang
May 14, 2002
Introduction



Approximating realistic lighting phenomenon in
computer graphics scenes creates a more
compelling and engrossing viewing experience
The human eye is very adept at pinpointing
visual discrepancies, especially involving
lighting
Lighting discrepancies can cause the viewer to
lose their current suspension of disbelief when
viewing computer generated scenes
Introduction Continued




The intricate play between lights and the 3D surfaces
in a scene is a computationally intensive process
The lighting process needs to be efficient while
maintaining an acceptable depiction of the interaction
between light and the 3D surfaces
Caustics are an indirect lighting phenomenon that add
realism to the scene
Photon mapping attempts to efficiently capture lighting
in general, and caustics in particular
Background and Previous Work



There has been a lot of research in global
illumination
The goal is to create realistic lighting
depictions in complex scenes in the most
efficient manner
There have been many techniques and
modifications of techniques to optimize and
capture all different types of lighting
Background and Previous Work





Whitted ray tracing was introduced in the 80’s as a more realistic
approximation of light interacting with surfaces
Backwards ray tracing was introduced later by Arvo to deal with
shadows and indirect illumination
Radiosity was developed as an alternative to the sharp images
created by ray tracing
Many hybrids of the two techniques have been developed to
compensate for the failings of each technique
Photon mapping is used by Jensen in ’96 to achieve global
illumination while capturing caustics
Caustics

What are caustics?
–
–
–
–
–
–
Distinct areas of high light intensity much brighter than the
neighboring area
A result of indirect lighting, adding more realism to the scene
Created by light refraction and specular reflection
Refraction – light bends when it encounters different mediums,
focusing the light transmitted
Specular reflection – light reflects form specular surfaces and
illuminates diffuse surfaces
Caustics are generally encountered in scenes with liquids and
glass objects
Caustics
Image from [Jensen98]
Caustics
Image from [Jensen96]
Global Illumination

There are many techniques that have been
used for global illumination
–
–
–
–
Radiosity
Ray tracing
Hybrid methods
Photon mapping
Global Illumination

Radiosity
–
–
–
–
Spread color “energy” throughout the scene until a
stasis point is reached
Only handles diffuse reflection, no specular
reflections
Large memory consumption
Very realistic soft illumination images can be
produced
Global Illumination

Ray tracing
–
–
–
–
–
Handles specular reflections well
Recursive, which can be very time consuming
Captures shadows, reflections, and refractions
Creates images that have a distinct synthetic
“signature”
Two methods –


Forward – from the eye (view dependent)
Backwards - from the light source to the objects
Global Illumination

Hybrid methods
–
–

Incorporate diffuse and specular components into lighting
models as well as capture indirect illumination
Suffer from large storage requirements and computation time
Photon mapping
–
–
–
–
An efficient hybrid method
Combines photons (energy shooting) with ray tracing
Achieves the different aspects of global illumination: caustics
shadows, reflections, refraction, and diffuse color
Accounts for direct and indirect illumination
Photon Mapping

What are Photon maps?
–
–
–
–
An efficient way to store light intensity on surfaces
Created by “emitting packets of energy (photons)”
[Jensen96] from a light source using backwards ray
tracing
Store the photon when it hits a surface
High resolution map used for caustics, lower
resolution map for diffuse and secondary reflection
approximation
Photon Mapping - Photons

What is a photon?
–
–
–
–
–
–
–
Packet of energy emitted from a light source
Travels in a ray from the light source
Can be absorbed, reflected, or transmitted by a surface (using
the Russian roulette method)
Stored in the photon map when an intersection occurs
Incoming flux is the density of photons stored on a surface
Photon structure has position, energy, incoming direction and
caustic/regular flag
Photons are classified into direct and indirect illumination
photons as well as shadow photons
Photon Mapping – Photon
Classification
Image courtesy of [Jensen/Cooper98]
Photon Mapping – Photon Maps


Store photon density where photon intersects surface
High resolution caustic map
–
–

Use for direct visualization of caustics
Stores photons that were originally shot at specular surfaces
and then reflected/refracted to hit diffuse surfaces
Lower resolution global photon map
–
–
–
Approximates light/flux
Stores photons emitted towards all objects
Not visualized directly, used for optimizing shadow and
recursive reflection rays
Photon Mapping - Geometry





Photon maps are not coupled with the underlying
geometry
“If you can ray trace it, you can map it”
[Jensen/Cooper98]
Very practical for storing information on implicit and
other procedural surfaces (i.e. fractals)
Can be extended to visualize volumes for participating
media light transport simulation (clouds, god rays,
smoke, etc.)
Kept in 3D spatial data structure based on hit location
Description

Photon mapping is a two pass process
–
–
Create the photon maps by light path tracing
Render the scene using ray tracing optimized by the
photon maps’ information
Description

Light Path Tracing (LPT)–
–
–
–
Shoot photons from different positions on light,
along rays to objects, and trace reflections and
transmissions
Each ray carries a fraction of the photon energy
Deposit photon in map when it intersects a surface
Determine if the photon is absorbed or reflected
using Russian roulette

If reflected, use the BRDF of the surface to find reflected
direction
Description

Create a global and a caustic photon map by using
LPT
–


Only shoot to specular objects for caustic map
Get shadow photons by only storing regular photon on
first hit, storing shadow photons on subsequent hits
along the ray
Store photon maps in a balanced multi-dimensional
search tree, the kd tree, based on hit location
Description


Find irradiance (color energy) of the surface by
extending a sphere to radius r, where it will
contain the N nearest photons
Sum the energy from the N photons in the
sphere and divide it by the approximated area
–
Only use caustic photons for the caustic photon
density estimate
E(position x) = ΣNei /πr2
Description

Finding N nearest photons in a sphere of
radius r. Image from [Jensen/Cooper98]
r
x
Description



Use caustic map to visualize caustics directly
Use global map to optimize shadow tracing by
only tracing shadow rays from locations with
some regular photons and some shadow
photons
Optimize reflections by using irradiance
approximation in global photon map for
secondary recursive reflections
Rendering




Render the scene using a two pass method
Create global and caustic photon maps using
backwards ray tracing
Use the information stored in the photon maps
for caustic visualization and to optimize the
forward ray tracing
Use the photon densities for irradiance (color)
information
Rendering – First Pass

Create photon maps
–
–
–
–
–
Use backwards ray tracing to create caustic and
global photon maps
Emit photons from light to objects
Store regular photons in photon map at first hit, and
shadow photons at subsequent hits along the ray
If photon is reflected or transmitted trace photon
along new ray, recording hits in photon map
View independent
Rendering – Second Pass

Ray trace scene from the eye
–
–
Use forward ray tracing methods such as Monte
Carlo or other distributed ray tracers
Use information stored in photon map to



–
visualize caustics
optimize shadow casting
approximate secondary recursive reflections
Importance sampling can be based on any bidirectional reflectance distribution function (BRDF)
Conclusion




Photon mapping is an efficient way to perform global
illumination
Photon maps deal with depicting direct and indirect
illumination as well as diffuse and specular reflections
Caustics are rendered using a specific caustic photon
map
Can create visually compelling scenes due to the
lighting realism
References




[Jensen95] H. Jensen, N. Christensen. “Photon Maps in Bidirectional
Monte Carlo Ray Tracing of Complex Objects”. Computing and Graphics.
Vol. 19, No. 2, pp. 215-224, 1995, Elsevier Science Ltd., Great Britain.
[Jensen96] Henrik Wann Jensen. “Global Illumination using Photon
Maps”. Rendering Techniques ’96 Proceedings of the Seventh
Eurographics Workshop on Rendering. pp. 21-30, 1996, Springer-Verlag.
[Jensenr98] Henrik Wann Jensen and Per. Christensen, "Efficient
Simulation of Light Transport in Scenes with Participating Media using
Photon Maps" , Siggraph'98, pp. 311-320.
[Jensen/Cooper98] Presentation by S. Cooper based on "Efficient
Simulation of Light Transport in Scenes with Participating Media using
Photon Maps", 2000. http://www.cs.unc.edu/~scooper/
comp238/photonmaps.ppt