π± π, πβ² = π(π, πβ²) π π, πβ² + ΰΆ±
π»
π π, πβ², πβ²β² π± πβ², πβ²β² ππβ²β²
INFOMAGR β Advanced Graphics
Jacco Bikker - November 2017 - February 2018
Lecture 6 - Light Transport Welcome! , = (, ) , - - PowerPoint PPT Presentation
INFOMAGR Advanced Graphics Jacco Bikker - November 2017 - February 2018 Lecture 6 - Light Transport Welcome! , = (, ) , + , , ,
π± π, πβ² = π(π, πβ²) π π, πβ² + ΰΆ±
π»
π π, πβ², πβ²β² π± πβ², πβ²β² ππβ²β²
Jacco Bikker - November 2017 - February 2018
Advanced Graphics β Light Transport 3
Whitted
Advanced Graphics β Light Transport 4
Whitted
Advanced Graphics β Light Transport 5
Whitted
Missing:
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:
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:
Advanced Graphics β Light Transport 8
Anti-aliasing β Sampling Patterns
Advanced Graphics β Light Transport 9
Anti-aliasing β Sampling Patterns
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:
Advanced Graphics β Light Transport 11
Whitted
Missing:
οΌ Anti-aliasing
Advanced Graphics β Light Transport 12
Distribution Ray Tracing*
*: Distributed Ray Tracing, Cook et al., 1984
Soft shadows
Advanced Graphics β Light Transport 13
Distribution Ray Tracing*
*: Distributed Ray Tracing, Cook et al., 1984
Glossy reflections
Advanced Graphics β Light Transport 14
Distribution Ray Tracing*
*: Distributed Ray Tracing, Cook et al., 1984
?
Advanced Graphics β Light Transport 15
Distribution Ray Tracing*
*: Distributed Ray Tracing, Cook et al., 1984
Advanced Graphics β Light Transport 16
Distribution Ray Tracing
Whitted-style ray tracing is a point sampling algorithm:
Area sampling:
Advanced Graphics β Light Transport 17
Area Lights
Visibility of an area light source: π
π΅ = ΰΆ± π΅
π π¦, κπ πκπ Analytical solution case 1: π
π΅ = π΅πππβπ’ β π΅πππβπ’βπ‘πβππ π
Analytical solution case 2: π
π΅ = ?
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
A B
VA
Advanced Graphics β Light Transport 19
Monte Carlo Integration
Alternatively, we can approximate an integral by taking random samples: π
π΅ = ΰΆ± π΅ πΆ
π(π¦) ππ¦ β πΆ β π΅ π ΰ·
π=1 π
π ππ Here, π1. . ππ β [π΅, πΆ]. As π approaches infinity, π
π΅ approaches the expected value of π.
Unlike in Riemann sums, we can use arbitrary π for Monte Carlo integration, regardless of dimension.
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.
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 2
ππ π(π¦ β ππ) π¦
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 π¦ Probability of sampling light ππ
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 π¦
Advanced Graphics β Light Transport 24
Distribution Ray Tracing
Key concept of distribution ray tracing: We estimate integrals using Monte Carlo integration. Integrals in rendering:
Advanced Graphics β Light Transport 25
Open Issues
Remaining issues:
Advanced Graphics β Light Transport 27
Whitted, Cook & Beyond
Missing in Whitted:
Cook: οΌ Area lights οΌ Glossy reflections Γ Caustics Γ Diffuse interreflections Γ Diffraction Γ Polarization Γ Phosphorescence Γ Temporal effects οΌ Motion blur οΌ Depth of field οΌ Anti-aliasing
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)
Advanced Graphics β Light Transport 29
Godβs Algorithm
1 room 1 bulb 100 watts 1020 photons per second Photon behavior:
Advanced Graphics β Light Transport 30
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: π π‘ β π¦ = ππΉ π‘ β π¦ + ΰΆ±
π΅
π
π π‘ β π¦ β π¦β² π π¦ β π¦β² π» π¦ β π¦β² ππ΅(π¦β²)
π π‘ β π¦ = ππΉ π‘ β π¦ + ΰΆ±
π΅
π
π π‘ β π¦ β π¦β² π π¦ β π¦β² π» π¦ β π¦β² ππ΅(π¦β²)
Advanced Graphics β Light Transport 32
Godβs Algorithm - Mathematically
Emission Hemisphere Reflection Indirect Geometry factor
Advanced Graphics β Light Transport 33
π π‘ β π¦ = ππΉ π‘ β π¦ + ΰΆ±
π΅
π
π π‘ β π¦ β π¦β² π π¦ β π¦β² π» π¦ β π¦β² ππ΅(π¦β²)
The Rendering Equation:*
The equation allows us to determine to which extend rendering algorithms approximate real-world light transport.
*: The Rendering Equation, Kajiya, 1986
Advanced Graphics β Light Transport 34
π π‘ β π¦ = ππΉ π‘ β π¦ + ΰΆ±
π΅
π
π π‘ β π¦ β π¦β² π π¦ β π¦β² π» π¦ β π¦β² ππ΅(π¦β²)
Rasterization, according to the Rendering Equation:
π π‘ β π¦ = ππΉ π‘ β π¦ + ΰ·
π=1 ππ
π
π π‘ β π¦ β ππ ππ π» π¦ β ππ
(note: this does not take into account approximations such as shadow maps and environment maps)
Advanced Graphics β Light Transport 35
π π‘ β π¦ = ππΉ π‘ β π¦ + ΰΆ±
π΅
π
π π‘ β π¦ β π¦β² π π¦ β π¦β² π» π¦ β π¦β² ππ΅(π¦β²)
Whitted-style ray tracing, according to the Rendering Equation:
π π‘ β π¦ = ππΉ π‘ β π¦ + ΰ·
π=1 ππ
π
π π‘ β π¦ β ππ ππ π» π¦ β ππ
+ ΰΆ±
π΅
π
π π π‘ β π¦ β π¦β² π π¦ β π¦β² π» π¦ β π¦β² ππ΅(π¦β²)
(note: only specular recursive transport supported)
Advanced Graphics β Light Transport 37
π π‘ β π¦ = ππΉ π‘ β π¦ + ΰΆ±
π΅
π
π π‘ β π¦ β π¦β² π π¦ β π¦β² π» π¦ β π¦β² ππ΅(π¦β²)
Relation between real-world light transport and the RE:
though that pixel.
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.
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.
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.
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. π
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. π
Advanced Graphics β Light Transport 43
Light Transport Quantities
Converting radiance to irradiance: πΉ = π cos π π π π π
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.
Advanced Graphics β Light Transport 45
Light Transport
π π‘ β π¦ = ππΉ π‘ β π¦ + ΰΆ±
π΅
π
π π‘ β π¦ β π¦β² π π¦ β π¦β² π» π¦ β π¦β² ππ΅(π¦β²)
ππ π¦, ππ = ππΉ π¦, ππ + ΰΆ±
π»
π
π π¦, ππ, ππ ππ π¦, ππ cos ππ πππ
Radiance Radiance Radiance Irradiance BRDF
Advanced Graphics β Light Transport 46
Bidirectional Reflectance Distribution Function
BRDF: function describing the relation between radiance emitted in direction ππ and irradiance arriving from direction ππ: π
π ππ, ππ = dππ(ππ)
dπΉπ(ππ) = dππ(ππ) ππ ππ cos ΞΈπ πππ = ππ£π’πππππ π πππππππ ππππππππ ππ π πππππππ Or, if spatially variant: π
π π¦, ππ, ππ = dππ(π¦, ππ)
dπΉπ(π¦, ππ) = dππ(π¦, ππ) ππ π¦, ππ cos ΞΈπ πππ Properties:
π ππ, ππ β₯ 0
π ππ, ππ = π π ππ, ππ
π» π π ππ, ππ cos ππ πππ β€ 1
Advanced Graphics β Light Transport 47
Bidirectional Reflectance Distribution Function
Diffuse / Lambert*:
Q: Which one is correct? A: Both:
Or, stated differently: At an angle, the solid angle becomes smaller, and therefore the radiance per unit solid angle increases proportional to the cosine of the angle.
*: See: http://www.oceanopticsbook.info/view/surfaces/lambertian_brdfs
π ππ
Advanced Graphics β Light Transport 48
Bidirectional Reflectance Distribution Function
The diffuse BRDF is: π
π ππ, ππ = ππππππ
Ο So, for a total irradiance πΉ at surface point π¦, the
ππππππ π
. Why the π? Energy conservation: πΉπ β€ πΉπ Suppose we have a directional light parallel to π, with intensity 1. Then: πΉπ = ππ = 1. Suppose our BRDF =
ππππππ 1
. Then: πΉπ = Χ¬
π» πΉπ π π (ππ , ππ) cos ππ πππ = Χ¬ π» cos ππ πππ
Now: Χ¬
π» cos ππ πππ = Χ¬ Ο=0 2π Χ¬ ΞΈ=0 π/2 cos ΞΈ sin ΞΈ πΞΈπΟ = π ο¨ πΉπ = π πΉπ.
π ππ
Advanced Graphics β Light Transport 49
Bidirectional Reflectance Distribution Function
Mirror / Perfect specular: Reflects light in a fixed direction. For a given incoming direction ππ, all light is emitted in a single infinitesimal set of directions. The specular BRDF is thus π
π π¦, ππ, ππ = αβ, along reflected vector
0, otherwise. This is not practical, and therefore we will handle the pure specular case (reflection and refraction) separately.
π ππ ππ
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
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?
Jacco Bikker - November 2017 - February 2018
next lecture: βPath Tracingβ