Lecture 1: Light

Contents
  • Light travels in straight lines.
    • This is not always true in reality, even for rendering. E.g., we can model objects with a gradient in the index of refraction which creates curved paths. And in broader physics, the more correct statement would be to say light follows geodesics through potentially curved space time. But, in practice, this is a simplifying assumption that is the basis of most of rendering.
  • The irradiance of a surface (the amount of radiant flux hitting the surface per unit area) is…
    • linear with light intensity.
    • not linear with the size of the light.
    • proportional to 1/r21 / r^2 where rr is the distance from the surface to the light.
      • i.e., the inverse square law
      • This does not apply to infinite area lights, e.g., directional lights, environment lights (skybox), etc.
    • proportional to cos(θ)\cos(\theta), i.e., the dot product of the surface normal and the normalized vector from the surface to the light.
      • At shallower angles, the light is more spread out, causing the illuminated surface to appear dimmer.
  • Light’s intensity does not attenuate (at least without a participating medium that absorbs/scatters).
    • If you look at a light through a pinhole right up close to the light, it will appear just as bright through that pinhole as it would if you looked through it farther away. Likewise, the intensity is also unaffected by the angle at which you look at the light.

The following properties of light are usually not included in most renderers.

  • Flourescent materials which reflect light at a different wavelength than incident illumination.
    • This would require your path tracer to integrate over more than just the standard RGB wavelengths!
  • Polarized light
    • Some more advanced renderers can account for multiple wavelengths and polarized light, e.g., Mitsuba.
  • Light interference.
    • Path tracing uses ray optics, aka geometric optics, which cannot model interference.

Consider the following equation that models the light arriving at a point on a surface Li(x)L_i (\mathrm{x}): Li(x)=ΩLe(x,ω)cos(θx)dω\begin{align} L_i (\mathrm{x}) = \int_{\Omega} L_e(\mathrm{x}, \vec{\omega}) \cos(\theta_{\mathrm{x}}) \mathrm{d}\omega \end{align}

  • Ω\int_{\Omega} represents the integral is over the hemisphere with respect to the surface normal N\vec{N}.
  • Le(x,ω)L_e (\mathrm{x}, \vec{\omega}) is the light arriving at x\mathrm{x} from (normalized) direction ω\vec{\omega}.
  • θx\theta_{\mathrm{x}} is the angle of incident light at position x\mathrm{x}, i.e., cos(θx)=ωN\cos(\theta_{\mathrm{x}}) = \vec{\omega} \cdot \vec{N}
  • dω\mathrm{d}\omega represents an infinitesimal solid angle – basically saying “over all directions”

The solid angle represents the area of the projection of a surface onto the unit sphere. For a small surface patch dA\mathrm{dA}, the corresponding solid angle is: dω=dAcos(θ)r2\begin{align} \mathrm{d}\omega = \frac{\mathrm{dA} \cdot \cos(\theta)}{r^2} \end{align} where cos(θ)\cos(\theta) in this case is the dot product between the normalized vector from the point on the emitting surface to the recieving point and the normal vector of the emitting surface.

/posts/blog/tu-wien-rendering-course-notes-lecture-1/images/irradiance_from_quad.png
The differential solid angle corresponding to the differential area on a surface are related by equation 2. This is figure 4.9 from PBR.

Therefore, the light arriving at a point x\mathrm{x} (i.e., the point p\mathrm{p} in the diagram above) from a light source ll with surface SlS_l is: Li[l](x)=SlLe[l](y)cos(θx)cos(θy)r2dAy\begin{align} L_i^{[l]}(\mathrm{x}) = \int_{S_l} L_e^{[l]}(\mathrm{y}) \cos(\theta_{\mathrm{x}}) \frac{\cos(\theta_{\mathrm{y}})}{r^2} \mathrm{dA_y} \end{align}

where

  • Li[l](x)L_i^{[l]}(\mathrm{x}) is the is the light arriving at point x\mathrm{x} from light ll.
  • Sl\int_{S_l} represents the integral is taken over the surface of the light – not over the hemisphere!
  • Le[l](y)L_e^{[l]}(\mathrm{y}) represents the light intensity at point y\mathrm{y} from the surface.
  • cos(θx)\cos(\theta_{\mathrm{x}}) is the dot product between the normalized vector from x\mathrm{x} to y\mathrm{y} and the surface normal of the point being illuminated Nx\vec{N_x}.
  • cos(θy)\cos(\theta_{\mathrm{y}}) is the dot product between the normalized vector from y\mathrm{y} to x\mathrm{x} and the surface normal of the light source Ny\vec{N_y}.
  • r2r^2 is the squared distance between x\mathrm{x} and y\mathrm{y}.
  • dAy\mathrm{dA_y} represents the integral is being taken over small surface pathces of the light.

For more info, check out chapter 4 of PBR 4th edition, in particular, chapter 4.2.

  • Radiant energy QeQ_e [J][\mathrm{J}] (Joules)
  • Radiant flux / power Φe\Phi_e [W=J/s][\mathrm{W} = \mathrm{J}/\mathrm{s}] (Watts, Joules per second)
  • Radiant intensity Ie(ω)I_e(\omega) [W/sr][\mathrm{W} / \mathrm{sr}] (Watts per steradian)
  • Irradiance Ee(x)E_e(\mathrm{x}) [W/m2][\mathrm{W} / \mathrm{m}^2] (Incident flux per unit area)
  • Radiant Exitance Me(x)M_e(\mathrm{x}) [W/m2][\mathrm{W} / \mathrm{m}^2] (Emitted flux per unit area)
  • Radiosity Je(x)J_e(\mathrm{x}) [W/m2][\mathrm{W} / \mathrm{m}^2] (Emitted and reflected flux per unit area)
  • Radiance Le(x,ω)L_e(\mathrm{x}, \omega) [W/(m2 sr)][\mathrm{W} / (\mathrm{m}^2 \ \mathrm{sr})] (Flux per unit area per solid angle)
  • Radiance per wavelength Le,λ(x,ω)L_{e, \lambda}(\mathrm{x}, \omega) [W/(m2 sr nm)][\mathrm{W} / (\mathrm{m}^2 \ \mathrm{sr} \ \mathrm{nm})]

Every radiometric quantity has a corresponding photometric quantity, which represents the percieved brightness instead of the physical brightness. For example, Luminance is the photometric quantity equivalent to Radiance. Often in rendering, we may need to account for the conversion between radiometric and photometric units. Gamma correction is one such case as our perception of brightness is not linear with intensity.

Cameras measure radiance – i.e., the amount of light hitting the surface area of each pixel over the solid angle ‘seen’ by the pixel. Le=dΦdAdω L_e = \frac{\mathrm{d} \Phi}{\mathrm{dA}^\perp \mathrm{d}\omega}

Note, here the dA\mathrm{dA}^\perp uses \perp to account for the cos(θ)\cos(\theta) component – i.e., the amount of the surface area that is perpendicular to the light.

The BRDF represents how much light is reflected from a given direction to another given direction at a given position, and at which wavelengths.

The white furnace test for energy conservation says that a non-emissive material cannot create light, it can only absorb or reflect light. Therefore, if the incoming light at the surface of the material is Li=1L_i = 1, the integral of the BRDF over the surface must be Le1L_e \leq 1.

Consider the BRDF for a perfectly diffuse surface. To pass the white furnace test, we set Le=1L_e = 1 in equation 1 and compute the integral over the hemisphere using the Jacobian for spherical coordinates on the unit hemisphere (sin(θ)dθdϕ)(\sin(\theta) \mathrm{d}\theta \mathrm{d}\phi): Ωcos(θ)dω=02π0π/2cos(θ)sin(θ)dθdϕ=π \int_\Omega \cos(\theta) \mathrm{d}\omega = \int_0^{2\pi} \int_0^{\pi/2} \cos(\theta) \sin(\theta) \mathrm{d}\theta \mathrm{d}\phi = \pi

Therefore, the BRDF for a perfectly white diffuse material is 1/π1 / \pi for all directions.