02941 Physically Based Rendering Reflection and Transmission Jeppe - - PowerPoint PPT Presentation

02941 physically based rendering
SMART_READER_LITE
LIVE PREVIEW

02941 Physically Based Rendering Reflection and Transmission Jeppe - - PowerPoint PPT Presentation

02941 Physically Based Rendering Reflection and Transmission Jeppe Revall Frisvad June 2016 Multiscale light modelling Light at different scales: Quantum electrodynamics (photons) Electromagnetic radiation (waves) Geometrical


slide-1
SLIDE 1

02941 Physically Based Rendering

Reflection and Transmission

Jeppe Revall Frisvad June 2016

slide-2
SLIDE 2

Multiscale light modelling

◮ Light at different scales:

◮ Quantum electrodynamics (photons) ◮ Electromagnetic radiation (waves) ◮ Geometrical optics (rays) ◮ Radiative transfer (ray bundles)

◮ Why do we need to know? To understand:

◮ how light interacts with materials; ◮ where the material properties come from; ◮ when rays don’t work.

◮ Geometrical optics include:

◮ the law of reflection (Euclid ∼300 B.C. and before); ◮ the law of refraction (Ibn Sahl ∼984, Snel van Royen 1621).

◮ Electromagnetic radiation (Maxwell 1873) includes:

◮ the index of refraction; ◮ the amount of reflection and transmission at a specular surface (Fresnel 1832).

slide-3
SLIDE 3

Time-harmonic Maxwell equations for isotropic materials

∇ × Hc = (σ − iωε)Ec ∇ × Ec = iωµHc ∇ · (εEc) = ∇ · (µHc) = 0 , where ◮ ω = 2πc/λ is the angular frequency of the light ◮ Re(Ec) is the electric field vector ◮ Re(Hc) is the magnetic vector ◮ and the following are the isotropic material properties:

◮ σ is the conductivity ◮ ε is the permittivity ◮ µ is the permeability

slide-4
SLIDE 4

The plane wave solution

◮ Reflection and refraction occurs at a surface marking the boundary between two (at least locally) homogeneous materials. ◮ Plane waves satisfy the time-harmonic Maxwell equations for isotropic and homogeneous materials. ◮ The plane wave equations are: Ec(x, t) = E0e−i(ωt−k·x) Hc(x, t) = H0e−i(ωt−k·x) . where

◮ x is a position in space ◮ t is time ◮ E0 and H0 are wave amplitudes ◮ k is the wave vector.

slide-5
SLIDE 5

Plane wave Maxwell equations

◮ The plane wave solution inserted in the time-harmonic Maxwell equations for isotropic, homogeneous materials: k × H0 = −ω(ε + iσ/ω)E0 k × E0 = ωµH0 k · E0 = k · H0 = 0 . ◮ This boils down to the following conditions that plane waves must satisfy to be physically realisable: k · E0 = k · H0 = E0 · H0 = 0 k · k = ω2µ(ε + iσ/ω) . ◮ Thus k is a complex vector if the material is a conductor.

slide-6
SLIDE 6

The meaning of the wave vector

◮ Consider the exponential part of the plane wave equation: e−i(ωt−k·x) = e−iωteik·x ◮ The first part concerns temporal aspects, the second part concerns spatial aspects. ◮ The wave vector k determines the spatial aspect (the wave propagation). ◮ If the material is a conductor, k = k′ + ik′′ is complex: ei k·x = ei k′·xe−k′′·x . ◮ This reveals that the phase velocity is v = ω/k′ and

◮ k′ is normal to the surface of constant phase ◮ k′′ is normal to the surface of constant amplitude

◮ They determine the direction and damping of the wave.

slide-7
SLIDE 7

The index of refraction (IOR)

◮ Recall the only remaining condition which involves material properties: k · k = ω2µ(ε + iσ/ω) . ◮ This is a golden opportunity to reduce the number of material properties. ◮ Suppose we introduce n = n′ + in′′ = c

  • µ(ε + iσ/ω) .

◮ Then the condition becomes k · k = ω2 c2 n2 , where

◮ c is the speed of light in vacuo. ◮ n is called the (complex) index of refraction.

slide-8
SLIDE 8

Phase velocity and amplitude damping

◮ A closer look at the condition which describes the relation between material and wave propagation: k · k = k′ · k′ − k′′ · k′′ + i2k′ · k′′ = ω2 c2 n2 . ◮ For materials that are not strong absorbers: k′′ · k′′ ≈ 0. ◮ Then (equating the real parts): k′ ≈ ω c n′ ⇒ v = ω k′ ≈ c n′ the phase velocity v is determined by the real part of the IOR. ◮ And (equating the imaginary parts): 2k′k′′ cos θ = ω2 c2 2n′n′′ ⇒ k′′ ≈ ω c n′′ cos θ ≈ ω c n′′ , where θ (usually close to 0) is the angle between k′ and k′′.

slide-9
SLIDE 9

The Poynting vector and absorption

◮ The Poynting vector S determines the direction and magnitude of energy propagation in an electromagnetic field. ◮ For the plane wave solution, we have: S = ε0c2µ Re(Ec) × Re(Hc) . ◮ Inserting the plane wave equations and taking the magnitude of S determines the absorption of energy by the material: |S| = ε0c2µ

  • Re(E0e−i(ωt−k′·x)) × Re(H0e−i(ωt−k′·x))
  • e−2k′′·x .

◮ This reveals that energy is exponentially attenuated by 2k′′, or σa = 2k′′ ≈ 2ω c n′′ = 4πn′′ λ , where σa is called the absorption coefficient and λ is the wavelength in vacuo.

slide-10
SLIDE 10

Plane waves incident on surfaces

◮ Consider a plane wave incident on a smooth surface. ◮ The wave gives rise to two other waves. Altogether we have

◮ An incident wave (subscript i) ◮ A reflected wave (subscript r) ◮ A transmitted wave (subscript t)

◮ We resolve all waves into two independent components:

◮ The wave with the electric vector perpendicular to the plane of incidence: ⊥-polarised light. ◮ The wave with the electric vector parallel to the plane of incidence: -polarised light.

◮ Maxwell’s equations require that the field vectors are continuous across the surface boundary. Let us call this the continuity condition. ◮ The continuity condition must hold at all times and no matter where we place the point of incidence in space.

slide-11
SLIDE 11

Conditions imposed by Maxwell’s equations

◮ Using the continuity condition: E⊥i + E⊥r = E⊥t . ◮ This must also hold for x = 0, therefore E ⊥

0i e−iωit + E ⊥ 0re−iωrt = E ⊥ 0te−iωtt .

◮ This is true only if ωi = ωr = ωt . ◮ With the condition k · k = n2ω2/c2, this reveals ki · ki n2

i

= kr · kr n2

i

= kt · kt n2

t

which shows how the index of refraction governs the propagation of plane waves

  • f light.
slide-12
SLIDE 12

The plane of incidence

ni nt Θi Θr Θt Ei Et Er z x k z,i k x,i k z,r k x,r k x,t k z,t

◮ At the boundary, z = 0, we have at the time t = 0: E ⊥

0i ei(kx,ix+ky,iy) + E ⊥ 0rei(kx,rx+ky,ry) = E ⊥ 0tei(kx,tx+ky,ty)

which must hold for all x and y.

slide-13
SLIDE 13

The plane of incidence

ni nt Θi Θr Θt Ei Et Er z x k z,i k x,i k z,r k x,r k x,t k z,t

◮ The result is kx,i = kx,r = kx,t and ky,i = ky,r = ky,t .

slide-14
SLIDE 14

The plane of incidence

◮ The result is kx,i = kx,r = kx,t and ky,i = ky,r = ky,t . ◮ Maxwell’s equations require that k is perpendicular to E0. ◮ Since E ⊥

0i (by definition) is perpendicular to the plane of incidence, ki must be

parallel to the plane of incidence. ◮ Then ky,i = 0. ◮ Meaning that ky,r = ky,t = ky,i = 0. ◮ In other words, the reflected and transmitted vectors lie in the plane of incidence.

slide-15
SLIDE 15

The law of reflection

◮ Using the following results (found previously): ki · ki n2

i

= kr · kr n2

i

kx,i = kx,r and ky,r = ky,i = 0 . ◮ We find: k2

z,i = k2 z,r

with the solutions kz,r = kz,i or kz,r = −kz,i. ◮ Only the solution kz,r = −kz,i describes a wave on the right side of the surface. ◮ The law of reflection is then: The reflected wave lies in the plane of incidence, the (complex) angle of reflection is equal to the (complex) angle of incidence.

slide-16
SLIDE 16

The law of refraction

◮ Using the following results (found previously): ki · ki n2

i

= kt · kt n2

t

kx,i = kx,t ◮ We find: ni kx,i √ki · ki = nt kx,t √kt · kt

  • r (using complex angles)

ni sin Θi = nt sin Θt . ◮ This is called generalised Snell’s law. ◮ The law of refraction is then: The refracted wave lies in the plane of incidence, the (complex) angle of refraction follows the generalised Snell’s law.

slide-17
SLIDE 17

Continuity of the magnetic vector

◮ One of the plane wave Maxwell equations is: H0 = 1 ωµk × E0 . ◮ The x component of this equation is H0x = 1 ωµ(kyE0z − kzE0y) . ◮ Using the perpendicular components and the result that ky,i = ky,r = ky,t = 0, we have H0x = − kz ωµE0y and (0, E0y, 0) = E ⊥ . ◮ The continuity condition (invoked on the x component of the magnetic vector) is then − kz,i ωiµi E ⊥

0i − kz,r

ωrµi E ⊥

0r = − kz,t

ωtµt E ⊥

0t .

slide-18
SLIDE 18

The Fresnel equations for reflection

◮ The newly found continuity condition: − kz,i ωiµi E ⊥

0i − kz,r

ωrµi E ⊥

0r = − kz,t

ωtµt E ⊥

0t .

◮ Using the law of reflection kz,r = −kz,i and the result that angular frequencies are equal ωi = ωr = ωt, we have kz,iE ⊥

0i − kz,iE ⊥ 0r = kz,t

µi µt E ⊥

0t .

◮ Ignoring magnetic effects, we set µi/µt = 1. ◮ Using the other continuity condition, E ⊥

0i + E ⊥ 0r = E ⊥ 0t, we get

kz,iE ⊥

0i − kz,iE ⊥ 0r = kz,t(E ⊥ 0i + E ⊥ 0r)

⇔ E ⊥

0r = kz,i − kz,t

kz,i + kz,t E ⊥

0i .

slide-19
SLIDE 19

The Fresnel equations for reflection

◮ The result we arrived at was E ⊥

0r = kz,i − kz,t

kz,i + kz,t E ⊥

0i .

◮ Diving by E ⊥

0i

√ki · ki and using cos Θ = kz/√ki · ki, we find the amplitude ratio ˜ r⊥ = E ⊥

0r

E ⊥

0i

= ni cos Θi − nt cos Θt ni cos Θi + nt cos Θt . ◮ In a similar way, we can find ˜ r = E

0r

E

0i

= nt cos Θi − ni cos Θt nt cos Θi + ni cos Θt . ◮ These are called Fresnel’s equations for reflection.

slide-20
SLIDE 20

Computing reflectances and transmittances (energy ratios)

◮ To translate Fresnel’s amplitude ratios into energy ratios, one uses the squared absolute value: R⊥ = |˜ r⊥|2 and R = |˜ r|2 . ◮ The Fresnel reflectance for unpolarized light is then R = 1 2(R⊥ + R) . ◮ The transmittances are one minus the reflectances: T⊥ = 1 − R⊥ , T = 1 − R , T = 1 − R . ◮ Please note that the Fresnel equations work with complex indices of refraction.

slide-21
SLIDE 21

Reflection and transmission of radiance

◮ Requiring energy conservation at the surface boundary: Φi = Φr + Φt , where Φi, Φr, and Φt are the incident, reflected, and transmitted energy fluxes. ◮ Transformed to radiances: Li cos θi dA dωi = Lr cos θr dA dωr + Lt cos θt dA dωt

  • Li cos θi dωi

= Lr cos θr dωr + Lt cos θt dωt . ◮ Another way to write the differential solid angles: dωi = sin θi dθi dφi dωr = sin θr dθr dφr dωt = sin θt dθt dφt .

slide-22
SLIDE 22

Using the law of reflection

◮ Using the law of reflection θi = θr and the plane of incidence φi = φr = φt, the solid angles become dωi = sin θi dθi dφi dωr = sin θi dθi dφi dωt = sin θt dθt dφi . ◮ By insertion, we can then change the energy conservation condition as follows: Li cos θi dωi = Lr cos θr dωr + Lt cos θt dωt

  • Li cos θi sin θi dθi

= Lr cos θi sin θi dθi + Lt cos θt sin θt dθt .

slide-23
SLIDE 23

Compression of solid angle upon transmission

◮ Using the law of refraction (Snell’s law), we have (neglecting the imaginary part

  • f the IOR)

sin θt = n′

i

n′

t

sin θi and dθt dθi = d dθi sin−1 n′

i

n′

t

sin θi

  • = n′

i cos θi

n′

t cos θt

. ◮ By insertion, we can then change the energy conservation condition as follows: Li cos θi sin θi dθi = Lr cos θi sin θi dθi + Lt cos θt sin θt dθt

  • Li

= Lr + n′

i

n′

t

2 Lt . ◮ Finally, using Fresnel reflectance R, we have Lo = RLi + n′

i

n′

t

2 (1 − R)Li .

slide-24
SLIDE 24

02576 Physically Based Rendering

Russian Roulette

Jeppe Revall Frisvad June 2016

slide-25
SLIDE 25

Doing efficient rendering

◮ Time vs. variance.

◮ Efficiency = (variance × rendering time)−1 .

◮ Tree vs. path. ◮ Splitting vs. Russian roulette.

◮ Splitting is a sum over all the branches. ◮ Russian roulette is sampling a path.

slide-26
SLIDE 26

Demo: The golden bunny

◮ Using 10 samples per pixel. Russian roulette Russian roulette Russian roulette No splitting Split on 1 reflection Split on 2 reflections Time: 14.4 s Time: 14.8 s Time 14.7 s

slide-27
SLIDE 27

Demo: The glass elephant

◮ What does a glass elephant on a flatly coloured background look like? ◮ Using one sample per pixel. No Russian roulette No Russian roulette Russian roulette Split on 5 bounces Split on 10 bounces No splitting Time: 4.4 s Time: 13.7 s Time 2.6 s

slide-28
SLIDE 28

Splitting

◮ Sum all the events.

◮ Example: Reflection multiplied by reflectance. ◮ Example: Sum reflection and transmission.

◮ Exact but expensive. ◮ When does the recursion stop?

◮ Often not before the combinatorial explosion. ◮ It might never.

◮ When to use splitting?

◮ Where variance is most striking. ◮ Example: The first (or first few) light bounces.

slide-29
SLIDE 29

Russian roulette

◮ Either - or. ◮ Sample an event.

◮ Example: Reflection or absorption. ◮ Example: Reflection or transmission.

◮ How? Sample a step function. ◮ What are the steps?

◮ The probabilities of an event. ◮ Example: Fresnel reflectance.

slide-30
SLIDE 30

Sampling a step function

Algorithm: sample ξ ∈ [0, 1] uniformly; if (ξ < P1)

call event 1; divide by p1;

else if (ξ < P2)

call event 2; divide by p2;

else if (ξ < P3)

. . .

else if (ξ < P4)

. . .

1 1 2 3 4

Discrete pdf

p - probability 1 1 2 3 4

Discrete cdf

P - cumulave

slide-31
SLIDE 31

Exercises

◮ Implement recursive ray tracing (reflection and transmission). ◮ Use Fresnel reflectance with transparent objects. ◮ MPML (Material Properties Markup Language)

◮ The framework matches OBJ material names to MPML material names. ◮ If spectral material properties are available in the file models/media.mpml, these will be used for OBJ materials of the same name.

◮ Implement Fresnel with complex IOR. ◮ Render a metal bunny in an environment. ◮ Render the glass elephant on a flat background and in an environment.