51
computer graphics & visualization Image Synthesis Basics of global illumination

Image Synthesis

Embed Size (px)

DESCRIPTION

Image Synthesis. Basics of global illumination. Global illumination. Global illumination. Photorealistic image synthesis. Photorealistic image synthesis. Photorealistic image synthesis. Photorealistic image synthesis. Radiometric quantities. Strahlungsenergie: radiant energy - PowerPoint PPT Presentation

Citation preview

Page 1: Image Synthesis

computer graphics & visualization

Image Synthesis

Basics of global illumination

Page 2: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Global illumination• Local lighting

• Light mapping (environment maps, illumination maps) approximates global illumination on static scene geometry • Does not address dynamic objects that move through the scene• No motion parallax

• Non-local lighting

• Area light sources• Shadows• Inter-object reflections• Subsurface scattering

• Simulated via ray-tracing or radiosity

• Not yet possible in real-time

Page 3: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Global illumination

• Solution:

• Precomputed Irradiance Volumes for static scenes and Precomputed Radiance Transfer for objects within those scenes

Page 4: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Photorealistic image synthesis• Rendering in interactive computer graphics

• Hardware oriented: pipeline approach (OpenGL/DirectX)• Plausible, but no allways photorealistic

• Physics based rendering - photorealism

• Geometry, animation, illumination, rendering

• Current trends

• Photorealism in real-time via graphics hardware• Shading Languages

Page 5: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Photorealistic image synthesis

• Light transport

• Photons from light sources into the scene• Global problem: every point illuminates every other point• Interaction between matter and light• Visibility • Result: incoming light at every point

• Scene description

• Geometry: surface and volumes• Light sources: position, orientation, power• Surface properties: reflection properties

Page 6: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Photorealistic image synthesis

• Simulation of the interaction between light and matter

• In volumes: Volume Rendering (Participating Media)• At surfaces: Reflection and refraction

• Traditional computer graphics:

• Surface graphics with vacuum in between, no interaction• Scattering only at surfaces

Page 7: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Photorealistic image synthesis

• Light as physical quantity: Radiometry

• Radiometry: physical measurement of electromagnetic energy• Photometry: psychophysical measurement of the visual sensation produced by the electromagnetic spectrum • Radiometric quantities have to be converted to photometric quantities

• Photons have energy: E=hn

• Planck constant: h• Frequency of the light wave: n

Page 8: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Radiometric quantitiesStrahlungsenergie: radiant energy

Q in Joule [J] Strahlungsleistung oder -fluss: radiant flux

in Watt [W=J/s]

Einfallende Flussdichte: irradiance (incident)

power per area in [W/m2]

ausgehende Flussdichte: radiosity (radiant exitance)

power per area in [W/m2]

dtdQ

dAdE

dAdB

Page 9: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Radiometric quantitiesStrahlungsintensität

power per solid angle in [W/sr]ddI

Page 10: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Strahldichte: RadianceCombination of flux and intensityStrahldichte = Radiance

Central quantity in physics based images synthesisUnits: [W/(m2sr)]Power per unit solid angle per projected unit area

ddA

dddAd

ddAdL N cos

222

N

d

dNdA

dA

Page 11: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

RadianceRelation between irradiance and radiance

dxLxE i cos),()(

Page 12: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

BRDFBRDF

Bidirectional reflection distribution function

Proportionality constant fr(i ,x, r ) [1/sr]

iiii

rrrir dxL

xdLxf

cos),(),(),,(

Page 13: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Reflection equationDifferential reflected radiance from incoming radiance using BRDF

Integration over all directions

Integral equation for one unknown based on relation between Li(i) and Lr(r)

iiiirirrr dxLxfxdLi

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

iiiirirrr dxLxfxL

cos),(),,(),(

Page 14: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

RadiosityRadiosity equationForm factorsSolution methods

Page 15: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Solving the rendering equation

• Monte-Carlo techniques– See course Computer Graphics

• Finite-Elemente techniques– Radiosity technique– Projection of equations with infinite dimension onto

functions space with finite dimension– Results in a linear system of equations– Efficient for smooth illumination and reflection

Sy

yirirrer dAyxGyxVyLxfxLxL

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

Page 16: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Example

Page 17: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Example

Page 18: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Example

Page 19: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Considerations• Energy conservation in closed scene

• Energy equilibrium

• Origin: heat simulation

• Application in CG by Goral 1984

• Subdidision of the scene into planar patches

• Diffuse Reflection (Lambertian reflector)

Page 20: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

ConsiderationsSubdivision of the scene into planar patchesDiffuse Reflection (Lambertian reflector)

Page 21: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

BRDF: Diffuse ReflectionRadiosity and reflectance

from radiance

we get

EfLddL

dL

dLB

diffusrdiffusrrrrrdiffusr

rrdiffusr

rrdiffusr

,,

2

0 0,

,

,

2

sincos

cos

cos

diffus

diffusrdiffusrdiffus ffEB

,,

EB

diffus N

LiLr

Page 22: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Continuous radiosity equationFrom rendering equation

Assumption: diffuse Reflection

Integration over outgoing directions

from

10 ,1),,(

rir xf

Sy

ye dAyxGyxVyBxxBxB

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

Sy

yirirrer dAyxGyxVyLxfxLxL

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

x

y

x

y

)(),( xBxL r

Page 23: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Continuous radiosity equationRadiosity equation

with new geometry factor

2||||coscos

),(),('yx

yxVyxG yx

Sy

ye dAyxGyBxxBxB

),()()()()(

x

y

x

y

Page 24: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Classical radiosity equationRadiosity equation

Assumption: surface-patches i with constant Bi(x)

Averaging: integration of all Bi and division through Ai

ij

i j

F

Axx

Ayy

ij ji

eii dAdAyxG

ABBB

),(1

Sy

ye dAyxGyBxxBxB

),()()()()(

iAx

xi

i dAxBA

B

)(1

Page 25: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Classical radiosity equationClassical discrete Radiosity equation

Form factors

Fraction of energy that leaves element i and directly arrives at element j

ijj jieii FBBB

i jAx

xAy

yyx

iij dAdA

yxyxV

AF

2||||coscos

),(1

Page 26: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

“Direction” of Form factorsFraction of energy that leaves element i and directly arrives at element j

jjij jiieiii

iijj jiieiii

ijj jieii

Axx

Ayy

yx

iij

AFBABAB

AFBABAB

FBBB

dAdAyx

yxVA

Fi j

2||||coscos

),(1

iijjji AFAF

Page 27: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Form factor computationForm factor computation methods

Page 28: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Form factorsNusselt-Analog

– Geometric interpretation of form factorsfrom differential area dAi to element Aj

– Proportional to the area of doubleprojection onto base of hemisphere

– First projection:– Second projection:

Pi

Pj

Projectiononto hemisphere

Cylinder projectiononto circle area

2/cos rj /cos i

Page 29: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Form factors

• The Nusselt analog

• First projection gives the solid angle subtended by the element• Second projection accounts for area foreshortening on the receiver • Fraction with respect to the area of the unit circle implicitely accounts for

the division through

Page 30: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Form factor computation

• The hemicube algorithm

• Nusselt for hemicube• The dAiAj form factor remains constant for arbitrary elements as long as the projected area is unchanged• Idea:

• Pre-compute ´delta form factors´ for a number of ´well-defined´ elements • Determine which of these elements are covered by the projection • Sum up the contributions to obtain the form factor

Page 31: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Form factor computation• The hemicube algorithm

– Fij = q Fq

Page 32: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Form factor computation

• Implementing the hemicube algorithm

• Subdivide the hemicube into regular elements• The finer the refinement the more accurate the form factor can be approximated

• Compute the delta form factors (analytically) and store them in a lookup table • Determine all facets covered by the projection of an element• Count the covered facets and sum up the delta form factors

Page 33: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Form factor computation• Hemicube method

222

SIDE

222

TOP

222

1

;1

1coscos

1coscos

yzAzF

yxAF

r

yxrr

F

q

qqi

qiq

x

z

A

A

Page 34: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Form factor computation

• Hardware accelerated hemicube algorithm

• Process each face of the hemicube separately• Select the center of projection as the camera point• Define the current face as the view plane

• The viewport determines the size of facets• Render each element using this view

• Color elements with a unique id• Grab the color buffer• Count the number of colored pixels and sum up the corresponding form factors

• Visibility test is performed by the depth test

Page 35: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Form factor computation

Hemicube-Verfahren: Simulated Steel Mill (Feldman, Wallace)55 000 Patches, gerechnet auf VAX 8700

Page 36: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Computing the radiosity• Discretize the scene

• Issue emission values and reflectivities for each element

• Compute the Form Factors based on the geometric relationship between elements

• Solve the radiosity system

• Derive shading values from the radiosity and render the elements

Page 37: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Computing the radiosity

Be>0ijj ji

eii FBBB

Page 38: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Smooth solutionSolution yields constant radiosities per patchSolution is independent of view pointInterpolate per-vertex valuesGouraud-Shading for interactive walk-throughsAlternatively: Radiosity-Texture

Page 39: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Radiosity solution techniques• Classical radiosity (often Ei instead of Bi

e)

n

T

nnnn

n

n

nnn

ijj jiii

B

BB

FFF

FFFFFF

E

EE

B

BB

FBEB

2

1

21

22221

11211

2

1

2

1

2

1

00

0000

GeometryMaterial

Page 40: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Radiosity solution techniques• Direct solution

• Gauß elimination: matrix inversion– complexity = O(n3) for n patches

ETB

BTETBEB

1)1(

)1(

Page 41: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Linear system of equationsFor n patches: a system for n unknowns Bi n2 matrix elements from form factorsMatrix elements (1-T)ij,i!=j = 0, if V(i,j) = 0

dominant diagonalMatrix 1

1

11

2

1

2

1

21

22222212

11121111

EBT

E

EE

B

BB

FFF

FFFFFF

nnnnnnnnn

n

n

Page 42: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Iterative solution methodsB = E + TB

= E + T(E+TB) = E + TE + T2B

= ... = T0E + T1E + T2E + T3E + ... = B(0) + B(1) + B(2) + B(3) + ...

2-times reflected light 1-times reflected light 0-time reflected light

Page 43: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Jacobi iterationIteration 0

Page 44: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Jacobi iterationIteration 1

Page 45: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Jacobi iterationIteration 2

Page 46: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Jacobi iterationIteration 3

Page 47: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

GatheringOne step gathers energy from all other patches and generates one new valueSelect patches consecutively independent of their contributionPhysical interpretationof Gauß-Seidel

B;output }

;:

)(each for { converged)(not while

guess; starting ) (allfor

,1

n

ijj ii

jijii

i

TBT

EB

i

Bi

Page 48: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Shooting Select patches with regard to importance, distribute energy to all others, shot „unshot“ radiosity

B;output }

;: ) (allfor

;

;

largest; is such that pick { converged)(not while

}; ;0

{ ) (allfor

temprrj

rtemp

BB

ri

ErBi

ii

ji

ii

i

TT

jj

i

Tr

ii

i

iii

Page 49: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Solution methods summary

• So far, solution methods rely on a static subdivision of the domain

• Scene is subdivided into patches• Constant radiosity is assumed for each patch

• Hierarchical methods rely on a dynamic subdivision of the scene

• Refinement is adapted with respect to the local radiosity distribution

Page 50: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Radiosity vs. ray-tracing• Ray-tracing only accounts for specular reflection and refraction

• Too many rays would have to be traced

• Diffuse interactions can´t be simulated easily

• Sharp specular reflections can´t be simulated

• Radiosity only accounts for diffuse interactions

• Both methods are global, but differ significantly in the visual result

Page 51: Image Synthesis

computer graphics & visualization

Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group

Ray-tracing vs. RadiosityExamples