Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have...

35
Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby College, and University College London

Transcript of Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have...

Page 1: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

Illumination ModelsRadiosity

Chapter 14

Section 14.7

Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby College, and University College London

Page 2: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

2

Point illumination

Page 3: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

3

Ray Tracing

Page 4: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

4

Diffuse Reflection & Color Bleeding

Page 5: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

5

Radiosity

● All surfaces are assumed perfectly diffuse■ What does that mean about property of lighting in scene?

○ Light is reflected equally in all directions○ Same lighting independent of viewing angle / location

● Diffuse-diffuse surface lighting effects possibleDiffuse-diffuse surface lighting effects possible

Page 6: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

6

Radiosity

● Basic Idea■ We can accurately model diffuse reflections from a surface by

considering the radiant energy transfers between surfaces, subject to conservation of energy laws.

■ This method for describing diffuse reflections is generally referred to as the radiosity model.

Page 7: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

7

Which one is Better

Raytraced Radiosity

Herik Wann Jensen

Page 8: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

8

Radiosity: Cornell Experiment

Measured Simulated

Program of Computer GraphicsCornell University

Page 9: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

9

Radiosity: Cornell Experiment

Measured Simulated

Difference

Page 10: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

10

Early Radiosity

Shenchang Eric Chang et al., Cornell 1988

Page 11: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

11

Types of Surface Reflectance

Specular-specular(ray tracing)

Diffuse-diffuse(radiosity)

Specular-diffuse(Monte Carlo)

Diffuse-specular(Monte Carlo)

Page 12: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

12

Rendering

● Radiosity is a view-independent solution.● Could flat shade each patch with colour depending

on radiosity at the center (bad solution!)● Instead obtain radiosities at the vertices of the

polygons■ use Gouraud smooth shading (interpolation)■ Available very cheaply on graphics hardware.

Page 13: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

13

Ray Tracing vs. Radiosity

● Both achieve global illumination● Ray tracing

■ Follow rays of energy as they bounce through a scene○ Which rays? Pick some. Randomness helps.

Monte Carlo. Still a research topic.○ How many rays? Depends on the scene. Still a

topic of research debate.

● Radiosity■ Compute energy transfer between finite-sized patches of

surfaces in the scene○ Which patches? Must subdivide the scene

somehow○ How does energy transfer Approximating models

between patches? Still an area of research

Page 14: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

14

Ray Tracing vs. Radiosity

● Radiosity captures the sum of light transfer well■ But it models all surfaces as diffuse reflectors■ Can’t model specular reflections or refraction

○ Images are viewpoint independent

● Ray tracing captures the complex behavior of light rays as they reflect and refract■ Works best with specular surfaces.

○ Diffuse surface converts light ray into many. Ray tracing follows one ray and does not capture the full effect of the diffusion.

○ Must use ambient term to replace absent diffusion

Page 15: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

15

Radiosity Measure

● It is the name of a measure of light energy...● ...and an algorithm:

■ Radiant energy (flux) = energy flow per unit time across a surface (watts)

■ Radiosity = flux per unit area (a derivative of flux with respect to area) radiated from a surface.

■ These are wavelength-dependent quantities.

Page 16: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

16

Radiosity Equation

● A model for the light reflections from the various surfaces is formed by setting up an "enclosure" of surfaces.

● Each surface in the enclosure is either ■ a reflector, ■ an emitter (light source), ■ or a combination reflector-emitter.

● We want to calculate radiosity parameter Bi, the total rate of energy leaving surface i per unit area.

Page 17: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

17

Radiosity Equation

● Bi = total rate of radiant energy leaving surface i per unit area

● Hi = sum of the radiant energy contributions fromall surfaces in the rendered volume arriving at surface i per unit time per unit area

● Fji = the form factor for surfaces j and i

= the fractional amount of radiant energy from surface j that reaches surface i.

j

jiji FBH

Page 18: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

18

Radiosity Equation

Page 19: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

19

Radiosity Equation

● For a scene with n surfaces■ The radiosity equation for surface i

● Ei = rate of energy emitted by surface i per unit area (watts/m2)

● Ei = 0 if surface i is not a light

n

jjijii

iiii

FBE

HEB

1

Page 20: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

20

Radiosity Equation

● i is the reflectivity factor for surface i (percent of incident light that is reflected in all directions)■ Related to the diffused reflection coefficient used in emperical

diffuse illumination models

● What is the self-form-factor (self-incidence) Fii for plane and convex surfaces?■ Fii Is zero because convex surfaces and planes cannot see

themselves

● The radiosity equation indicates that surface affects other surfaces and even itself

● How will we compute BHow will we compute Bii for all surfaces in the scene? for all surfaces in the scene?

Page 21: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

21

Radiosity Equation

● To obtain the illumination effects over the various surfaces in the enclosure we need to solve the simultaneous radiosity equations for the n surfaces given the array values for Ei, i, and Fji

i

n

ijjjijiiiii EFBBF

,1

1

Page 22: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

22

The Radiosity Equation

FB E=

F

1 1F

11–

1F

12– ¼

1F

1n–

2F

21– 1

2F

22– ¼

2F

2n–

¼ ¼ ¼ ¼

nF

n1–

nF

n2– ¼ 1

nF

nn–

=

B

B1

B2

¼B

n

and E

E1

E2

¼E

n

= =where

and

Page 23: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

23

Radiosity Equation

• In matrix form

•The Bi are unknown and assume all else is known (Form Factor is not)•Then can be rewritten as system of n linear equations in n unknowns.•Hence patches can be rendered ideally with smooth shading.•One set of eqns for each wavelength!

Page 24: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

24

The Form Factors

● Need to determine form factors to solve the radiosity equation● Remember

Fij = energy transfer from surface i to j= percent of energy emanating from i that is incident on j

This is a good imagefrom Foley et al. Note in the image corresponds to inour Hearn and Baker.

Page 25: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

25

Form Factors

● Consider the differential units■ For some small area of surface j and some small area of i■ We want to calculate the rate of radiant energy falling on a

small surface dAj from a small area dAi

● See the derivation of the equation in the book● We can calculate the integration using numerical

methods

ji

surf surf

ji

jij dAdA

rAF

i j

2

coscos1

Page 26: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

26

Final Radiosity Algorithm

1. Divide each surface into small polygons■ The smaller the polygons, the more realistic the scene

2. Calculate form factors

3. Calculate Radiosity Bi for each small polygon by solving simultaneous linear equations

4. Display the radiosity values

● Produces very realistic images● Radiosity is expensive to compute

■ Get your PhD by improving it● Specular reflection information is not modeled

Page 27: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

27

View-dependent vs View-independent

● Ray-tracing models specular reflection well, but diffuse reflection is approximated

● Radiosity models diffuse reflection accurately, but specular reflection is ignored

● Advanced algorithms combine the two

Page 28: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

28

Bidirectional Ray Tracing

L

A

B

C

E*

*

* - these transports would be missed by conventional RT.

Page 29: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

29

Bidirectional Ray Tracing

Forward ray tracing – source to surfaces, illuminates surfaces.

Backward (conventional) ray tracing – eye to surfaces, sees lit surfaces.

Accumulate photon hits for surface intensity – render from eye pt.

Page 30: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

30

Bidirectional Ray Tracing

● Computationally expensive.● Much more accurate model though.● Real problem is number of photons to trace.● Can use refinement methods:

■ Trace so many photons, render and check…■ and so on until rendering acceptable.

● Area sampling techniques can be used.

Page 31: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

31

Bidirectional example

Single Pass (Conventional RT) Two Pass (Bidirectional)

Note : caustic due to red transparent ball

Page 32: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

32

Bidirectional example

200 rays used in lighting pass 400 rays used in lighting pass

Page 33: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

33

Bidirectional example

800 rays used in lighting pass.

Note:- improved caustic definition,- lighting effect of mirror, - reflection of caustic,- shadowing due to mirror lighting.

Page 34: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.

34

Summary of bidirectional RT

● Trace rays from light source to surfaces.● Gives secondary lighting and caustics that conventional

ray tracing misses.● Accumulate surface hits – may require large number of

hits for adequate intensity.● Code for both ray trace directions can be identical.

Page 35: Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.