π± π, πβ² = π(π, πβ²) π π, πβ² +
π»
π π, πβ², πβ²β² π± πβ², πβ²β² ππβ²β²
INFOMAGR β Advanced Graphics
Jacco Bikker - November 2016 - February 2017
Lecture 6 - Light Transport Welcome! , = (, ) , - - PowerPoint PPT Presentation
INFOMAGR Advanced Graphics Jacco Bikker - November 2016 - February 2017 Lecture 6 - Light Transport Welcome! , = (, ) , + , , ,
π± π, πβ² = π(π, πβ²) π π, πβ² +
π»
π π, πβ², πβ²β² π± πβ², πβ²β² ππβ²β²
Jacco Bikker - November 2016 - February 2017
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
Advanced Graphics β Light Transport 19
Monte Carlo Integration
Alternatively, we can approximate an integral by taking random samples: π
π΅ = π΅ πΆ
π(π¦) ππ¦ β πΆ β π΅ π
π=1 π
π xπ Here,
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
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 π¦
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 to the Rendering Equation: Light sourcπ π‘ β π¦ = ππΉ π‘ β π¦ +
π΅ π π π‘ β π¦ β π¦β² π π¦ β π¦β² π» π¦ β π¦β² ππ΅(π¦β²)
Rasterization, according es limited to π point lights
π π‘ β π¦ = ππΉ π‘ β π¦ +
π=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 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 2016 - February 2017
next lecture: βPath Tracingβ