image synthesis

27
computer graphics & visualization Image Synthesis Pre-Computed Radiance Transfer PRT

Upload: makara

Post on 22-Feb-2016

25 views

Category:

Documents


0 download

DESCRIPTION

Image Synthesis. Pre-Computed Radiance Transfer PRT. Radiometric quantities. Strahlungsenergie: 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/m 2 ] - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Image Synthesis

computer graphics & visualization

Image Synthesis

Pre-Computed Radiance TransferPRT

Page 2: 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 3: 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 4: Image Synthesis

computer graphics & visualization

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

Precomputed radiance transfer • Precompute irradiance on a grid

– Based on irradiance volumes (Greger98)

– Assume the scenedoesn´t change

– Precompute irradiancesamples at grid points

– Interpolate light atpoints in-between

Page 5: Image Synthesis

computer graphics & visualization

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

Precomputed radiance transfer • A cube-map captures radiance distribution at a point

for all directions– Entries have to be scaled by projected solid angle

• For diffuse surfaces, radiance is defined in terms of the irradiance E

dxLxE i cos),()(

const.

)(),( ,

xEfxL diffusrrr

Page 6: Image Synthesis

computer graphics & visualization

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

Precomputed radiance transfer • Idea: compute irradiance at a point for all

possible „orientations“– Gives irradiance distribution function– Looks like a radiance distribution function but it is

convolved (blurred) with a cosine kernel– It is continuous over directions– Can be stored at a point using a “Diffuse Cube

Map”, which is indexed with surface normal

Page 7: Image Synthesis

computer graphics & visualization

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

Radiance vs. Irradiance

Page 8: Image Synthesis

computer graphics & visualization

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

Precomputed radiance transfer • Volume subdivision for irradiance caching

– Uniform, but some areas have slowly changing irradiance while in others the irradiance is quickly changing

– Idea: use adaptive subdivision

Page 9: Image Synthesis

computer graphics & visualization

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

Precomputed radiance transfer • Sampling the irradiance grid

– Trilinear between grid vertices– At level transitions use vertices on either side

Page 10: Image Synthesis

computer graphics & visualization

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

Precomputed radiance transfer • Idea: project irradiance into a particular

function space and use only „a few“ coefficients to reconstruct the original function

• As irradiance is captured on a sphere, use basis functions on a sphere

Page 11: Image Synthesis

computer graphics & visualization

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

Diffuse PRT• http://people.csail.mit.edu/kautz/PRTCourse• Goal: to shade a diffuse object using

Precomputed Radiance Transfer (PRT)• Diffuse:

– Reflected light is view-independent

– Simplifies equations

Page 12: Image Synthesis

computer graphics & visualization

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

Remember Radiosity?B = E + TB

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

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

Page 13: Image Synthesis

computer graphics & visualization

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

Diffuse PRT

sdspVsLdspFdpL

dpLdpLdpL

env

)cos(,0

10

To derive PRT for the diffuse case we are going to start with just the direct term from the Neumann expansion of the rendering equation and make several simplifying assumptions.

Page 14: Image Synthesis

computer graphics & visualization

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

Diffuse PRT

sdspVsLdspFdpL

dpLdpLdpL

env

)cos(,0

10

sdspVsLpL envd )cos(0

The bottom equation is the “simplified” form. For diffuse objects light is reflected equally in all directions, so outgoing radiance is independent of view direction.

Page 15: Image Synthesis

computer graphics & visualization

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

Diffuse PRT

sdspVsLdspFdpL

dpLdpLdpL

env

)cos(,0

10

sdspVsLpL envd )cos(0

This also means the BRDF is just a constant (and independent of direction) so it can be pulled out of the integral.

Page 16: Image Synthesis

computer graphics & visualization

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

Diffuse PRT „Visually”

sdspVsLpL envd )cos(0

Page 17: Image Synthesis

computer graphics & visualization

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

Diffuse PRT

Visually, we integrate the product of three functions (light, visibility, and cosine).

Page 18: Image Synthesis

computer graphics & visualization

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

Diffuse PRT

The main trick is to use for pre-computed radiance transfer (PRT) is to combine the visibility and the cosine into one function (cosine-weighted visibility or transfer function), which we integrate against the lighting.

Page 19: Image Synthesis

computer graphics & visualization

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

Problems• How to encode the spherical functions?

We still need to encode the two spherical functions (lighting, cosine-weighted visibility/transfer function)

• How to quickly integrate over the sphere?we need to perform the integration of the product of the two functions quickly-

PRT

Page 20: Image Synthesis

computer graphics & visualization

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

Diffuse PRT

sdspVsLpL envd )cos(0

i iienv sylsL

Now we are going to approximate the source radiance function with its projection into a set of basis functions on the sphere (denoted yi() in this equation.)

Page 21: Image Synthesis

computer graphics & visualization

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

Diffuse PRT

i iid

i iid

envd

sdspVsylpL

sdspVsylpL

sdspVsLpL

)cos(

)cos(

)cos(

0

0

0

Manipulating this expression exploiting the fact that integration is a linear operator(sum of integrals = integral of sums), we can generate the following equivalent expression.The important thing to note about the highlighted integral is that it is independent of the actual lighting environment being used, so it can be pre-computed.

Page 22: Image Synthesis

computer graphics & visualization

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

Diffuse PRT

i ipid

i iid

tlpL

sdspVsylpL

0,0

0 )cos(

We call the precomputed integrals “transfer coefficients”Outgoing radiance: just a dot-product!

Page 23: Image Synthesis

computer graphics & visualization

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

Diffuse PRT

i ipid

i ipipid

tlpL

ttlpL

dpLdpLdpL

,

1,

0,

10

A similar process can be used to model the other bounces, so that a final vector can be computed and used to map source radiance to outgoing radiance at every point on the object.Outgoing radiance is then just the dot product of the lights projection coefficients with the transfer vector.

Page 24: Image Synthesis

computer graphics & visualization

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

We project the lighting into thebasis (integral against basis functions). If the object is rotatedwrt. to the lighting, we need toapply the inverse rotation to thelighting vector.

At run-time, we need to lookupthe transfer vector at every pixel. A pixel-shader then computes the dotproduct between the coefficient vectors. The result of this computation is the outgoing radiance at that point.

Putting it all together

Page 25: Image Synthesis

computer graphics & visualization

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

Results

Page 26: Image Synthesis

computer graphics & visualization

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

Results

Page 27: Image Synthesis

computer graphics & visualization

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

Results