\documentclass{article} 
\usepackage{graphicx}
\usepackage{667}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{Lecture 5: Rendering Equation by Area}%% Title of lecture
\author{Jon Moon}  		  %% Name(s) of scribe(s)
\date{8 February 2005}    	  %% Date of lecture, e.g., 1 January 2001
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\maketitle

\addtolength{\parskip}{\baselineskip}

\section{Introduction}

The solid angle formulation of the rendering equation discussed in the previous lecture is commonly used today, but Kajiya originally used a different formulation that can be more convenient in some circumstances: the \emph{area formulation}. While the solid-angle formulation uses radiance $L_e : \mathcal{M} \times H^2 \rightarrow \mathbb{R}$ as the central quantity, Kajiya's area formulation centers around \emph{transport intensity} $I : \mathcal{M} \times \mathcal{M} \rightarrow \mathbb{R} $. This quantity measures the flux between patches around two points, per unit area at both locations:

% This code will produce a figure, and load the image "transport.eps" from the working directory.

% \begin{figure}[h]
% \begin{center}
% \includegraphics{transport.eps}\\
% \caption{Transport intensity from point $x'$ to $x$: $I(x' \rightarrow x) = \frac{d^2\Phi}{dA dA'} \: (\frac{W}{m^4})$}
% \end{center}
% \end{figure}

Recall that
\begin{align*}
L_i(x \leftarrow x') &= \frac{d^2\Phi}{dA d\omega^\perp} = \frac{d^2 \Phi}{dAdA' \cos \theta \cos \theta' / r^2} &\text{and}\\
L_e(x' \rightarrow x) &= \frac{d^2\Phi}{dA' d\omega'^\perp} = \frac{d^2 \Phi}{dA' dA \cos \theta' \cos \theta / r^2} &\text{so}\\
I &= L \frac{\cos \theta \cos \theta'}{r^2}
\end{align*}

We can get irradiance at $x$ by integrating over surfaces: $E(x) = \int_\mathcal{M} I(x' \rightarrow x) dA(x')$ (this assumes that all surfaces are visible).

\section{Transport Reflectance $\rho$}

Kajiya encodes light reflection in a \emph{3-point transport reflectance function} $\rho(x'' \rightarrow x' \rightarrow x)$, that tells how much the light flowing from $x'' \rightarrow x'$ influences the reflected light flowing from $x' \rightarrow x$. Rather than using $\rho$, we will use $\tilde\rho = \frac{\rho}{r^2}$ that makes the area formulation's connection to the solid angle formulation more straightforward.

Just as the BRDF relates reflected radiance to incident irradiance, which is radiance integrated over projected solid angle, the 3-point reflectance $\tilde\rho$ relates reflected transport intensity to incident irradiance, which is transport intensity integrated over area.

\section{Example: Lambertian Reflector}

Lambertian reflectors have the property that they ``forget" where incoming light originates, since all absorbed light is emitted uniformly over the hemisphere. Thus we can think of collecting and emitting light as two separate processes. Assume that the surface has reflectance $R$. 

The irradiance on surface $A'$ at point $x'$, assuming full visibility, is $E(x') = \int_\mathcal{M} I(x'' \rightarrow x')dA(x'')$.

The reflected radiant exitance is $M(x') = R\:E\:(x')$. 

This power is distributed uniformly over the hemisphere with respect to projected solid angle, so surface $dA$ will receive a fraction $\frac{\mu(dA)}{\mu(\mathbb{H}^2)} = \frac{dA \cos \theta \cos \theta' / r^2}{\pi}$. 

So the flux from $dA'$ to $dA$ is $\frac{dA \cos \theta \cos \theta' / r^2}{\pi}\:R\:E(x')\:dA'$, which expands to 
\[
I(x' \rightarrow x) = \underbrace{\frac{R}{\pi} \frac{\cos \theta \cos \theta'}{r^2}}_{\tilde\rho(x'' \rightarrow x' \rightarrow x)} \int_\mathcal{M} I(x'' \rightarrow x') dA(x'')
\]

More generally, $\tilde\rho(x'' \rightarrow x' \rightarrow x) = f_r(x', \overrightarrow{x'x''}, \overrightarrow{x'x}) \:\frac{\cos \theta \cos \theta'}{||x - x'||^2}$, where $f_r$ is the BRDF. As  $\tilde\rho$ is the transport intensity ratio per unit area, it has units $\frac{1}{m^2}$.

\section{Visibility and Emission}
We're almost to the rendering equation, but we haven't accounted for visibility
and light emission. For visibility, we introduce a term $V(x,x')$: 
\[
V(x, x') = \begin{cases}
	   1 & \text{if $x, x'$ are visible to one another},\\
	   0 & \text{otherwise}\end{cases}\\
\]
Finally, for emitted light we use the emitted transport intensity, $I^0(x' \rightarrow x)$. Note that the units are $\frac{W}{m^4}$. 

Putting this together with the reflection equation yields Kajiya's Rendering Equation:
\begin{equation}
I(x' \rightarrow x) =  V(x, x') \left[ I^0(x' \rightarrow x) + 
\int_\mathcal{M} \tilde\rho(x'' \rightarrow x' \rightarrow x) \; I(x'' \rightarrow x') \; dA(x'')
\right]
\end{equation}

\section{From Area to Hemispherical Formulation}
Now let's see how this looks in standard units. Let $G(x',x) = \frac{\cos \theta' \cos \theta}{||x' - x||^2}$, and recall:
\begin{gather*}
L(x' \rightarrow x) = I(x' \rightarrow x)\; \frac{\cos \theta' \cos \theta}{||x' - x||^2 } = I(x' \rightarrow x)\;G(x',x)\\
\tilde\rho(x'' \rightarrow x' \rightarrow x) = f_r(x'' \rightarrow x' \rightarrow x) \frac{\cos \theta' \cos \theta}{||x' - x||^2 } = f_r(x'' \rightarrow x' \rightarrow x)\;G(x',x)
\end{gather*}

Substituting these into (1) yields
\[
L(x' \rightarrow x)\;G(x',x) = V(x, x') \left[ L^0(x' \rightarrow x)\;G(x',x) + \int_\mathcal{M} f_r(x'' \rightarrow x' \rightarrow x)\;G(x',x)\;L(x'' \rightarrow x')\;G(x'',x')\;dA(x'') \right]
\]

Cancelling $G(x',x)$ from both sides of this equation gives:

\begin{equation}
L(x' \rightarrow x) = V(x, x') \left[ L^0(x' \rightarrow x) + \int_\mathcal{M} f_r(x'' \rightarrow x' \rightarrow x)\;L(x'' \rightarrow x')\;G(x'',x')\;dA(x'') \right]
\end{equation}

Now we need to re-introduce $L_i$ and $L_e$. Note that if $V(x, x') = 0$ then $L(x' \rightarrow x) = 0$, and if $V(x, x') = 1$ then $L(x' \rightarrow x) = L_e(x',\overrightarrow{x'x}) = L_I(x,\overrightarrow{xx'})$. Thus when $V(x, x') = 1$, (2) becomes:

\[
L_e(x',\overrightarrow{x'x}) =  \left[ L_e^0(x',\overrightarrow{x'x}) + \int_\mathcal{M} f_r(x', \overrightarrow{x'x''}, \overrightarrow{x'x})\;V(x', x'')\;L_e(x'',\overrightarrow{x''x'})\;G(x'',x')\;dA(x'') \right]
\]

This resembles the solid angle formulation of the rendering equation, except that the integral is still over area. Consider the following two observations:

Observation 1: $\int$stuff $ V(x',x'')\:dx''$  \underline{is} an integral over the hemisphere: there is exactly 1 point $x''$ that is visible from $x'$ for each direction in the hemisphere of $x'$.

Observation 2: $G(x',x'')\;dA(x'')$ \underline{is} projected solid angle measure:
\begin{align*}
\sigma & = \frac{dA''\:\cos \theta''}{r^2} \\
\mu & = \sigma \cos \theta'\\
& = \frac{dA''\:\cos \theta''}{r^2} \cos \theta' \\
& = dA''\;G(x',x'')
\end{align*}

So the only remaining difference is a change of variable in the integral:

\begin{align*}
L_e(x',\omega') &= L_e^0(x',\omega') + \int_\mathcal{M} f_r(x', \overrightarrow{x'x''}, \omega')\;L_e(x'',\overrightarrow{x''x'})\;\underbrace{V(x', x'')\;G(x'',x')\;dA(x'')}_{=\;d\mu(\overrightarrow{x'x''})} \\
&= L_e^0(x',\omega') + \int_{\mathbb{H}^2} f_r(x', \omega'', \omega')\;L_e(x'',-\omega'')\;d\mu(\overrightarrow{\omega''}) &\text{where $x'' = \psi(x',\omega'')$}
\end{align*}

Note that the area formulation has different pieces as an operator equation:
\[ I = V(I^0 + MI)\]

\section{The Integrating Sphere: a Light Transport Example}

A common laboratory device known as an ``integrating sphere" has interesting properties that make it a particularly simple example for light transport. Consider a sphere with a diffuse coating on the inside, illuminated by a small Lambertian source that is part of the wall (a laser is shining onto the outside of the sphere, for instance).

What is the direct illumination on the surface? 

The irradiance of the source is the radiance multiplied by the projected surface area. If the area is $dA$, $\mu(dA) = \frac{dA\:\cos \theta\:\cos \theta'}{r^2}$.

From the law of cosines,

\begin{align*}
r^2 &= 2R^2 - 2R^2cos(\pi-2\theta)\\
&= 2R^2(1+cos(2\theta))\\
&= 2R^2(1+2\cos^2\theta -1)\\
&= 4R^2cos^2\theta
\end{align*}

So $\mu(dA) = \frac{dA\:\cos \theta\:\cos \theta'}{r^2} = \frac{dA}{4R^2}$, which does not depend on $x$!

So for diffusely emitted light, the energy goes uniformly to the whole surface.

In the area formulation, for \underline{any} distribution of diffusely emitter light $L_e^0(x)$
\begin{align*}
L_r(x) &= \int_{\mathbb(S)^2} \frac{\rho}{\pi}\;L_e(x')\;\underbrace{G(x,x')}_{=\:\frac{1}{4R^2}}\;dA(x')\\
&= \frac{\rho}{4R^2\pi} \int_{\mathbb(S)^2}L_e(x')\;dA(x')\\
&=\rho\,\overline{L_e}
\end{align*}

That is, simply the reflectance multiplied by the average $L_e$. So in this case, the rendering operator $\mathbb{KG}$ is just $\mathbb{KG}L_e = \rho\,\overline{L_e}$.
\end{document}