Computer Animation

Download Report

Transcript Computer Animation

Computer Graphics Global Illumination: Photon Mapping, Participating Media Lecture 12 Taku Komura

last lecture

  Monte-Carlo Ray Tracing   Path Tracing Bidirectional Path Tracing Photon Mapping 2

Today

  Methods to accelerate the accuracy of photon mapping Rendering Participating Media 3

Accelerating the accuracy of photon mapping

  Combine with ray tracing to visualize the specular light visible from the camera Shoot more photons towards directions where more samples are needed  Caustics photon map  Tracing photons only towards specular surfaces

A Practical Two-Pass Algorithm

  Building photon maps by photon tracing  Separate the photon paths into different categories according to the reflectance Rendering  Combining the radiance of difference light paths

Light Transport Notation

        L: Lightsource E: Eye S: Specular reflection D: Diffuse reflection (k)+ one or more k events (k)* zero or more of k events (k)? zero or one k event (k|k’) a k or k’ event

Photon Tracing

 Create two photon maps  Global photon map (the usual photon map)  All Photons with property L(S|D)*D are stored.

 Caustics photon map  Created by tracing photons that hit the specular surfaces   Cast the photons only toward specular objects LS+D

Rendering

 Separate the irradiance into four groups     Direct illumination (by ray tracing or global photon map) : LD Diffuse indirect illumination (by global photon map) : LD(S|D)+D Specular reflection (by ray tracing) L(S|D)*S Caustics (by caustics photon map) LS+D

Caustics Photon Map

   Caustics require high resolution Need to cast more photons towards surfaces that generates caustics Projection Map

   

Projection map

A map of the geometry seen from the light source  Made of many cells – which is on if there is a geometry in that direction, and off if not For a point light, it is a spherical projection For directional light, a planar projection Use a bounding sphere to represent the objects

Direct + Indirect + Specular

Why is photon mapping efficient?

  It is a stochastic approach that estimates the radiance from a few number of samples  Kernel density estimation Can actively distribute samples to important areas  Caustics photon map

Today

  Methods to accelerate the accuracy of photon mapping

Rendering Participating Media

14

 

Participating Media

Dusty air, clouds, silky water Translucent materials such as marble, skin, and plants   Photon mapping is good in handling participating media In participating media, the light is scattered to different directions

Single / Multiple scattering

The brightness of a point

 Is decided by  Out scattering   Absorption In scattering 

L

(

x

, ) 

L

(

x

, ) 

L i

 (

x

' , ' )

Light out-scattering

• The change in radiance, L, in the direction ω, due to out scattering is given by (    )

L

(

x

, )   

s

(

x

)

L

(

x

, ) • The change in radiance due to absorption is (    )

L

(

x

,  )   

a

(

x

)

L

(

x

,  ) 

s

(

x

) : scattering coefficien t 

a

(

x

) : absorption coefficien t 

L

(

x

, )

In-scattering

• The change due to inscattering (    )

L

(

x

, )  

s

(

x

)   4 

p

(

x

, ' , )

L i

(

x

, ' )

d

 ' where the incident radiance

, Li,

is integrated over all directions

p

is called the phase function describing the distribution of the scattered light 

L i

 (

x

' , ' )

 

Phase function

Isotropic scattering  Scattered in any random direction

p

(  )  1 4  Henyey-Greenstein Phase Function  Scattered in the direction more towards the front  Dust, stone, clouds

p

(  )  1  4  ( 1 

g

2

g

2  2

g

cos  ) 2 1  1 

g

 1

Phase function

Examples

Cornell Box scene – isotropic, homogeneous participating medium.

200,000 photons used with 65,000 in the volume map. Radiance estimate used 100 photons.

Cornell Box scene – anisotropic, homogeneous participating medium.

200,000 photons used with 65,000 in the volume map. Radiance estimate used 50 photons.

Ray marching and single scattering

• Now we compute how the light will be accumulated along a ray • This is called

ray marching

L

(

x

, ) 

N

l L i

(

x

, ' )

p

(

x

, ' , ) 

s

(

x

) 

x

e

 

t

x L

(

x

  

x

, ) where

N

is the number of light sources and

L i

is the radiance from each light source The last term is the light entering from behind, which is attenuated by proceeding

Δx

Ray marching through a finite size medium (Single Scattering)

L n

 1 (

x

, ),

L n

(

x

 

x

,

L n

 1 (

x

, ) 

N

l L i

(

x

, ' )

l p

(

x

, 

l

' , ),

L n

(

x

 2 

x

, ) 

s

(

x

) 

x

e

 

t

x L n

(

x

 

x

, ) )

Multiple scattering

• For multiple scattering, it is necessary to integrate all the in-scattered radiance at every segment

L n

 1 (

x

, ) 

N

l L d

(

x

, 

l

' )

p

(

x

,

l

' , ) 

s

(

x

) 

x

S

1

s S

  1

L s

(

x

,

s

' )

p

(

x

,

e

 

t

(

x

) 

x L n

(

x

 

x

, )

s

' , ) 

s

(

x

) 

x

 • Here S sample rays are used to estimate the in-scattered light

Photon mapping participating media • Photon mapping can efficiently handle multiple scattering • The photons interact with the media and are scattered / absorbed • The average distance the photon proceeds after each interaction is

d

  1

t

t

: terminati on coefficien t   

t

s

a

Photon Scattering

• The photon is either absorbed or scattered • The probability of scattering is    

t s

• Deciding what happens by Russian Roulette Given   [0,1]       Photon is scattered  Photon is absorbed is stored in a

volume photon map

Volume Radiance Estimate

• Same as we did for surface radiance estimate, locate n nearest photons and estimate the radiance (    )

L o

(

x

, ) 

p n

  1

f

(

x

,

p

' , ) 

p

(

x

, 4 3 

r

3 )

Rendering Participating Media

• By ray tracing • If a ray enters a participating media, we use ray marching to integrate the illumination.

L n

 1 (

x

, ) 

N

l L l

(

x

,

l

' )

p

(

x

,

l

' , ) 

s

(

x

) 

x

     

p n

  1

f

(

x

,

l

' ,

e

 

t

(

x

) 

x L n

(

x

 

p

(

x

, ) 

x

, 4 3  ) 

r

3 )      

x

 Single scattering term multiple scattering term

Examples

single scattering multiple scattering

Subsurface Scattering

• In computer graphics, reflections of non-metallic materials are usually approximated by diffuse reflections. • Light leaving from the same location where it enters the object • For translucent materials such as marble, skin and milk, this is a bad approximation • The light leaves from different locations

Single scattering

  Direct single scattering:  Compute the distance the light has traveled and attenuate according to the distance Indirect Multiple scattering :  Photon maps

Subsurface Scattering by Photon Mapping • Photon tracing – as explained before • Rendering – Ray marching

BSSRDF

• Bidirectional Scattering Surface Reflectance Distribution Function (BSSRDF) at

x’ S

(

x

,  ,

x

' ,  ' )  from direction ω’.

dL r d

i

( (

x x

, ' ,   ' ) ) • Relates the differential reflected radiance

dL r

, at

x

in the direction ω, to the differential incident flux,

, • We can capture/model the BSSRDF and use it for rendering

Rendering using BSSRDF

(a) sampling a BRDF (b) sampling a BSSRDF  Collect samples of incoming rays over an area http://graphics.ucsd.edu/~henrik/animations/BSSRDF-SIGGRAPH-ET2001.avi

Rendering by BSSRDF

 Human skin reflectance simulated by BRDF BSSRDF •

Readings :

Realistic Image Synthesis Using Photon Mapping by Henrik Wann Jensen, AK Peters Chapter 9, 10