1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok [email protected].

34
1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok [email protected]
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    214
  • download

    1

Transcript of 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok [email protected].

Page 1: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

1

7M836 Animation & Rendering

Global illumination, radiosity

Arjan Kok

[email protected]

Page 2: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

2

Direct and indirect illumination

Page 3: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

3

Global illumination

• Light paths

• Complete solution: L(D|S)*E

• Ray tracing: L(S*)DS*E

• Still missing in ray tracing:

• Diffuse interreflection: D*

• Diffuse/specular interreflection: (D|S)*

• These terms approximated with ambient light

Page 4: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

4

Diffuse interreflection

• Why specular reflection in in ray tracing and why diffuse interreflection not?

Page 5: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

5

Radiosity method

• Radiosity method computes diffuse interreflection of objects• Diffuse interreflection is not longer approximated by

ambient light

• Basic idea• Subdivide all polygons in elements for which one

energy value (~ color) must be computed• Treat every element in scene as light source• Computer for each element the total amount of radiated

energy

Page 6: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

6

Radiosity

Page 7: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

7

Radiosity effects

• Soft shadows

• Color bleeding

Page 8: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

8

Radiosity

• Radiosity (B) is energy per unit area that leaves surface

so

• Radiosity is sum of energy

• Emitted by surface (light sources)

• Reflected by surface

Page 9: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

9

Radiosity equation

• Bi = Radiosity of element i• Ei = Emission of element i• ρi = Reflection coefficient (diffuse) of element i (kdCd)• Fji = Form-factor between elements j en i

(= fraction of energy leaving element j that reaches element i)

FijAi = FjiAj

j

jijjiiiii FABAEAB

j

ijjiii FBEB

Page 10: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

10

Form factor

• Form-factor Fij is fraction of total energy of patch i that reaches patch j

• Vij = 1 if dAj visible from dAi

0 if not visible

Aj

dAj

dAi

Nj

Ni

Ai

θj

θi

r

iA

i

jAjij2

ji

i

ij dAdAVr

coscos

A1

F

Page 11: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

11

Radiosity solution

• Solve for all elements the radiosity equation:

• Methods:

• Full-matrix radiosity

• Progressive refinement radiosity

j

ijjiii FBEB

Page 12: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

12

Radiosity

• Result of radiosity: radiosity value (~ diffuse intensity) for each element

• Radiosity is viewpoint independent

• One solution can be used to generate several images

modelingtransform

newmodel

radiosity(== lighting)

Page 13: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

13

Radiosity solution

• Solve for all elements the radiosity equation:

• Methods:

• Full-matrix radiosity

• Progressive refinement radiosity

j

ijjiii FBEB

Page 14: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

14

Matrix radiosity

n

2

1

n

2

1

n,nn1,nn

n,1n1n1,1n1n

n,222,221,22

n,111,11

E

.

.

.

E

E

B

.

.

.

B

B

F1...F

F...F

.....

.....

F..F1F

F...F1

Page 15: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

15

Matrix radiosity

• Disadvantages of matrix method

• High time and memory cost: (O(n2))

• n = number of elements

• All form-factors have to be computed

• Even for areas in scene where there is almost no energy exchange

Page 16: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

16

Progressive radiosity

• Contribution Bi to Bj:

• Shoot all energy from element i, and compute contribution to radiosities of all elements j in the scene

• Initially all radiosities of all elements are 0, except radiosities of light sources

i

jijjj BiFEB

jiij FB

Page 17: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

17

Progressive radiosity

for all elements assign emission value to radiosity and to “unshot” radiosity

do

determine element i with most “unshot” energyfor all other elements j do

compute contribution of patch i to patch jincrease radiosity element j with this contributionincrease unshot radiosity element j with this

contributionunshot radiosity of element i set to 0

until convergence reached

Page 18: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

18

Progressive radiosity

Initialization

Bj, ΔBj = Ej for all light source elements

Bj, ΔBj = 0 for all other elements

do find element i with most “unshot” energy ΔBiAi;for all other elements j do

compute form-factor Fij

ΔRad = ρj * ΔBi * Fij * (Ai/Aj)ΔBj = ΔBj + ΔRadBj = Bj + ΔRad;

ΔBi = 0;until convergence reached

Page 19: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

19

Progressive radiosity

• Advantages

• Less memory consumption

• Ability to inspect process

• Ability to stop before process completely converged

Page 20: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

20

Radiosity

• Result: 1 radiosity value per elementso 1 color per element

• Meshing:

• Partition surfaces in scene into small elements

• Meshing conditions

• Good representation of intensity changes

• As less elements as possible

Page 21: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

21

Meshing

• Uniform meshing

• Adaptive meshing

• Make (uniform) start mesh and modify mesh (more elements) where large intensity differences found

• Discontinuity meshing

• Determine before radiosity computations where large intensity changes will occur. Mesh finer along intensity transitions (disconit

Page 22: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

22

Uniform mesh

Page 23: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

23

Reference picture & uniform mesh

Page 24: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

24

Meshing problems

Page 25: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

25

Increase resolution

Page 26: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

26

Adaptive meshing

Page 27: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

27

Shadow and light leaks

Page 28: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

28

T-Vertices

Page 29: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

29

Radiosity steps

• Create scene

• Take care of accurate material and light source definitions

• During modeling, keep in mind the problems that can occur during application of radiosity

• Make a coarse meshing, compute and inspect results

• Adapt materials and light sources

• Make a “good” meshing

• Compute radiosity results

• Use radiosity results to make one or more images

Page 30: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

30

Radiosity summarized

• Computation of diffuse interreflection

• Result radiosity: intensities for patches

• Viewpoint independent

• Accuracy of results depends on meshing

• High memory and time costs

Page 31: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

31

Rendering after radiosity step - 1

• Direct use of radiosity results:

• Radiosity results replaces diffuse computation in local illumination function

• Gouraud shading

• Fine meshing to get nice shadows

Page 32: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

32

Rendering after radiosity step - 2

• Use radiosity results for indirect illumination only

• Re-compute direct light during rendering

• Less fine meshing required

Page 33: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

33

Rendering after radiosity step - 3

• Use radiosity results to re-compute direct and indirect illumination

• Use radiosity results as emission values

• Regard all patches will as light sources

• Coarse meshing suffices

Page 34: 1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok a.j.f.kok@tue.nl.

34

Radiosity Ray tracing

• Viewpoint independent• Diffuse (inter)reflections• Color bleeding• Area light sources• Soft shadows• Light paths: D*

(and (D|S)*)

• High memory use• Meshing determines

accuracy results• High computation times

• Viewpoint dependent

• Real specular reflections

• Transmission + refraction

• Point light sources

• Sharp shadows

• Light paths LDS*E(and LS*DS*E)

• Low memory use