π± π, πβ² = π(π, πβ²) π π, πβ² + ΰΆ±
π»
π π, πβ², πβ²β² π± πβ², πβ²β² ππβ²β²
INFOMAGR β Advanced Graphics
Jacco Bikker - November 2019 - February 2020
Lecture 13 - Bidirectional Welcome! , = (, ) , - - PowerPoint PPT Presentation
INFOMAGR Advanced Graphics Jacco Bikker - November 2019 - February 2020 Lecture 13 - Bidirectional Welcome! , = (, ) , + , , ,
π± π, πβ² = π(π, πβ²) π π, πβ² + ΰΆ±
π»
π π, πβ², πβ²β² π± πβ², πβ²β² ππβ²β²
Jacco Bikker - November 2019 - February 2020
βͺ Introduction: Forward Path Tracing βͺ Virtual Point Lights βͺ Photon Mapping βͺ Path Guiding
Backward and Forward Path Tracing
Advanced Graphics β Bidirectional 3
Images: Simon Brown, sjbrown.co.uk/2011/01/03/two-way-path-tracing
t = 2 t = 3 t = 4 t = 5 t = 6 s = 2 s = 3 s = 4 s = 5 s = 6
Forward Path Tracing
A βnormalβ path tracer works back to the lights (valid, Helmholtz). A light tracer or forward path tracer keeps the original propagation direction of light: towards the camera.
Advanced Graphics β Bidirectional 4
Forward Path Tracing
A βnormalβ path tracer works back to the lights (valid, Helmholtz). A light tracer or forward path tracer keeps the original propagation direction of light: towards the camera. Consequences / issues:
Advanced Graphics β Bidirectional 5
Forward Path Tracing
Tracing paths from the light helps when: βͺ the light is hard to reach βͺ the light cannot be importance sampled (using NEE). Tracing paths from the eye is better when: βͺ the camera is hard to reach. Many scenes would benefit from both approaches. Now what? βͺ decide on a per-pixel basis? βͺ do both and average? (would that even work?) βͺ something smarter?
Advanced Graphics β Bidirectional 6
Forward Path Tracing
Tracing paths from the light helps when: βͺ the light is hard to reach βͺ the light cannot be importance sampled (using NEE). Tracing paths from the eye is better when: βͺ the camera is hard to reach. Many scenes would benefit from both approaches. Now what? βͺ decide on a per-pixel basis? βͺ do both and average? (would that even work?) βͺ something smarter?
Advanced Graphics β Bidirectional 7 Soβ¦ a forward path tracer cannot correctly render a scene in which the camera directly views pure specular objects. Is it possible to construct a scene that cannot be correctly rendered using a backward path tracer?
Forward Path Tracing
The problem with this scene: βͺ When a path hits the torus, it canβt use NEE βͺ This is true for light tracing and path tracing. The problematic paths are SDS paths*: E: eye D: diffuse S: specular L: light (a light tracer fails on L(β¦)SE paths.)
*: Heckbert, Adaptive radiosity textures for bidirectional ray tracing. SIGGRAPH 1990.
Advanced Graphics β Bidirectional 8
Path Classification
Advanced Graphics β Bidirectional 9
energy returned by π’ = 2, π‘ = 2 paths EL - LE energy returned by π’ = 3, π‘ = 3 paths EDL - LDE energy returned by π’ = 4, π‘ = 4 paths E(D|S)DL L(D|S)DE energy returned by π’ = 5, π‘ = 5 paths energy returned by π’ = 6, π‘ = 6 paths
t = 2 t = 3 t = 4 t = 5 t = 6 s = 2 s = 3 s = 4 s = 5 s = 6
Forward Path Tracing
The problem with this scene: βͺ The wood inside the ring benefits from NEE βͺ But sometimes much more energy arrives via the metal. Here, NEE correctly samples the direct illumination, but the indirect illumination (via the metal) is poorly represented by the cosine pdf.
Advanced Graphics β Bidirectional 10
Today
Paths with high throughput and a low probability yield severe noise. βͺ Sometimes itβs better to trace from the light. βͺ Sometimes backward nor forward work well. Bidirectional techniques aim to exploit benefits of both.
Advanced Graphics β Bidirectional 11
βͺ Introduction: Forward Path Tracing βͺ Virtual Point Lights βͺ Photon Mapping βͺ Path Guiding
Instant Radiosity*
Idea: Trace π particles (where π is ~103..105) from the light sources, record non-specular hits. At each bounce, use Russian roulette. Each recorded hit becomes a virtual point light. Now, render the scene as usual (rasterization, or Whitted-style ray tracing). At the first diffuse surface, use the VPLs to estimate indirect light, and the lights themselves for direct illumination. (did we account for all light transport?)
*: A. Keller, Instant Radiosity. SIGGRAPH β97.
Advanced Graphics β Bidirectional 13
Instant Radiosity
Advanced Graphics β Bidirectional 14
Images: M. Hasan, SIGGRAPH Asia β09.
Instant Radiosity
Using VPLs has some interesting characteristics: βͺ No noise! Those splotches thoughβ¦ βͺ VPLs can bounce: they can represent all indirect light βͺ VPLs cannot represent direct light βͺ #VPLs < #pixels βͺ Evaluating VPLs can be done with or without occlusion βͺ VPL visibility can also be evaluated using shadow maps Instant Radiosity is a bidirectional technique: we propagate flux when placing the VPLs, and we propagate im importance when connecting to them. VPLs on glossy surfaces do not work. (why not?)
Advanced Graphics β Bidirectional 15
βͺ Introduction: Forward Path Tracing βͺ Virtual Point Lights βͺ Photon Mapping βͺ Path Guiding
Photon Mapping*
Idea: what if we got rid of visibility queries altogether? With the photon mapping algorithm, we split rendering in two phases: βͺ In phase 1 we deposit flux (Ξ¦) in the scene by tracing a large number of photons; βͺ In phase 2, we estimate illumination using the photon map.
*: Henrik Wann Jensen, The photon map in global illumination. Ph.D. dissertation, 1996.
Advanced Graphics β Bidirectional 17
Photon Mapping
Phase 1: propagating flux. Photon emission: βͺ Point light: emitted in uniformly distributed random directions from the point. βͺ Area light: emitted from random positions on the square, with directions limited to a hemisphere. The emission directions are chosen from a cosine distribution. All photons thus have the same power: their density is the only way to express varying brightness.
Advanced Graphics β Bidirectional 18
Photon Mapping
Phase 1: propagating flux. Surface interaction: A photon that hits a surface may get absorbed or reflected (Russian roulette).
Advanced Graphics β Bidirectional 19
Photon Mapping
Phase 1: propagating flux. Photon storage: At each non-specular path vertex we store the photon:
struct photon { float3 position; // world space position of the photon hit float3 power; // current power level for the photon float3 L; // incident direction };
A photon may be stored multiple times along its path before it gets absorbed. Since the total set of photons represents the illumination, we divide photon power by the total number of stored photons.
Advanced Graphics β Bidirectional 20
Photon Mapping
Phase 2: radiance estimation. In the second pass, we render the scene using rasterization or Whitted-style ray tracing; the photon map is used to estimate illumination. At each non-specular path vertex we estimate the reflected radiance: π π¦, ππ = ΰΆ±
Ξ©π¦
π
π π¦, ππ, ππ ππ π¦, ππ cos ππ πππ
This requires information about the radiance ππ π¦, β¦ arriving over the hemisphere Ξ©π¦. We estimate this radiance by looking at the photon density at π¦: π π¦, ππ β 1 ππ 2 ΰ·
π=1 π
π
π π¦, ππ, ππ βΞ¦ π¦, ππ
Advanced Graphics β Bidirectional 21
Photon Mapping
Phase 2: radiance estimation. We estimate this radiance by looking at the photon density at π¦: π π¦, ππ β 1 ππ 2 ΰ·
π=1 π
π
π π¦, ππ, ππ βΞ¦ π¦, ππ
Note: βͺ We assume that we gathered photons on a disc of radius π . βͺ We assume that the gathered photons belong to the same surface. βͺ Each photon within radius π has the same influence on the estimate.
Advanced Graphics β Bidirectional 22
Photon Mapping
Phase 2: radiance estimation. Instead of using the same weight for each photon we can use a filter: π₯ππ = π½ 1 β 1 β πβπΎ ππ
2
2π 2
1 β πβπΎ , where π½ = 0.918, πΎ = 1.953*. Value ππ
2 is the squared distance between photon π and π¦.
Now: π π¦, ππ β ΰ·
π=1 π
π
π π¦, ππ, ππ βΞ¦ π¦, ππ π₯ππ .
*: Mark J. Pavicic, Convenient Anti-Aliasing Filters that Minimize Bumpy Sampling. In Graphics Gems I.
Advanced Graphics β Bidirectional 23
Photon Mapping
Algorithm characteristics: βͺ Low-frequent noise βͺ Can be used in a rasterizer βͺ Can be used for direct + indirect βͺ Still a bidirectional technique
Advanced Graphics β Bidirectional 24
Photon Mapping
Algorithm characteristics: βͺ Low-frequent noise βͺ Can be used in a rasterizer βͺ Can be used for direct + indirect βͺ Still a bidirectional technique
Advanced Graphics β Bidirectional 25
βͺ Introduction: Forward Path Tracing βͺ Virtual Point Lights βͺ Photon Mapping βͺ Path Guiding
Advanced Graphics β Bidirectional 27
Advanced Graphics β Bidirectional 28
Advanced Graphics β Bidirectional
The Way of the Photon
Previously in ADVGR: βͺ We importance sampled βͺ Aiming for the important samples βͺ Blending strategies when needed βͺ Going bidirectional if all else fails. Now, what if I told youβ¦ Thereβs a new way. βΊ
Advanced Graphics β Bidirectional
The Way of the Photon
Importance sampling without prior knowledge:
with βEPSILONβ
the array
array
Notes:
` Solution: Use a non-zero uniform base probability for all bins.
Advanced Graphics β Bidirectional
The Way of the Photon
Advanced Graphics β Bidirectional
The Way of the Photon
Advanced Graphics β Bidirectional
The Way of the Photon
Advanced Graphics β Bidirectional
Learning Light Transport*
Idea: βͺ Store incoming flux at a small number of locations in a scene. βͺ Each record stores a small set of directions over the hemisphere. βͺ Each path/surface interaction updates nearby records. βͺ Path extensions use nearby records to form a discrete pdf. Note: The records merely provide a pdf; as long as it is not zero, it yields the correct result (on averageβ’). Challenges: βͺ Record placement. βͺ Updating the records during rendering.
*: Learning Light Transport the Reinforced Way. Dahm, Keller, 2017, and: Q-learned Importance Sampling for Physically Based Light Transport on the GPU. Mastrigt, 2018.
Advanced Graphics β Bidirectional
Path Guiding*
Idea: βͺ Store incoming flux in a 5D kD-tree (βSD-treeβ). βͺ 3 spatial dimensions, βͺ 2 spherical dimensions stored as a quadtree. Algorithm:
*: Practical Path Guiding for Efficient Light-Transport Simulation. MΓΌller et al., 2017.
Advanced Graphics β Bidirectional
Path Guiding*
Idea: βͺ Store incoming flux in a 5D kD-tree (βSD-treeβ). βͺ 3 spatial dimensions, βͺ 2 spherical dimensions stored as a quadtree. Algorithm:
*: Practical Path Guiding for Efficient Light-Transport Simulation. MΓΌller et al., 2017.
Advanced Graphics β Bidirectional
Advanced Graphics β Bidirectional
Advanced Graphics β Bidirectional
Advanced Graphics β Bidirectional
Advanced Graphics β Bidirectional
Materials
Main paper: Practical Path Guiding for Efficient Light-Transport Simulation. MΓΌller et al., 2017. Be sure to check out the 2019 SIGGRAPH course:
https://cgg.mff.cuni.cz/~jirka/path-guiding-in-production/2019/presentations/Guiding_In_Production_Course_s2019-2019-08-07-ppg-in-production.pdf
And related materials: https://cgg.mff.cuni.cz/~jirka/path-guiding-in-production/2019/index.htm Of particular interest: Efficient data structures and sampling of many light sources for Next Event Estimation, Andreas Mikolajewski (master thesis, 2018).
10,989 lights
Advanced Graphics β Bidirectional
1spp ref
Advanced Graphics β Bidirectional
1spp + SVGF ref
Advanced Graphics β Bidirectional
method ref
Advanced Graphics β Bidirectional
method + SVGF ref
Advanced Graphics β Bidirectional
ref
Advanced Graphics β Bidirectional
method + SVGF
βͺ Introduction: Forward Path Tracing βͺ Virtual Point Lights βͺ Photon Mapping βͺ Path Guiding
Jacco Bikker - November 2019 β February 2020
next lecture: βBRDFsβ