Light Transport and Stochastic Q-Processes
This is the first in a series of tutorials about the mathematical underpinnings of light transport. This tutorial covers, among other things:
- The derivation of the radiative transport differential equation.
- The corresponding Lagrangian stochastic -process.
- Scattering statistics and mean-free path.
This tutorial is aimed at students at the graduate level or advanced undergraduates.
The Photon
Let's first start by thinking about the simplest object involved in light transfer: the photon. If you're interested in what a photon actually is - an excitation of a quantum field - you'll have to learn quantum field theory, but for our purposes, imagine that a photon is just a discrete particle of light travelling through space. A photon has a few elementary properties, including:
-
Position: At any given time , every photon has a position .
-
Direction: At any given time , every photon has a direction (here denotes the 2-sphere of points unit distance away from the origin). While direction may vary, the speed of a photon in free space is always constant as .
-
Wavelength: A photon has a specific wavelength . The electromagnetic field carrying a photon usually has a periodicity and is the length of a single period.
-
Frequency: A photon has a frequency . The frequency measures the time periodicity at which the underlying electromagnetic field - locally, the oscillations of electromagnetic field returns to its original configuration every seconds. The frequency and wavelength are related by the speed of the photon,
- Energy: A photon carries with it a certain amount of energy. This energy comes from the light source that generate the photon via spontaneous or stimulated emission. The Planck-Einstein relation postulates that the energy a photon carries is directly porpotional to its frequency. The constant of porportionality is called the Planck constant :
- Momentum: As postulated by de Broglie, the momentum of a particle is inversely porpotional to its wavelength, i.e.,
For our purposes the important parts of a photon are really only its position, direction, and wavelength. In the coming sections, we will therefore focus on .
Photon Motion in Free Space
Photons don't just sit there, they tend to move around. In fact, they move around at the speed of light (which is pretty fast). Therefore, if we're describing the motion of a single photon in free space, it should satisfy the basic equation of motion:
In linear optics, photons tend not to interact with each other, so if we have a collection of photons , the equations are motions are not coupled in any way:
Note that to complete the equations, we need to specify the directions . In free space, once a photon has been released, it will retain its direction and speed as long as it doesn't hit anything. Therefore, the free space equations for photon motion are exceedingly simple, as the directions are all constants :
Starting from initial positions , these ODEs are very easy to solve:
Note that this analysis is in terms of individual non-interacting particles . This is usually refered to as a Lagrangian formulation. Most of the time however, the motion of individual particles is not the end goal. Instead, we are often interested the distribution of particles . This distribution is specified as a function of both a position in space and a direction . Note that the evolution of is not tied to the viewpoint of the individual particles, but rather to the viewpoint of individual locations in free space. This distribution-based view is referred to as an Eulerian formulation.
How does one go from the Lagrangian formulation to an Eulerian formulation? One way is via a technique known as characteristic analysis. Note that the equations of motion are completely reversible - if I specify the position and orientation of a photon at time , you can calculate backwards the position and orientation at time . Therefore, all particles follow non-intersecting characteristic paths through the phase space . This means that the distribution of particles along these paths should remain constant over time. This gives the equation:
Using the chain rule,
In the particular case of free space, is constant, therefore, using the equation (6) for from above, we get
Rearranged this gives
If we fix , you might recognize this as the transport equation from partial differential equations.
Scattering in Homogenous Media
Of course, the above equations are very simplistic. They simply say that photons move in straight lines when in free space. Though this is useful, often-times photons are moving through a medium where they constantly collide with other particles and are scattered and absorbed throughout. The different ways materials scatter light are wholy reasonable for the different ways they look. For example, in the above figure, light enters the lion and then scatters around inside it until it exists and hits the viewer's eye. This gives the impression of soft lighting and partial translucency (see how the tail lets some light through with its red-orange highlights). So, if we are going to talk about light transport with an eye towards rendering things like the statue above, we are going to need to discuss how light changes direction.
Unfortunately, this process is not deterministic. Or at least, it is not deterministic from the macroscopic viewpoint. Two light particles can hit the same surface and be reflected in completely different directions. We model this by saying that a light particle hitting a material (or fluid) at location in direction has a certain probability of being redirected in direction ωoωo. It also has a certain probability of being absorbed. In the most general case, we want to think about rates rather than concrete probabilities. When a photon enters a scattering medium like the one pictured above, the photon will move a certain distance until it impacts something in the medium that redirects it. You should think of the contents of the medium as being random, and hence the distance travelled before a photon impacts an obstacle will be random as well. The average distance travelled before a photon hits an obstacle (i.e. scatters) is called the mean free path. The higher the mean free path, the more the photon can travel through the medium unobstructed and therefore the clearer the medium.
Let us take this information and think about the parameters of a particle travels through a homogenous scattering medium. Occasionally will suddenly change randomly when the particle hits something. But how do we characterize this randomness?
We can model this scattering process by using a continuous -process on the sphere . Recall that a -process on is a continous time random process whose value changes abruptly at random times . In particular, a -process on is characterized by a generator operator which satisfies
where
Here denotes the surface area measure on . We'll talk more about later, but for now, let's focus on . You should think of the function as the probability transition rates to go from a state . That is, satisfies:
In other words, after a very small amount of time , has a probability of about to jump to a small solid angle around . This function is called the phase function and determines the rate at which a photon travelling in direction is redirected to direction after it hits an obstacle.
How do we go from a Lagrangian formulation of a -process to an Eulerian formulation? Well let us ignore the position of our particles (the medium is homogenous, so position doesn't really matter when it comes to rotation) and simply examine the probability distribution of the directions of our particles. We write the distribution of directions of our particles as . You should think of this function as a representing the fact that there are photons anywhere in the medium that are in direction .
Let us compute how the density changes over time at a given orientation . From the definition of the -process above, we have that
This expression is saying that the number of particles in direction at time is the number of particles in direction at time , plus the number of particles that are redirected from any other direction into direction over the time , minus the number of particles that are redirected from direction to any other direction over the time . Note that we can take out of the integral above to get
Rearranging the above and taking gives us
This often appreviated by writing
where is the adjoint of (i.e., ). This equation is called the forward equation for a -process. Here, one says that the operator generates the time evolution of . This is very similar to deriving the forward equations for a random walk by using Ito's lemma.
The Statistics of Scattering Events
The next question one might ask is for the actual statistics of the scattering times . These are relatively straightforward. Note that the -process is Markovian and hence the intervals are independent and identically distributed. This makes sense, because once the particle has scattered, it doesn't care about anything other than its current position and orientation. In other words, the path a particle has taken to get to a certain point is irrelevant, it is only the current state that matters. To derive statistics for the , we need to consider the distribution . is defined as the distribution of particles that have not yet scattered. At any given time the probability that a particle scatters in the next seconds is given by:
Let be the number of scattering events between times and . We can determine the distribution of the scattering time as follows (we simply write here for a random variable with the distribution of ):
For disjoint intervals and , a property of the -process is that and are independent. Therefore, we have that
We now use the fact that and to get:
Recall that
Therefore, we get
This is the exponential distribution with rate , hence the times between scattering events have distribution
A nice outcome of this fact is that we can easily compute the mean scattering time to be:
The mean free path is therefore
If the medium is isotropic (i.e., the function is rotationally invariant), then does not depend on and this can just be written as
Full Eulerian Formulation
One can obtain a full Eulerian formulation for the evolution of as follows. Let us consider the number of particles in a set with direction , i.e.,
The change in the number of particles in moving in direction is given by the particle flux through the boundary as well as the particles inside that scatter either from some direction to or scatter from direction to some direction . We can write this as
The represents the sum of all particles that move out of the region over a time interval and the represents the change in particle number from scattering inside the region (as we derived two sections ago). Stokes' Theorem can be applied to the term over to get
Since this is true for any , it must be the case that
Now rearranging and letting ,
Voila. This is the Eulerian formulation of light transport in a homogenous medium with phase function . Writing it out in full gives:
For comparison, the Langrangian form of these equations is
where is a -process on with generator .
Isotropic Scattering
The simplest example of a scattering medium is one that is fully isotropic, i.e., regardless of the incomming and outgoing directions and , the rate of scattering is the same. That is,
Usually this is referred to as isotropic scattering. In this case, the scattering coefficient does not depend on and is easily calculated to be
The equations in the previous section now take on the form
Here is shorthand for the average photon density at over all directions ,
Scattering in Heterogenous and Absorbing Media
In the previous examples, we assumed that the scattering medium was the same everywhere, i.e., that the phase function did not depend on . In this section, we see what happens when the phase function does depend on . This is relatively common, many objects are not entirely uniform. For example, your hand scatters light, but your hand is not uniformly made of the same material. There's skin, muscle, bone, blood, etc. And each of these materials have different properties. How do we model this? Well, now the statistics of the direction of a particle will depend heavily on that particle's position and path.
If this is the case, then is now a -process whose phase function changes depending on the position XtXt of the particle. We will write the new phase function as . This means that the generator of the process now depends explicitly on the value of . Hence, we have
where once again,
In addition to this, we also give a particle a certain probability of being absorbed at any point in time. This probability is quantified by the absorption coefficient which is defined in a similar way to the phase function:
What this means is that the -process now has a chance of jump to a dead state from which it can never return. Therefore, the number of particles in a region now changes over a small period dtdt according to:
The terms with a factor represent, in order of appearence:
- The net number of particles that leave the region .
- The number of particles that are scattered in from some direction to .
- The number of particles that are scattered in from to some other direction .
- The number of particles absorbed in .
Repeating the procedure of the previous section will give us:
Alternatively, we can just write this as:
Where the generator of the full joint process is given by:
We have therefore derived the full radiative transport equation.
Statistics of Scattering Events
Let us assume for now that the scattering medium is non-absorbing, i.e., that everywhere. Just like in the homogenous case, every particle will have a series of scattering times . The difference now is that these scattering times depend explicitly on the path the photon is travelling along.
We can calculate the statistics of scattering events by using the same trick as last time. Let be the number of scattering events in the time interval . Suppose that the particle has direction ωω and is traveling along the ray . The we have that:
When , we know that . Therefore,
We then have:
As this converges to
Therefore, if one wishes to simulate a photon scattering in a heterogenous medium, one might sample scattering times from the above distribution.
Statistics of Absorption Events
The above section only covers scattering events. However, a photon may experience either a scattering or an absorption event while it is traversing through a medium. Recall, that photons travelling in direction at a position are absorbed at a rate . Combining this with scattering events, at every time step of , a photon has a probability of being absorbed and a probability of being scattered. Let be the event where the photon is absorbed. Therefore, one can follow the derivation of the previous section to obtain:
Therefore, the probability that the photon is absorbed is given by:
Similarly, the probability that the photon is scattered is given by:
If the media is homogenous, that is if and , this reduces to:
Emissive Media
In addition to absorbing and scattering light, a general medium can also emit photons. To quantify this emission, we introduce an emission rate . The quantity of light emitted at in direction over a short period is given by
Therefore, it is relatively simple to see that we should update the Eulerian equations by adding a term to the right hand side:
Or written out in full:
Lights are examples of emissive materials.
Steady-State Radiative Transfer
Often times, we aren't interested in the evolution of the distribution over a short time scale, but rather, we're interested in the average distribution over a very long time. Our eyes act like integrators, so if we want to talk about rendering, we care about the time averaged distribution of photons,
This time-averaged distribution should represent a sort of "steady state" of the system when a given is applied as an input. Computing this also requires time integrating out fluctuations in the emissive term ,
At equilibrium, we expect that the distribution of light no longer changes, so an easy way to compute it is to set
This can be written out as:
These are the elliptic equations for the steady state of a radiative transfer system. Note that the equations are linear in . Therefore, we know that the function ρρ must be linear in ,. This linearity can be written in terms of a scattering operator that acts on the function . This function corresponds to applying the Green's function of the elliptic equation above:
Steady-State Transfer with Boundary Conditions
Often times we're not interested in scattering on the whole of , but rather on some restricted domain . We can easily imagine the following question: given the geometry and makeup of someone's face, suppose we put a flashlight under it and want to know what the face will look like when after the light propagates through it.
From such a problem to be well posed, we need to specify an ingoing light at the boundary. We will denote this as (for "flashlight"). is defined on the boundary for ingoing directions . Furthermore, we may have emissive materials inside the domain , which we will have to model with the function defined on the interior of . Therefore, we have
And we have boundary conditions
In the same way as before, the output is linear in the inputs and . It can therefore be written as:
where and are scattering operators (from boundary to and interior to respectively). They also have corresponding Green's functions:
The Green's function when the output is restricted to the boundary and is called the bidirectional scattering distribution function (BSDF) of the object .
Radiant Flux, Irradiance, and Radiance
There are some fundamental quantities that often get tossed around in light transport. It is good to put everything together with standard temonology. Let us go through all the necessary terms one-by-one:
- Radiant Flux (across a surface ): The radiant flux through is given by the energy that moves through per unit time. Recall that the energy per particle is given by
Therefore, for monochromatic light with wavelength , the radiance flux across is given by:
- Irradiance: The irradiance at a location on a surface is a measure of the energy recieved/emitted by the surface per unit time per unit area. It is written as:
- Radiance: The radiance at a location and in direction on a surface is a measure of the energy recieved/emitted by the surface per unit time per unit area per solid angle. It is often written:
It is common to write as where is the angle between the direction of the photon and the normal of the surface,