Upload
crescent
View
66
Download
0
Tags:
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
computer graphics & visualization
Image Synthesis
Basics of global illumination
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
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
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
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
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
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
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
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
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
computer graphics & visualization
Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group
RadianceRelation between irradiance and radiance
dxLxE i cos),()(
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),(),(),,(
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),(),,(),(
computer graphics & visualization
Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group
RadiosityRadiosity equationForm factorsSolution methods
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
),(),(),(),,(),(),(
computer graphics & visualization
Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group
Example
computer graphics & visualization
Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group
Example
computer graphics & visualization
Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group
Example
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)
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)
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
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
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
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
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
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
computer graphics & visualization
Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group
Form factor computationForm factor computation methods
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
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
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
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
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
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
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
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
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
computer graphics & visualization
Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group
Computing the radiosity
Be>0ijj ji
eii FBBB
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
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
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(
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
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
computer graphics & visualization
Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group
Jacobi iterationIteration 0
computer graphics & visualization
Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group
Jacobi iterationIteration 1
computer graphics & visualization
Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group
Jacobi iterationIteration 2
computer graphics & visualization
Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group
Jacobi iterationIteration 3
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
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
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
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
computer graphics & visualization
Image Synthesis – WS 07/08Dr. Jens Krüger – Computer Graphics and Visualization Group
Ray-tracing vs. RadiosityExamples