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

Post on 17-Dec-2015

217 views 0 download

Tags:

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

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

2

Point illumination

3

Ray Tracing

4

Diffuse Reflection & Color Bleeding

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

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.

7

Which one is Better

Raytraced Radiosity

Herik Wann Jensen

8

Radiosity: Cornell Experiment

Measured Simulated

Program of Computer GraphicsCornell University

9

Radiosity: Cornell Experiment

Measured Simulated

Difference

10

Early Radiosity

Shenchang Eric Chang et al., Cornell 1988

11

Types of Surface Reflectance

Specular-specular(ray tracing)

Diffuse-diffuse(radiosity)

Specular-diffuse(Monte Carlo)

Diffuse-specular(Monte Carlo)

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.

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

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

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.

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.

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

18

Radiosity Equation

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

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?

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

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

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!

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.

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

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

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

28

Bidirectional Ray Tracing

L

A

B

C

E*

*

* - these transports would be missed by conventional RT.

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.

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.

31

Bidirectional example

Single Pass (Conventional RT) Two Pass (Bidirectional)

Note : caustic due to red transparent ball

32

Bidirectional example

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

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.

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.