47
Philipp Slusallek & Arsène Pérard-Gayot Computer Graphics - Light Transport -

Computer Graphics - Light Transport

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Computer Graphics - Light Transport

Philipp Slusallek & Arsène Pérard-Gayot

Computer Graphics

- Light Transport -

Page 2: Computer Graphics - Light Transport

Overviewβ€’ So far

– Nuts and bolts of ray tracing

β€’ Today– Light

β€’ Physics behind ray tracing

β€’ Physical light quantities

β€’ Perception of light

β€’ Light sources

– Light transport simulation

β€’ Next lecture– Reflectance properties

– Shading

2

Page 3: Computer Graphics - Light Transport

LIGHT

3

Page 4: Computer Graphics - Light Transport

What is Light ?β€’ Electro-magnetic wave propagating at speed of light

4

Page 5: Computer Graphics - Light Transport

What is Light ?

5

[Wikipedia]

Page 6: Computer Graphics - Light Transport

What is Light ?β€’ Ray

– Linear propagation

– Geometrical optics

β€’ Vector– Polarization

– Jones Calculus: matrix representation

β€’ Wave– Diffraction, interference

– Maxwell equations: propagation of light

β€’ Particle– Light comes in discrete energy quanta: photons

– Quantum theory: interaction of light with matter

β€’ Field– Electromagnetic force: exchange of virtual photons

– Quantum Electrodynamics (QED): interaction between particles

6

Page 7: Computer Graphics - Light Transport

What is Light ?β€’ Ray

– Linear propagation

– Geometrical optics

β€’ Vector– Polarization

– Jones Calculus: matrix representation

β€’ Wave– Diffraction, interference

– Maxwell equations: propagation of light

β€’ Particle– Light comes in discrete energy quanta: photons

– Quantum theory: interaction of light with matter

β€’ Field– Electromagnetic force: exchange of virtual photons

– Quantum Electrodynamics (QED): interaction between particles

7

Page 8: Computer Graphics - Light Transport

Light in Computer Graphicsβ€’ Based on human visual perception

– Macroscopic geometry ( Reflection Models)

– Tristimulus color model ( Human Visual System)

– Psycho-physics: tone mapping, compression, … ( RIS course)

β€’ Ray optic assumptions– Macroscopic objects

– Incoherent light

– Light: scalar, real-valued quantity

– Linear propagation

– Superposition principle: light contributions add, do not interact

– No attenuation in free space

β€’ Limitations– No microscopic structures (β‰ˆ Ξ»): diffraction, interference

– No polarization

– No dispersion, …

8

Page 9: Computer Graphics - Light Transport

Angle and Solid Angleβ€’ The angle ΞΈ (in radians) subtended by a curve in the

plane is the length of the corresponding arc on the unit circle: l = ΞΈ r = ΞΈ

β€’ The solid angle Ξ©, dΟ‰ subtended by an object is the surface area of its projection onto the unit sphere– Units for measuring solid angle: steradian [sr] (dimensionless)

9

Page 10: Computer Graphics - Light Transport

Solid Angle in Spherical Coords‒ Infinitesimally small solid angle dω

– 𝑑𝑒 = π‘Ÿ π‘‘πœƒβ€“ 𝑑𝑣 = π‘ŸΒ΄ 𝑑Φ = π‘Ÿ sin πœƒ 𝑑Φ– 𝑑𝐴 = 𝑑𝑒 𝑑𝑣 = π‘Ÿ2 sinπœƒ π‘‘πœƒπ‘‘Ξ¦

– π‘‘πœ” = ΀𝑑𝐴 π‘Ÿ2 = sinπœƒ π‘‘πœƒπ‘‘Ξ¦

β€’ Finite solid angle

10

du

rdΞΈ

r’

dΦ

dA

dv

ΞΈ

Ξ¦

dω1

Page 11: Computer Graphics - Light Transport

Solid Angle for a Surfaceβ€’ The solid angle subtended by a small surface patch S with area dA is

obtained (i) by projecting it orthogonal to the vector r from the origin:

𝑑𝐴 π‘π‘œπ‘  πœƒ

and (ii) dividing by the squared distance to the origin: dπœ” =d𝐴 cos πœƒ

π‘Ÿ2

11

Page 12: Computer Graphics - Light Transport

Radiometryβ€’ Definition:

– Radiometry is the science of measuring radiant energy transfers. Radiometric quantities have physical meaning and can be directly measured using proper equipment such as spectral photometers.

β€’ Radiometric Quantities– Energy [J] Q (#Photons x Energy = 𝑛 β‹… β„Žπœˆ)

– Radiant power [watt = J/s] Ξ¦ (Total Flux)

– Intensity [watt/sr] I (Flux from a point per s.angle)

– Irradiance [watt/m2] E (Incoming flux per area)

– Radiosity [watt/m2] B (Outgoing flux per area)

– Radiance [watt/(m2 sr)] L (Flux per area & proj. s. angle)

12

Page 13: Computer Graphics - Light Transport

Radiometric Quantities: Radiance

β€’ Radiance is used to describe radiant energy transfer

β€’ Radiance L is defined as– The power (flux) traveling through some point x

– In a specified direction Ο‰ = (ΞΈ, Ο†)

– Per unit area perpendicular to the direction of travel

– Per unit solid angle

β€’ Thus, the differential power π’…πŸπš½ radiated through the differential solid angle π’…πŽ, from the projected differential area 𝒅𝑨 𝒄𝒐𝒔 𝜽 is:

13

Ο‰

dA

𝑑2Ξ¦ = 𝐿 π‘₯,πœ” 𝑑𝐴 cos πœƒ π‘‘πœ”

Page 14: Computer Graphics - Light Transport

Radiometric Quantities: Irradiance

β€’ Irradiance E is defined as the total power per unit area(flux density) incident onto a surface. To obtain the total flux incident to dA, the incoming radiance Li is integrated over the upper hemisphere Ξ©+ above the surface:

𝐸 ≑𝑑Φ

𝑑𝐴

14

Page 15: Computer Graphics - Light Transport

Radiometric Quantities: Radiosity

β€’ Irradiance E is defined as the total power per unit area(flux density) incident onto a surface. To obtain the total flux incident to dA, the outgoing radiance Lo is integrated over the upper hemisphere Ξ©+ above the surface:

𝐡 ≑𝑑Φ

𝑑𝐴

15

Radiosity Bexitant from

Page 16: Computer Graphics - Light Transport

Spectral Propertiesβ€’ Wavelength

– Light is composed of electromagnetic waves

– These waves have different frequencies and wavelengths

– Most transfer quantities are continuous functions of wavelength

β€’ In graphics– Each measurement L(x,Ο‰) is for a discrete band of wavelength

only

β€’ Often R(ed, long), G(reen, medium), B(lue, short) (but see later)

16

Page 17: Computer Graphics - Light Transport

Photometry– The human eye is sensitive to a limited range of wavelengths

β€’ Roughly from 380 nm to 780 nm

– Our visual system responds differently to different wavelengths

β€’ Can be characterized by the Luminous Efficiency Function V(Ξ»)

β€’ Represents the average human spectral response

β€’ Separate curves exist for light and dark adaptation of the eye

– Photometric quantities are derived from radiometric quantities by integrating them against this function

17

Page 18: Computer Graphics - Light Transport

Radiometry vs. Photometry

18

Physics-based quantities Perception-based quantities

Page 19: Computer Graphics - Light Transport

Perception of Light

19

The eye detects radiance

f

rod sensitive to flux

angular extent of rod = resolution ( 1 arcminute2)

r

22 /' lr angular extent of pupil aperture (r 4 mm) = solid angle

'

l

A

projected rod size = area 2lA

radiance = flux per unit area per unit solid angleA

L

'

'A Lflux proportional to area and solid angle

As l increases:const

2

22

0 Ll

rlL

photons / second = flux = energy / time = power (𝚽)

(1 arcminute = 1/60 degrees)

Page 20: Computer Graphics - Light Transport

Brightness Perception

20

f

r

l

A

β€’ A’ > A : photon flux per rod stays constant

β€’ A’ < A : photon flux per rod decreases

Where does the Sun turn into a star ?

Depends on apparent Sun disc size on retina

Photon flux per rod stays the same on Mercury, Earth or Neptune

Photon flux per rod decreases when ’ < 1 arcminute2 (beyond Neptune)

'A

'

Page 21: Computer Graphics - Light Transport

Radiance in Space

21

1L1d

1dA

2L2d

2dAl

The radiance in the direction of a light rayremains constant as it propagates along the ray

Flux leaving surface 1 must be equal to flux arriving on surface 2

2

21

l

dAd

2

12

l

dAd From geometry follows

2

212211

l

dAdAdAddAdT

Ray throughput 𝑇:

𝐿1𝑑Ω1𝑑𝐴1 = 𝐿2𝑑Ω2𝑑𝐴2

𝐿1 = 𝐿2

Page 22: Computer Graphics - Light Transport

Point Light Sourceβ€’ Point light with isotropic radiance

– Power (total flux) of a point light source

β€’ Ξ¦g = Power of the light source [watt]

– Intensity of a light source (radiance cannot be defined, no area)

β€’ I = Ξ¦g / 4Ο€ [watt/sr]

– Irradiance on a sphere with radius r around light source:

β€’ Er = Ξ¦g / (4 Ο€ r2) [watt/m2]

– Irradiance on some other surface A

22

dA

r

d

𝐸 π‘₯ =𝑑Φ𝑔

𝑑𝐴=𝑑Φ𝑔

π‘‘πœ”

π‘‘πœ”

𝑑𝐴= 𝐼

π‘‘πœ”

𝑑𝐴

=Φ𝑔

4πœ‹β‹…π‘‘π΄ cos πœƒ

π‘Ÿ2𝑑𝐴

=Φ𝑔

4πœ‹β‹…cos πœƒ

π‘Ÿ2

Page 23: Computer Graphics - Light Transport

Inverse Square Law

β€’ Irradiance E: power per m2

– Illuminating quantity

β€’ Distance-dependent– Double distance from emitter: area of sphere is four times bigger

β€’ Irradiance falls off with inverse of squared distance– For point light sources (!)

23

E

E

d

d

1

2

2

2

1

2=

Irradiance E:

E2

E1

d1

d2

Page 24: Computer Graphics - Light Transport

Light Source Specificationsβ€’ Power (total flux)

– Emitted energy / time

β€’ Active emission size– Point, line, area, volume

β€’ Spectral distribution– Thermal, line spectrum

β€’ Directional distribution– Goniometric diagram

24

Black body radiation (see later)

Page 25: Computer Graphics - Light Transport

Radiation characteristics

β€’ Directional light– Spot-lights

– Projectors

– Distant sources

β€’ Diffuse emitters– Torchieres

– Frosted glass lamps

β€’ Ambient light– β€œPhotons everywhere”

Emitting area

β€’ Volume– Neon advertisements– Sodium vapor lamps

β€’ Area– CRT, LCD display– (Overcast) sky

β€’ Line– Clear light bulb, filament

β€’ Point– Xenon lamp– Arc lamp– Laser diode

Light Source Classification

Page 26: Computer Graphics - Light Transport

Sky Lightβ€’ Sun

– Point source (approx.)

– White light (by def.)

β€’ Sky– Area source

– Scattering: blue

β€’ Horizon– Brighter

– Haze: whitish

β€’ Overcast sky– Multiple scattering

in clouds

– Uniform grey

β€’ Several sky modelsare available

26

Courtesy Lynch & Livingston

Page 27: Computer Graphics - Light Transport

LIGHT TRANSPORT

27

Page 28: Computer Graphics - Light Transport

Light Transport in a Sceneβ€’ Scene

– Lights (emitters)

– Object surfaces (partially absorbing)

β€’ Illuminated object surfaces become emitters, too!– Radiosity = Irradiance minus absorbed photons flux density

β€’ Radiosity: photons per second per m2 leaving surface

β€’ Irradiance: photons per second per m2 incident on surface

β€’ Light bounces between all mutually visible surfaces

β€’ Invariance of radiance in free space– No absorption in-between objects

β€’ Dynamic energy equilibrium– Emitted photons = absorbed photons (+ escaping photons)

β†’ Global Illumination, discussed in RIS lecture

28

Page 29: Computer Graphics - Light Transport

Surface Radiance

β€’ Visible surface radiance– Surface position

– Outgoing direction

β€’ Incoming illumination direction

β€’ Self-emission

β€’ Reflected light– Incoming radiance from all directions

– Direction-dependent reflectance(BRDF: bidirectional reflectancedistribution function)

29

𝐿 π‘₯,πœ”π‘œπ‘₯πœ”π‘œ

πœ”π‘–

𝐿𝑒 π‘₯,πœ”π‘œ

𝐿𝑖 π‘₯, πœ”π‘–

π‘“π‘Ÿ πœ”π‘–, π‘₯, πœ”π‘œ

i

o

x

i

Page 30: Computer Graphics - Light Transport

Rendering Equationβ€’ Most important equation for graphics

– Expresses energy equilibrium in scene

total radiance = emitted + reflected radiance

β€’ First term: emissivity of the surface– Non-zero only for light sources

β€’ Second term: reflected radiance– Integral over all possible incoming

directions of radiance timesangle-dependent surface reflection function

β€’ Fredholm integral equation of 2nd kind– Unknown radiance appears both on the

left-hand side and inside the integral– Numerical methods necessary to compute

approximate solution

30

i

o

x

i

Page 31: Computer Graphics - Light Transport

Rendering Equation: Approximations

β€’ Approximations based only on empirical foundations– An example: polygon rendering in OpenGL

β€’ Using RGB instead of full spectrum– Follows roughly the eye’s sensitivity

β€’ Sampling hemisphere along finite, discrete directions– Simplifies integration to summation

β€’ Reflection function model (BRDF)– Parameterized function

β€’ Ambient: constant, non-directional, background light

β€’ Diffuse: light reflected uniformly in all directions

β€’ Specular: light from mirror-reflection direction

31

Page 32: Computer Graphics - Light Transport

Ray Tracing

β€’ Simple ray tracing– Illumination from discrete point light

sources only – direct illumination only

β€’ Integral β†’ sum

β€’ No global illumination

– Evaluates angle-dependent reflectance function (BRDF) – shading process

β€’ Advanced ray tracing techniques– Recursive ray tracing

β€’ Multiple reflections/refractions (for specular surfaces)

– Ray tracing for global illuminationβ€’ Stochastic sampling

(Monte Carlo methods)

β€’ Photon mapping

32

Page 33: Computer Graphics - Light Transport

RE: Integrating over Surfacesβ€’ Outgoing illumination at a point

β€’ Linking with other surface points– Incoming radiance at x is outgoing radiance at y

𝐿𝑖 π‘₯,πœ”π‘– = 𝐿 𝑦,βˆ’πœ”π‘– = 𝐿 𝑅𝑇 π‘₯, πœ”π‘– , βˆ’πœ”π‘–

– Ray-Tracing operator: y = 𝑅𝑇 π‘₯,πœ”π‘–

33

𝐿 π‘₯,πœ”π‘œ = 𝐿𝑒 π‘₯, πœ”π‘œ + πΏπ‘Ÿ(π‘₯, πœ”π‘œ)

-i

yL(y,-wi)

i

x

Li(x,wi)

Page 34: Computer Graphics - Light Transport

Integrating over Surfacesβ€’ Outgoing illumination at a point

β€’ Re-parameterization over surfaces S

π‘‘πœ”π‘– =cosπœƒπ‘¦π‘₯ βˆ’ 𝑦 2 𝑑𝐴𝑦

34

n

yn

i

y

yx

dA

ydA

x

y

i

id

𝐿 π‘₯, πœ”π‘œ

= 𝐿𝑒 π‘₯,πœ”π‘œ

Page 35: Computer Graphics - Light Transport

Integrating over Surfaces

35

𝐿 π‘₯, πœ”π‘œ

= 𝐿𝑒 π‘₯,πœ”π‘œ

Page 36: Computer Graphics - Light Transport

Radiosity Algorithmβ€’ Lambertian surface (only diffuse reflection)

– Radiosity equation: simplified form of the rendering equation

β€’ Dividing scene surfaces into small planar patches– Assumes local constancy: diffuse reflection, radiosity, visibility

β€’ β€œRadiosity” algorithms: Discretizes into linear equation

β€’ Algorithm– Form factor: percentage of light flowing between 2 patches

– Form system of linear equations

– Iterative solution

– Discussed in details in RIS course

36

Page 37: Computer Graphics - Light Transport

β€’ Diffuse reflection constant BRDF & emission

– Reflectance factor or albedo: between [0,1]

β€’ Direction-independent out-going radiance

β€’ Form factor– Defines percentage of light

leaving dAy arriving at dA

Radiosity Equation

37

π‘“π‘Ÿ πœ” π‘₯, 𝑦 , π‘₯, πœ”π‘œ = π‘“π‘Ÿ π‘₯ β‡’

= 𝐿𝑒 π‘₯ + π‘“π‘Ÿ π‘₯ 𝐸 π‘₯ = πΏπ‘œ π‘₯

Page 38: Computer Graphics - Light Transport

Radiosity Equationβ€’ Radiosity

β€’ Irradiance

38

𝐡 π‘₯ = πœ‹πΏπ‘’ π‘₯ + πœ‹π‘“π‘Ÿ π‘₯ 𝐸(π‘₯) = 𝐡𝑒 π‘₯ + 𝜌 π‘₯ 𝐸(π‘₯)

Page 39: Computer Graphics - Light Transport

Linear Operatorsβ€’ Properties

– Fredholm equation of 2nd kind

– Global linking

β€’ Potentially each point with each other

β€’ Often sparse system (occlusions)

– No consideration of volume effects!!

β€’ Linear operator– Acts on functions like matrices

act on vectors

– Superposition principle

– Scaling and addition

39

𝐡 π‘₯ = 𝐡𝑒 π‘₯ + 𝜌(π‘₯) ΰΆ±π‘¦βˆˆπ‘†

𝐹 π‘₯, 𝑦 𝐡 𝑦 𝑑𝐴𝑦

𝑓 π‘₯ = 𝑔 π‘₯ + 𝐾[𝑓 π‘₯ ]

𝐾 𝑓 π‘₯ = ∫ π‘˜ π‘₯, 𝑦 𝑓 𝑦 𝑑𝑦

𝐾 π‘Žπ‘“ + 𝑏𝑔 = π‘ŽπΎ 𝑓 + 𝑏𝐾[𝑔]

Page 40: Computer Graphics - Light Transport

Formal Solution of Integral Equations

β€’ Integral equation

β€’ Formal solution

β€’ Neumann series– Converges only if |K| < 1 which is true in all physical settings

40

𝐡 π‘₯ = 𝐡𝑒 π‘₯ + 𝜌(π‘₯) ΰΆ±π‘¦βˆˆπ‘†

𝐹 π‘₯, 𝑦 𝐡 𝑦 𝑑𝐴𝑦

𝐡 β‹… = 𝐡𝑒 β‹… + 𝐾 𝐡 β‹… β‡’ 𝐼 βˆ’ 𝐾 𝐡 β‹… = 𝐡𝑒 β‹…

𝐡(β‹…) = 𝐼 βˆ’ 𝐾 βˆ’1 𝐡𝑒 β‹…

1

1 βˆ’ π‘₯= 1 + π‘₯ + π‘₯2 +β‹―

1

𝐼 βˆ’ 𝐾= 𝐼 + 𝐾 + 𝐾2 +β‹―

𝐼 βˆ’ 𝐾1

𝐼 βˆ’ 𝐾= 𝐼 βˆ’ 𝐾 𝐼 + 𝐾 + 𝐾2 + β‹― = 𝐼 + 𝐾 + 𝐾2 + β‹―βˆ’ 𝐾+ 𝐾2 +β‹― = 𝐼( )

Page 41: Computer Graphics - Light Transport

Formal Solutions (2)β€’ Successive approximation

– Direct light from the light source

– Light which is reflected and transported at most once

– Light which is reflected and transported up to n times

41

= 𝐡𝑒 β‹… + 𝐾[𝐡𝑒 β‹… + 𝐾 𝐡𝑒 β‹… + β‹― ]

𝐡1 β‹… = 𝐡𝑒 β‹…

𝐡2 β‹… = 𝐡𝑒 β‹… + 𝐾[𝐡𝑒 β‹… ]

𝐡𝑛 β‹… = 𝐡𝑒 β‹… + 𝐾[π΅π‘›βˆ’1 β‹… ]

Page 42: Computer Graphics - Light Transport

Radiosity Algorithm

42

Page 43: Computer Graphics - Light Transport

Radiosity Algorithm

43

Page 44: Computer Graphics - Light Transport

Lighting Simulation

44

Page 45: Computer Graphics - Light Transport

Lighting Simulation

45

Page 46: Computer Graphics - Light Transport

Lighting Simulation

46

Page 47: Computer Graphics - Light Transport

Wrap Upβ€’ Physical Quantities in Rendering

– Radiance

– Radiosity

– Irradiance

– Intensity

β€’ Light Perception

β€’ Light Source Definition

β€’ Rendering Equation– Key equation in graphics (!)

– Integral equation

– Describes global balance of radiance

47