GAMES101 Lecture 14 - Ray Tracing 2 (Acceleration and Radiometry)

GAMES101_Lecture_14.pdf

I. Spatial Partitions

Trivial Partitions

Uniform Spatial Partitions (Grid)

 

Tree-Shaped Partitions

img-1

Oct-Tree

Recursively divide the current octant into 8 sub-octants until the current working space is empty or the number of objects contained reaches certain minimum.

 

BSP-Tree (Binary Space Partitioning)

Recursively divide the space using a hyperplane.

 

KD-Tree

img-2

Recursively divide the space along alternating axes (xyz loop) using a hyperplane, creating a binary tree structure.

Separations don't have to be even.

 

Data Structure:

 

Traversing a KD-Tree: If the ray has intersected with the current node, recursively check all its child nodes.

 

General Problems

 

II. Object Partitions

Bounding Volume Hierarchy (BVH)

Summary:

 

How to subdivide a node? Make the split as separated and evenly-sized as possible.

Heuristics are of great research interest.

 

Termination criteria?

 

Data Structure:

All objects are in subtrees.

 

Traversing a BVH:

img-3

 

 

Spatial vs Object Partitions

 

III. Basic Radiometry

Motivations and stuff to learn: Describe the light in a precise manner.

 

Radiant Energy and Flux (Power)

Definition: Radiant energy is the energy of electromagnetic radiation. It is measured in units of joules, and denoted by the symbol

Q[= Joule]

Definition: Radiant flux (power) is the energy emitted, reflected, transmitted or received, per unit time.

ΦdQdt[W = Watt] [lm = lumen]

 

Radiant Intensity

img-4

Definition: The radiant (luminous) intensity is the power per unit solid angle emitted by a point light source.

I(ω)dΦdω [Wsr] [lmsr=cd=candela] 

where candela is one of the seven SI base units.

 

Angles, Solid Angles and Direction Vectors

Definition: Angle is the ratio of subtended arc length on a circle to the radius

θ=lr

A circle has 2π radians.

Definition: Solid angle is the ratio of subtended area on a sphere to the radius squared

Ω=Ar2

A sphere has 4π steradians.

The area, when calculated, must be that of a part of the shell, or that projected to the shell.

 

Direction Vector: ω will be used to denote a direction vector of unit length.

img-5

 

Differential Solid Angle

img-6

dA=(rdθ)(rsinθdϕ)=r2sinθdθdϕ
dω=dAr2=sinθdθdϕ

 

Isotropic Point Source

img-7

An isotropic point source has an uniform intensity.

Φ=S2Idω=4πI
I=Φ4π

 

Irradiance

img-8

Definition: The irradiance is the power per unit area incident on a surface point.

E(x)dΦ(x)dAcosθ[Wm2] [lmm2=lux]

where θ is the angle of incidence following Lambert's Cosine Law.

img-13

Hint: Think of the cosθ operation as adjusting the plane such that it sits perpendicular to the incident light.

 

Correction: Irradiance Falloff

img-9

 

Radiance

img-10

Radiance is the fundamental field quantity that describes the distribution of light in an environment.

img-11

Definition: The radiance (luminance) is the power emitted reflected, transmitted or received by a surface, per unit solid angle, per projected unit area.

L(p,ω)d2Φ(p,ω)dωdAcosθ [Wsr m2] [cdm2=lmsr m2=nit] 

where cosθ accounts for projected surface area.

 

 

Incident Radiance

Incident radiance is the irradiance per unit solid angle arriving at the surface.

L(p,ω)=dE(p)dωcosθ

The light arriving at the surface along a given ray.

 

Exiting Radiance

Exiting surface radiance is the intensity per unit projected area leaving the surface.

L(p,ω)dI(p,ω)dAcosθ

Hint: For the two formulas for incident/exiting radiance, considering taking them has differentials and multiply L(p,ω) by the denominator.

 

Irradiance vs. Radiance

img-12

dE(p,ω)=Li(p,ω)cosθdω
E(p)=H2Li(p,ω)cosθdω

Unit hemisphere: H2

 

Appendix A: Surface Area Heuristics (SAH)

Reference: Bounding Volume Hierarchies (pbr-book.org)

The two primitive partitioning approaches described in the BVH section can work well for some distributions of primitives, but they often choose partitions that perform poorly in practice, leading to more nodes of the tree being visited by rays and hence unnecessary inefficient ray-primitive intersection computations at rendering time.

Most of the best algorithms (as of 2018) for building acceleration structures for ray-tracing are based on the "surface area heuristic" (SAH), which provides a well-grounded cost model for answer questions like

 

Idea behind the SAH Cost Model

The SAH model estimates the computational cost of performing ray intersection tests, including the time spent on:

By assuming the current working node is a leaf node regardless of the number of primitives it contains, we know that any ray that passes through this node will be tested against all of the overlapping primitives and will incur a cost of

i=1Ntisect(i)

where

If we split the region, rays will incur the cost

c(A,B)=ttrav+pAi=1NAtisect(ai)+pBi=1NBtisect(bi)

where

 

 

The algorithm then optimize the partitioning with the goal of minimizing the total cost.

 

The Bucket Algorithm

The bucket algorithm follows a very simple pattern.

In the book, N=12.

 

Pros

 

Cons