Lecture 6 - Light Transport Welcome! , = (, ) , - - PowerPoint PPT Presentation

β–Ά
lecture 6 light transport
SMART_READER_LITE
LIVE PREVIEW

Lecture 6 - Light Transport Welcome! , = (, ) , - - PowerPoint PPT Presentation

INFOMAGR Advanced Graphics Jacco Bikker - November 2016 - February 2017 Lecture 6 - Light Transport Welcome! , = (, ) , + , , ,


slide-1
SLIDE 1

𝑱 π’š, π’šβ€² = 𝒉(π’š, π’šβ€²) 𝝑 π’š, π’šβ€² +

𝑻

𝝇 π’š, π’šβ€², π’šβ€²β€² 𝑱 π’šβ€², π’šβ€²β€² π’†π’šβ€²β€²

INFOMAGR – Advanced Graphics

Jacco Bikker - November 2016 - February 2017

Lecture 6 - β€œLight Transport”

Welcome!

slide-2
SLIDE 2

Today’s Agenda:

  • Introduction
  • The Rendering Equation
  • Light Transport
slide-3
SLIDE 3

Introduction

Advanced Graphics – Light Transport 3

Whitted

slide-4
SLIDE 4

Introduction

Advanced Graphics – Light Transport 4

Whitted

slide-5
SLIDE 5

Introduction

Advanced Graphics – Light Transport 5

Whitted

Missing:

  • Area lights
  • Glossy reflections
  • Caustics
  • Diffuse interreflections
  • Diffraction
  • Polarization
  • Phosphorescence
  • Temporal effects
  • Motion blur
  • Depth of field
  • Anti-aliasing
slide-6
SLIDE 6

Introduction

Advanced Graphics – Light Transport 6

Anti-aliasing

Adding anti-aliasing to a Whitted-style ray tracer: Send multiple primary rays through each pixel, and average their result. Problem:

  • How do we aim those rays?
  • What if all rays return the same color?
slide-7
SLIDE 7

Introduction

Advanced Graphics – Light Transport 7

Anti-aliasing – Sampling Patterns

Adding anti-aliasing to a Whitted-style ray tracer: Send multiple primary rays through each pixel, and average their result. Problem:

  • How do we aim those rays?
  • What if all rays return the same color?
slide-8
SLIDE 8

Introduction

Advanced Graphics – Light Transport 8

Anti-aliasing – Sampling Patterns

slide-9
SLIDE 9

Introduction

Advanced Graphics – Light Transport 9

Anti-aliasing – Sampling Patterns

slide-10
SLIDE 10

Introduction

Advanced Graphics – Light Transport 10

Anti-aliasing – Sampling Patterns

Adding anti-aliasing to a Whitted-style ray tracer: Send multiple primary rays through each pixel, and average their result. Problem:

  • How do we aim those rays?
  • What if all rays return the same color?
slide-11
SLIDE 11

Introduction

Advanced Graphics – Light Transport 11

Whitted

Missing:

  • Area lights
  • Glossy reflections
  • Caustics
  • Diffuse interreflections
  • Diffraction
  • Polarization
  • Phosphorescence
  • Temporal effects
  • Motion blur
  • Depth of field

οƒΌ Anti-aliasing

slide-12
SLIDE 12

Introduction

Advanced Graphics – Light Transport 12

Distribution Ray Tracing*

*: Distributed Ray Tracing, Cook et al., 1984

Soft shadows

slide-13
SLIDE 13

Introduction

Advanced Graphics – Light Transport 13

Distribution Ray Tracing*

*: Distributed Ray Tracing, Cook et al., 1984

Glossy reflections

slide-14
SLIDE 14

Introduction

Advanced Graphics – Light Transport 14

Distribution Ray Tracing*

*: Distributed Ray Tracing, Cook et al., 1984

?

slide-15
SLIDE 15

Introduction

Advanced Graphics – Light Transport 15

Distribution Ray Tracing*

*: Distributed Ray Tracing, Cook et al., 1984

slide-16
SLIDE 16

Introduction

Advanced Graphics – Light Transport 16

Distribution Ray Tracing

Whitted-style ray tracing is a point sampling algorithm:

  • We may miss small features
  • We cannot sample areas

Area sampling:

  • Anti-aliasing: one pixel
  • Soft shadows: one area light source
  • Glossy reflection: directions in a cone
  • Diffuse reflection: directions on the hemisphere
slide-17
SLIDE 17

Introduction

Advanced Graphics – Light Transport 17

Area Lights

Visibility of an area light source: π‘Š

𝐡 = 𝐡

π‘Š 𝑦, ꙍ𝑗 𝑒ꙍ𝑗 Analytical solution case 1: π‘Š

𝐡 = π΅π‘šπ‘—π‘•β„Žπ‘’ βˆ’ π΅π‘šπ‘—π‘•β„Žπ‘’β‹‚π‘‘π‘žβ„Žπ‘“π‘ π‘“

Analytical solution case 2: π‘Š

𝐡 = ?

slide-18
SLIDE 18

Introduction

Advanced Graphics – Light Transport 18

Approximating Integrals

An integral can be approximated as a Riemann sum: π‘Š

𝐡 = 𝐡 𝐢

𝑔(𝑦) 𝑒𝑦 β‰ˆ

𝑗=1 𝑂

𝑔 𝑒𝑗 𝛦𝑗 , where

𝑗=1 𝑂

𝛦𝑗 = 𝐢 βˆ’ 𝐡 Note that the intervals do not need to be uniform, as long as we sample the full interval. If the intervals are uniform, then

𝑗=1 𝑂

𝑔 𝑒𝑗 𝛦𝑗 = 𝛦𝑗

𝑗=1 𝑂

𝑔 𝑒𝑗 = 𝐢 βˆ’ 𝐡 𝑂

𝑗=1 𝑂

𝑔 𝑒𝑗 . Regardless of uniformity, restrictions apply to 𝑂 when sampling multi-dimensional functions (ideally, 𝑂 = 𝑁𝑒). Also note that aliasing may occur if the intervals are uniform.

Image from Wikipedia

slide-19
SLIDE 19

Introduction

Advanced Graphics – Light Transport 19

Monte Carlo Integration

Alternatively, we can approximate an integral by taking random samples: π‘Š

𝐡 = 𝐡 𝐢

𝑔(𝑦) 𝑒𝑦 β‰ˆ 𝐢 βˆ’ 𝐡 𝑂

𝑗=1 𝑂

𝑔 x𝑗 Here,

  • x1. .

x𝑂 ∈ [𝐡, 𝐢]. As 𝑂 approaches infinity, π‘Š

𝐡 approaches the expected value of 𝑔.

Unlike in Riemann sums, we can use arbitrary 𝑂 for Monte Carlo integration, regardless of dimension.

Image from Wikipedia

slide-20
SLIDE 20

Introduction

Advanced Graphics – Light Transport 20

Monte Carlo Integration of Area Light Visibility

To estimate the visibility of an area light source, we take 𝑂 random point samples. In this case, 5 out of 6 samples are unoccluded: π‘Š β‰ˆ 1 6 1 + 1 + 1 + 0 + 1 + 1 = 5 6 In terms of Monte Carlo integration: π‘Š =

𝒯2π‘Š(π‘ž) π‘’π‘ž β‰ˆ 1

𝑂

𝑗=1 𝑂

π‘Š π‘ž With a small number of samples, the variance in the estimate shows up as noise in the image.

slide-21
SLIDE 21

Introduction

Advanced Graphics – Light Transport 21

Monte Carlo Integration of Area Light Visibility

We can also use Monte Carlo to estimate the contribution of multiple lights:

  • 1. Take the average of N samples from each light source;
  • 2. Sum the averages.

𝐹 𝑦 ← =

𝑗=1 2

𝑀𝑗 π‘Š(𝑦 ↔ π‘šπ‘—) 𝑦

slide-22
SLIDE 22

Introduction

Advanced Graphics – Light Transport 22

Monte Carlo Integration of Area Light Visibility

Alternatively, we can just take 𝑂 samples, and pick a random light source for each sample. 𝐹 𝑦 ← = 2 𝑂

𝑗=1 𝑂

𝑀

π‘Ÿ π‘Š π‘Ÿ

π‘ž , π‘Ÿ ∈ {1,2} = 1 𝑂

𝑗=1 𝑂 𝑀 π‘Ÿ π‘Š π‘Ÿ

π‘ž 0.5 𝑦

slide-23
SLIDE 23

Introduction

Advanced Graphics – Light Transport 23

Monte Carlo Integration of Area Light Visibility

We obtain a better estimate with fewer samples if we do not treat each light equally. In the previous example, each light had a 50% probability of being sampled. We can use an arbitrary probability, by dividing the sample by this probability. 𝐹 𝑦 ← = 1 𝑂

𝑗=1 𝑂 𝑀 π‘Ÿ π‘Š π‘Ÿ

π‘ž 𝜍

π‘Ÿ

, 𝜍

π‘Ÿ = 1, 𝜍 π‘Ÿ > 0

𝑦

slide-24
SLIDE 24

Introduction

Advanced Graphics – Light Transport 24

Distribution Ray Tracing

Key concept of distribution ray tracing: We estimate integrals using Monte Carlo integration. Integrals in rendering:

  • Area of a pixel
  • Lens area (aperture)
  • Frame time
  • Light source area
  • Cones for glossy reflections
  • Wavelengths
  • …
slide-25
SLIDE 25

Introduction

Advanced Graphics – Light Transport 25

Open Issues

Remaining issues:

  • Energy distribution in the ray tree / efficiency
  • Diffuse interreflections
slide-26
SLIDE 26

Today’s Agenda:

  • Introduction
  • The Rendering Equation
  • Light Transport
slide-27
SLIDE 27

Rendering Equation

Advanced Graphics – Light Transport 27

Whitted, Cook & Beyond

Missing in Whitted:

  • Area lights
  • Glossy reflections
  • Caustics
  • Diffuse interreflections
  • Diffraction
  • Polarization
  • Phosphorescence
  • Temporal effects
  • Motion blur
  • Depth of field
  • Anti-aliasing

Cook: οƒΌ Area lights οƒΌ Glossy reflections Γ— Caustics Γ— Diffuse interreflections Γ— Diffraction Γ— Polarization Γ— Phosphorescence Γ— Temporal effects οƒΌ Motion blur οƒΌ Depth of field οƒΌ Anti-aliasing

slide-28
SLIDE 28

Rendering Equation

Advanced Graphics – Light Transport 28

Whitted, Cook & Beyond

Cook’s solution to rendering: Sample the many-dimensional integral using Monte Carlo integration.

π΅π‘žπ‘—π‘¦π‘“π‘š π΅π‘šπ‘“π‘œπ‘‘ π‘ˆπ‘”π‘ π‘π‘›π‘“ π›»π‘•π‘šπ‘π‘‘π‘‘π‘§ π΅π‘šπ‘—π‘•β„Žπ‘’

… Ray optics are still used for specular reflections and refractions: The ray tree is not eliminated.

(In fact: for each light, one or more shadow rays are produced)

slide-29
SLIDE 29

Rendering Equation

Advanced Graphics – Light Transport 29

God’s Algorithm

1 room 1 bulb 100 watts 1020 photons per second Photon behavior:

  • Travel in straight lines
  • Get absorbed, or change direction:
  • Bounce (random / deterministic)
  • Get transmitted
  • Leave into the void
  • Get detected
slide-30
SLIDE 30

Light Transport

Advanced Graphics – Light Transport 30

slide-31
SLIDE 31

Rendering Equation

Advanced Graphics – Light Transport 31

God’s Algorithm - Mathematically

A photon may arrive at a sensor after travelling in a straight line from a light source to the sensor: 𝑀 𝑑 ← 𝑦 = 𝑀𝐹(𝑑 ← 𝑦) Or, it may be reflected by a surface towards the sensor: 𝑀 𝑑 ← 𝑦 =

𝐡

𝑔

𝑠 𝑑 ← 𝑦 ← 𝑦′ 𝑀 𝑦 ← 𝑦′ 𝐻 𝑦 ↔ 𝑦′ 𝑒𝐡(𝑦′)

Those are the options. Adding direct and indirect illumination together: 𝑀 𝑑 ← 𝑦 = 𝑀𝐹 𝑑 ← 𝑦 +

𝐡

𝑔

𝑠 𝑑 ← 𝑦 ← 𝑦′ 𝑀 𝑦 ← 𝑦′ 𝐻 𝑦 ↔ 𝑦′ 𝑒𝐡(𝑦′)

slide-32
SLIDE 32

𝑀 𝑑 ← 𝑦 = 𝑀𝐹 𝑑 ← 𝑦 +

𝐡

𝑔

𝑠 𝑑 ← 𝑦 ← 𝑦′ 𝑀 𝑦 ← 𝑦′ 𝐻 𝑦 ↔ 𝑦′ 𝑒𝐡(𝑦′)

Rendering Equation

Advanced Graphics – Light Transport 32

God’s Algorithm - Mathematically

Emission Hemisphere Reflection Indirect Geometry factor

slide-33
SLIDE 33

Rendering Equation

Advanced Graphics – Light Transport 33

𝑀 𝑑 ← 𝑦 = 𝑀𝐹 𝑑 ← 𝑦 +

𝐡

𝑔

𝑠 𝑑 ← 𝑦 ← 𝑦′ 𝑀 𝑦 ← 𝑦′ 𝐻 𝑦 ↔ 𝑦′ 𝑒𝐡(𝑦′)

The Rendering Equation:*

  • Light transport from lights to sensor
  • Physically based

The equation allows us to determine to which extend rendering algorithms approximate real-world light transport.

*: The Rendering Equation, Kajiya, 1986

slide-34
SLIDE 34

Rendering Equation

Advanced Graphics – Light Transport 34 to the Rendering Equation: Light sourc𝑀 𝑑 ← 𝑦 = 𝑀𝐹 𝑑 ← 𝑦 +

𝐡 𝑔 𝑠 𝑑 ← 𝑦 ← 𝑦′ 𝑀 𝑦 ← 𝑦′ 𝐻 𝑦 ↔ 𝑦′ 𝑒𝐡(𝑦′)

Rasterization, according es limited to 𝑂 point lights

  • Visibility handled by z-buffer / Painter’s algorithm
  • Visibility not supported for lights

𝑀 𝑑 ← 𝑦 = 𝑀𝐹 𝑑 ← 𝑦 +

𝑗=1 𝑂𝑀

𝑔

𝑠 𝑑 ← 𝑦 ← 𝑀𝑗 𝑀𝑗 𝐻 𝑦 ↔ 𝑀𝑗

(note: this does not take into account approximations such as shadow maps and environment maps)

slide-35
SLIDE 35

Rendering Equation

Advanced Graphics – Light Transport 35

𝑀 𝑑 ← 𝑦 = 𝑀𝐹 𝑑 ← 𝑦 +

𝐡

𝑔

𝑠 𝑑 ← 𝑦 ← 𝑦′ 𝑀 𝑦 ← 𝑦′ 𝐻 𝑦 ↔ 𝑦′ 𝑒𝐡(𝑦′)

Whitted-style ray tracing, according to the Rendering Equation:

  • Inter-surface reflections limited to specular surfaces
  • Light sources limited to 𝑂 point lights
  • Visibility is supported

𝑀 𝑑 ← 𝑦 = 𝑀𝐹 𝑑 ← 𝑦 +

𝑗=1 𝑂𝑀

𝑔

𝑠 𝑑 ← 𝑦 ← 𝑀𝑗 𝑀𝑗 𝐻 𝑦 ↔ 𝑀𝑗

+

𝐡

𝑔

𝑠 πœ€ 𝑑 ← 𝑦 ← 𝑦′ 𝑀 𝑦 ← 𝑦′ 𝐻 𝑦 ↔ 𝑦′ 𝑒𝐡(𝑦′)

(note: only specular recursive transport supported)

slide-36
SLIDE 36

Today’s Agenda:

  • Introduction
  • The Rendering Equation
  • Light Transport
slide-37
SLIDE 37

Light Transport

Advanced Graphics – Light Transport 37

𝑀 𝑑 ← 𝑦 = 𝑀𝐹 𝑑 ← 𝑦 +

𝐡

𝑔

𝑠 𝑑 ← 𝑦 ← 𝑦′ 𝑀 𝑦 ← 𝑦′ 𝐻 𝑦 ↔ 𝑦′ 𝑒𝐡(𝑦′)

Relation between real-world light transport and the RE:

  • 1. Each sensor element registers an amount of photons arriving from the first surface visible

though that pixel.

  • 2. This surface may be emissive, in which case it produced the sensed photons.
  • 3. This surface may also reflect photons, arriving from other surfaces in the scene.
  • 4. For the other surfaces: goto 2.
slide-38
SLIDE 38

Light Transport

Advanced Graphics – Light Transport 38

Light Transport Quantities

Radiant flux - 𝛸 : β€œRadiant energy emitted, reflected, transmitted or received, per unit time.” Units: watts = joules per second 𝑋 = 𝐾 π‘‘βˆ’1 . Simplified particle analogy: number of photons.

Note: photon energy depends on electromagnetic wavelength: E =

hc Ξ» , where h is Planck’s constant, c is the speed of light,

and Ξ» is wavelength. At Ξ» = 550nm (yellow), a single photon carries 3.6 βˆ— 10βˆ’19 joules.

slide-39
SLIDE 39

Light Transport

Advanced Graphics – Light Transport 39

Light Transport Quantities

In a vacuum, radiant flux emitted by a point light source remains constant over distance: A point light emitting 100W delivers 100W to the surface of a sphere of radius r around the light. This sphere has an area of πœŒπ‘ 2; energy per surface area thus decreases by 1/𝑠2. In terms of photons: the density of the photon distribution decreases by 1/𝑠2.

slide-40
SLIDE 40

Light Transport

Advanced Graphics – Light Transport 40

Light Transport Quantities

A surface receives an amount of light energy proportional to its solid angle: the two-dimensional space that an object subtends at a point. Solid angle units: steradians (sr). Corresponding concept in 2D: radians; the length of the arc on the unit sphere subtended by an angle.

slide-41
SLIDE 41

Light Transport

Advanced Graphics – Light Transport 41

Light Transport Quantities

Radiance - 𝑀 : β€œThe power of electromagnetic radiation emitted, reflected, transmitted or received per unit projected area per unit solid angle.” Units: π‘‹π‘‘π‘ βˆ’1π‘›βˆ’2 Simplified particle analogy: Amount of particles passing through a pipe with unit diameter, per unit time. Note: radiance is a continuous value: while flux at a point is 0 (since both area and solid angle are 0), we can still define flux per area per solid angle for that point. 𝑀

slide-42
SLIDE 42

Light Transport

Advanced Graphics – Light Transport 42

Light Transport Quantities

Irradiance - 𝐹 : β€œThe power of electromagnetic radiation per unit area incident on a surface.” Units: Watts per 𝑛2 = joules per second per 𝑛2 π‘‹π‘›βˆ’2 = πΎπ‘›βˆ’2π‘‘βˆ’1 . Simplified particle analogy: number of photons arriving per unit area per unit time, from all directions. 𝑂

slide-43
SLIDE 43

Light Transport

Advanced Graphics – Light Transport 43

Light Transport Quantities

Converting radiance to irradiance: 𝐹 = 𝑀 cos πœ„ 𝑀 𝑀 𝑂 πœ„

slide-44
SLIDE 44

Light Transport

Advanced Graphics – Light Transport 44

Pinhole Camera

A camera should not accept light from all directions for a particular pixel on the film. A pinhole ensures that only a single direction is sampled. In the real world, an aperture with a lens is used to limit directions to a small range, but only on the focal plane.

slide-45
SLIDE 45

Light Transport

Advanced Graphics – Light Transport 45

Light Transport

𝑀 𝑑 ← 𝑦 = 𝑀𝐹 𝑑 ← 𝑦 +

𝐡

𝑔

𝑠 𝑑 ← 𝑦 ← 𝑦′ 𝑀 𝑦 ← 𝑦′ 𝐻 𝑦 ↔ 𝑦′ 𝑒𝐡(𝑦′)

𝑀𝑝 𝑦, πœ•π‘ = 𝑀𝐹 𝑦, πœ•π‘ +

𝛻

𝑔

𝑠 𝑦, πœ•π‘, πœ•π‘— 𝑀𝑗 𝑦, πœ•π‘— cos πœ„π‘— π‘’πœ•π‘—

Radiance Radiance Radiance Irradiance BRDF

slide-46
SLIDE 46

Light Transport

Advanced Graphics – Light Transport 50

Flux / Particle Count / Probability

So far, we measured light transport as energy: Radiance = Joules per second per square meter; Irradiance = Radiance projected to the surface. Alternatively, we can imagine this as a large number

  • f particles (say, 1020). How does this affect the

concept of radiance, irradiance and BRDF? Alternatively, we can think of irradiance and the BRDF as a probability distribution. How does this affect the concept of irradiance and the BRDF?

slide-47
SLIDE 47

Today’s Agenda:

  • Introduction
  • The Rendering Equation
  • Light Transport
slide-48
SLIDE 48

INFOMAGR – Advanced Graphics

Jacco Bikker - November 2016 - February 2017

END of β€œLight Transport”

next lecture: β€œPath Tracing”