• 沒有找到結果。

Advanced Computer Graphics Advanced Computer Graphics

N/A
N/A
Protected

Academic year: 2022

Share "Advanced Computer Graphics Advanced Computer Graphics"

Copied!
33
0
0

加載中.... (立即查看全文)

全文

(1)

Advanced Computer Graphics Advanced Computer Graphics

Rendering Lecture 3: Global Illumination

Some images courtesy Henrik Jensen Some slide ideas courtesy Pat Hanrahan

(2)

Illumination Models Illumination Models

So far considered mainly local illumination

Light directly from light sources to surface

No shadows (cast shadows are a global effect)

Global Illumination: multiple bounces (indirect light)

Hard and soft shadows

Reflections/refractions (already seen in ray tracing)

Diffuse and glossy interreflections (radiosity, caustics)

Some images courtesy Henrik Wann Jensen

(3)

Diffuse Interreflection Diffuse Interreflection

Diffuse interreflection, color bleeding [Cornell Box]

(4)

Radiosity

Radiosity

(5)

Caustics Caustics

Caustics: Focusing through specular surface

 Major research effort in 80s, 90s till today

(6)

Overview of lecture Overview of lecture

Theory for all global illumination methods (ray tracing, path tracing, radiosity)

We derive Rendering Equation [Kajiya 86]

 Major theoretical development in field

 Unifying framework for all global illumination

 Discuss existing approaches as special cases

Fairly theoretical lecture (but important). Not well covered in textbooks (though see Eric Veach’s thesis). Closest are 2.6.2 in Cohen and Wallace handout (but uses slightly different notation, argument [swaps x, x’ among other things])

(7)

Outline Outline

Reflectance Equation (review)

Global Illumination

Rendering Equation

 As a general Integral Equation and Operator

 Approximations (Ray Tracing, Radiosity)

 Surface Parameterization (Standard Form)

(8)

Reflectance Equation (review)

i r

x

( , ) ( , ) ( , ) ( , , )( )

r r e r i i i r i

L x L x L x f x    n

Reflected Light (Output Image)

Emission Incident Light (from light source)

BRDF Cosine of Incident angle

(9)

Reflectance Equation (review)

i r

x

( , ) ( , ) ( , ) ( , , )( )

r r e r i i i r i

L x L x

L x f x    n

Reflected Light (Output Image)

Emission Incident Light (from light source)

BRDF Cosine of Incident angle Sum over all light sources

(10)

Reflectance Equation (review)

i r

x

( , ) ( , ) ( , ) ( , , ) cos

r r e r i i i r i i

L xL xL xf x    d

Reflected Light (Output Image)

Emission Incident Light (from light source)

BRDF Cosine of Incident angle Replace sum with integral

d

i

(11)

The Challenge

• Computing reflectance equation requires knowing the incoming radiance from surfaces

• But determining incoming radiance requires knowing the reflected radiance from surfaces

( , ) ( , ) ( , ) ( , , ) cos

r r e r i i i r i i

L xL xL xf x     d

  

(12)

Global Illumination

i r

x

( , ) ( , ) ( , ) ( , , ) cos

r r e r L xr i i r id i

L x L x f x  

 

Reflected Light (Output Image)

Emission Reflected Light (from surface)

BRDF Cosine of Incident angle

d

i

Surfaces (interreflection)

dA x

i x x

   

(13)

Rendering Equation

i r

x

( , ) ( , , ) c

( , r) e r r( , i) i r os i

r i

L x L x L x f x   d

 

Reflected Light (Output Image)

Emission Reflected Light

BRDF Cosine of Incident angle

d

i

Surfaces (interreflection)

dA x

UNKNOWN KNOWN UNKNOWN KNOWN KNOWN

(14)

Rendering Equation (Kajiya 86)

Rendering Equation (Kajiya 86)

(15)

Outline Outline

 Reflectance Equation (review)

 Global Illumination

 Rendering Equation

As a general Integral Equation and Operator

Approximations (Ray Tracing, Radiosity)

 Surface Parameterization (Standard Form)

(16)

Rendering Equation as Integral Equation

Reflected Light (Output Image)

Emission Reflected Light

BRDF Cosine of Incident angle

UNKNOWN KNOWN UNKNOWN KNOWN KNOWN

( ) ( ) ( ) ( , )

l ue u   l v K u v dv

Is a Fredholm Integral Equation of second kind

[extensively studied numerically] with canonical form

( , ) ( , , ) c

( , r) e r r( , i) i r os i

r i

L x L x L x f x   d

 

Kernel of equation

(17)

Linear Operator Theory

• Linear operators act on functions like matrices act on vectors or discrete representations

• Basic linearity relations hold

• Examples include integration and differentiation

 

( ) ( )

h uM f u

M is a linear operator.

f and h are functions of u

     

Mafbga M f   b M g

a and b are scalars f and g are functions

 

 

( ) ( , ) ( ) ( ) ( )

K f u k u v f v dv D f u f u

u

 

(18)

Linear Operator Equation ( ) ( ) ( ) ( , )

l ue u   l v K u v dv

Kernel of equation

Light Transport Operator

L   E KL

Can also be discretized to simple matrix equation

[or system of simultaneous linear equations]

(L, E are vectors, K is the light transport matrix)

(19)

Solving the Rendering Equation

L   E KL

ILK LE ( I K  ) LE

( I K )

1

L  

E

Binomial Theorem

2 3

( I K ...) L    KKE

2 3

...

E KE K E K E

L     

Term n corresponds to n bounces of light

(20)

Solving the Rendering Equation

• Too hard for analytic solution, numerical methods

• Approximations, that compute different terms, accuracies of the rendering equation

• Two basic approaches are ray tracing, radiosity.

More formally, Monte Carlo and Finite Element

• Monte Carlo techniques sample light paths, form statistical estimate (example, path tracing)

• Finite Element methods discretize to matrix equation

(21)

Ray Tracing

2 3 ...

E KE K E K E

L     

Emission directly From light sources

Direct Illumination on surfaces

Global Illumination (One bounce indirect) [Mirrors, Refraction]

(Two bounce indirect) [Caustics etc]

(22)

Ray Tracing

2 3 ...

K E

E K E K E

L     

Emission directly From light sources

Direct Illumination on surfaces

Global Illumination (One bounce indirect) [Mirrors, Refraction]

(Two bounce indirect) [Caustics etc]

OpenGL Shading

(23)
(24)

Outline Outline

 Reflectance Equation (review)

 Global Illumination

 Rendering Equation

 As a general Integral Equation and Operator

 Approximations (Ray Tracing, Radiosity)

Surface Parameterization (Standard Form)

(25)

Rendering Equation

i r

x

( , ) ( , , ) c

( , r) e r r( , i) i r os i

r i

L x L x L x f x   d

 

Reflected Light (Output Image)

Emission Reflected Light

BRDF Cosine of Incident angle

d

i

Surfaces (interreflection)

dA x

UNKNOWN KNOWN UNKNOWN KNOWN KNOWN

i x x

   

(26)

Change of Variables

Integral over angles sometimes insufficient. Write integral in terms of surface radiance only (change of variables)

( , ) ( , ) ( , ) ( , , ) cos

r r e r r i i r i i

L x L x L x f x   d

x

x

dA

i

i

i

o

di

2

cos

| |

o i

d dA

x x

 

 

(27)

Change of Variables

Integral over angles sometimes insufficient. Write integral in terms of surface radiance only (change of variables)

( , ) ( , ) ( , ) ( , , ) cos

r r e r r i i r i i

L x L x L x f x   d

2

cos

| |

o i

d dA

x x

 

 

all visible

2 to

cos cos

( , ) ( , ) ( , ) ( , , )

| |

i o

r r e r r i i r

x x

L x L x L x f x

x d

x A

 

2

cos cos ( , ) ( , )

| |

i o

G x x G x x

x x

(28)

Rendering Equation: Standard Form

Integral over angles sometimes insufficient. Write integral in terms of surface radiance only (change of variables)

Domain integral awkward. Introduce binary visibility fn V

( , ) ( , ) ( , ) ( , , ) cos

r r e r r i i r i i

L x L x L x f x   d

2

cos

| |

o i

d dA

x x

 

 

all visible

2 to

cos cos

( , ) ( , ) ( , ) ( , , )

| |

i o

r r e r r i i r

x x

L x L x L x f x

x d

x A

 

2

cos cos ( , ) ( , )

| |

i o

G x x G x x

x x

all surfaces

( , ) ( , ) ( , ) ( , , ) ( , ) ( , )

r r e r r

x

i i r

L x L x L x f x   G x x V x x dA

Same as equation 2.52 Cohen Wallace. It swaps primed And unprimed, omits angular args of BRDF, - sign.

Same as equation above 19.3 in Shirley, except he has no emission, slightly diff. notation

(29)

Radiosity Equation

all surfaces

( , ) ( , ) ( , ) ( , , ) ( , ) ( , )

r r e r r

x

i i r

L x L x L x f x   G x x V x x dA

Drop angular dependence (diffuse Lambertian surfaces) ( ) ( ) ( ) ( ) ( , ) ( , )

S

r e r

L x L x f x

L x G x x V x x dA Change variables to radiosity (B) and albedo (ρ)

( , ) ( , ) ( ) ( ) ( ) ( )

S

G x x V x x

B x E x x B x dA

Same as equation 2.54 in Cohen Wallace handout (read sec 2.6.3) Ignore factors of π which can be absorbed.

Expresses conservation of light energy at all points in space

(30)

Discretization and Form Factors

( , ) ( , ) ( ) ( ) ( ) ( )

S

G x x V x x

B x E xx B x dA

 

    

j

i i i j j i

j i

B E B F A

A

  

F is the form factor. It is dimensionless and is the fraction of energy leaving the entirety of patch j (multiply by area of j to get total energy) that arrives anywhere in the entirety of patch i

(divide by area of i to get energy per unit area or radiosity).

(31)

Form Factors

dAj

i

j

dAi

r

j

A

Ai

( , ) ( , )

i i j j j i i j

G x x V x x

A F A F dA dA

 

  

2

cos cos ( , ) ( , )

| |

i o

G x x G x x

x x

(32)

Matrix Equation

j

i i i j j i

j i

B E B F A

A

  

( , ) ( , )

i i j j j i i j

G x x V x x

A F A F dA dA

 

  

i i i j i j

j

BE    B F

i i j i j i

j

B    B F

E

ij j i ij ij i i j

j

M BE MB EMI   F

(33)

Summary Summary

Theory for all global illumination methods (ray tracing, path tracing, radiosity)

We derive Rendering Equation [Kajiya 86]

Major theoretical development in field

Unifying framework for all global illumination

Discuss existing approaches as special cases

Next: Practical solution using Monte Carlo methods

參考文獻

相關文件

Credit to Theory of Computer Games,

(A) AGP ( advanced graphics port ) (B) IDE ( integrated drive electronics ) (C) SATA ( serial at attachment ). (D) SCSI ( small computer system interface

• Paul Debevec, Rendering Synthetic Objects into Real Scenes:. Bridging Traditional and Image-based Graphics with Global Illumination and High Dynamic

• It is a plus if you have background knowledge on computer vision, image processing and computer graphics.. • It is a plus if you have access to digital cameras

Salmon, Automatic Creation of Object Hierarchies for Ray Tracing IEEE CG&A 1987 Object Hierarchies for Ray Tracing, IEEE CG&A, 1987. • Brian Smits, Efficiency Issues

• Detlef Ruprecht, Heinrich Muller, Image Warping with Scattered Data Interpolation, IEEE Computer Graphics and Applications, March 1995, pp37-43. • Seung-Yong Lee, Kyung-Yong

• Detlef Ruprecht, Heinrich Muller, Image Warping with Scattered Data Interpolation, IEEE Computer Graphics and Applications, March 1995 pp37-43. March 1995,

• Detlef Ruprecht, Heinrich Muller, Image Warping with Scattered Data Interpolation, IEEE Computer Graphics and Applications, March 1995 pp37-43. March 1995,