31
Radiosity 1

Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

Embed Size (px)

Citation preview

Page 1: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

Radiosity

1

Page 2: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

2

Introduction

•Ray tracing best with many highly specular surfaces

Not real scenes

•Rendering equation describes general shading problem

•Radiosity solves rendering equation for perfectly diffuse surfaces

Page 3: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

3

Terminology

•Energy ~ light (incident, transmitted) Must be conserved

•Energy flux = luminous flux = power = energy/unit time

Measured in lumens

Depends on wavelength so can integrate over spectrum using luminous efficiency curve of sensor

•Energy density (Φ) = energy flux/unit area

Page 4: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

4

Terminology

Intensity ~ brightness/lightness Brightness/lightness perceptual

= flux/area-solid angle = power/unit projected area per solid angle

Measured in candela

Φ = ∫ ∫ I dA dω

Page 5: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

5

Rendering Eqn (Kajiya)

•Consider point on surface

N

Iout(Φout)Iin(Φin)

Page 6: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

6

Rendering Equation

•Outgoing light from two sources Emission

Reflection of incoming light

•Must integrate over all incoming light Integrate over hemisphere

•Must account for foreshortening of incoming light

Page 7: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

7

Rendering Equation

Iout(Φout) = E(Φout) + ∫ 2πRbd(Φout, Φin )Iin(Φin) cos θ dω

bidirectional reflection coefficient

angle between normal and Φinemission

Note that angle is really two angles in 3D and wavelength is fixed

Page 8: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

8

Rendering Equation

• Rendering equation = energy balance Energy in = energy out

• Integrate over hemisphere

• Fredholm integral equation Cannot solve analytically in general

• Various approximations of Rbd give standard rendering models

• Should also add occlusion term in front of right side to account for other objects blocking light from reaching surface

Page 9: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

9

Another version

Consider light at point p arriving from p’

i(p, p’) = υ(p, p’)(ε(p,p’) + ∫ ρ(p, p’, p’’)i(p’, p’’)dp’’

occlusion = 0 or 1/d2emission from p’ to p

light reflected at p’ from all points p’’ towards p

Page 10: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

10

Radiosity

•Consider objects to be broken up into flat patches

may correspond to polygons in model

•Assume patches = perfectly diffuse reflectors

•Radiosity = flux = energy/unit area/ unit time leaving patch

Page 11: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

11

Notation

n patches numbered 1 to n

bi = radiosity of patch i

ai = area of patch i

bi ai = total intensity leaving patch i

ei ai = emitted intensity from patch i

ρi = reflectivity of patch i

fij = form factor = fraction of energy leaving patch j that reaches patch i

Page 13: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

13

Radiosity Equation

energy balance

biai = eiai + ρi ∑ fjibjaj

reciprocity

fijai = fjiaj

radiosity equation

bi = ei + ρi ∑ fijbj

emitted reflected

Page 14: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

14

Matrix Form

b = [bi]

e = [ei]

R = [rij] rij = ρi if i ≠ j rii = 0

F = [fij]

Page 15: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

15

Matrix Form

b = e - RFb

formal solution

b = [I-RF]-1e

Not useful since n usually very largeAlternative: use observation that F is sparse

Will consider determination of form factors later

Page 16: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

16

Solving the Radiosity Equation

For sparse matrices, iterative methods usuallyrequire only O(n) operations per iteration

Jacobi’s method

bk+1 = e - RFbk

Gauss-Seidel: use immediate updates

Page 17: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

17

Series Approximation

1/(1-x) = 1 + x + x2+ ……

b = [I-RF]-1e = e + RFe + (RF)2e +…

[I-RF]-1 = I + RF +(RF)2+…

Page 18: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

18

Rendered Image

Page 19: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

19

Patches

Page 20: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

20

Computing Form Factors

•Consider two flat patches

Page 21: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

21

Using Differential Patches

foreshortening

Page 22: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

22

Form Factor Integral

fij = (1/ai) ∫ai ∫ai (oij cos θi cos θj / πr2 )dai daj

occlusion

foreshortening of patch i

foreshortening of patch j

Page 23: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

23

Solving the Intergral

•Very few cases where integral has (simple) closed form solution

Occlusion further complicates solution

•Alternative: use numerical methods•Two step process similar to texture mapping

Hemisphere

Hemicube

Page 24: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

24

Form Factor Examples 1

Page 25: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

25

Form Factor Examples 2

Page 26: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

26

Form Factor Examples 3

Page 27: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

27

Hemisphere

•Use illuminating hemisphere•Center hemisphere on patch with normal pointing up

•Must shift hemisphere for each point on patch

Page 28: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

28

Hemisphere

Page 29: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

29

Hemicube

•Easier to use hemicube instead of hemisphere

•Rule each side into “pixels”•Easier to project on pixels give delta form factors can be added up to give desired form factor

•To get delta form factor need only cast ray through each pixel

Page 30: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

30

Hemicube

Page 31: Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces Not real scenes Rendering equation describes general shading problem

31

Instant Radiosity

•Want to use graphics system if possible•Suppose make one patch emissive•Light from this patch distributed among other patches

•Shade of other patches ~ form factors•Must use multiple OpenGL point sources to approximate uniformly emissive patch