Physical basis of rendering

Started by
7 comments, last by robotichrist 13 years, 9 months ago
Hi!

I know this is possibly too theoretical for this forum, but I have had this sort of curious question in the back of my mind for some time and figured I'd share it with you folks to see what turns up.

In physics, light propagation is described by a wave equation,

$ c^2 \del^2 \varphi(x, t) - \frac{\partial^2 \varphi(x, t)}{ \partial t^2 } = 0 $

Where $\varphi$ is a time varying light field, $c$ is the speed of light (which varies according to material), and the boundary conditions are given by the geometry of the problem.

However, in graphics we often work with a convenient approximation of this model using ray tracing. The idea is that we can compute the amount of light at a point (assuming perfect reflection/refraction/absorption) by just casting a ray from the eye into the scene. This approach is definitely intuitive, but I am curious to see how (or if) it is possible to derive it from the more physically correct wave equation. Similarly, can it be shown that photon mapping correctly solves for all physical light propagation? One would hope that it does!

I am almost positive that these questions have already been dealt with in the literature, possibly in the primary sources even, but I am unsure which are the best papers to read to get understand this. (and I'd rather not waste too much time on the folly reading through bad papers...)

So I put this question out: which are the best graphics papers that deal with rendering from a physical perspective?
Advertisement
Quote:Original post by robotichrist
Similarly, can it be shown that photon mapping correctly solves for all physical light propagation?

Of course it doesn't. With the exception of some very simple shapes without occlusion that have an analytical solution, all current GI algorithms are approximations. Light is either treated as particles or as a wave, depending on the algorithm, and its effects are computed as a stochastic distribution. Interactions are evaluated over differential domains, both spatially and spectrally, which requires the solving of multivariate integrals. So as long as we don't have a closed form analytical solution, there's going to be a margin of error due to the probabilistic or iterative sampling.

Besides all that, most GI solvers or raytracers will not accurately model the interaction of the wave with the molecular structure of the materials it hits (wavefront diffraction, etc), nor full wave propagation effects such as interference. Very few solvers will yield the correct result when modeling and rendering a double-slit experiment setup or a hologram, for example.
Pedantically, you are right; such models don't take into account quantum phenomena and so they are at least asymptotically unphysical, but this is not really the spirit of what I was asking.

I don't know if it was clear in the first post, but I would like to say that I am not asking for a 100% accurate solution to the lighting problem from first physical principles. Not only are such physical laws still unknown, but frankly, I am not very interested in such a thing and I don't expect most people in graphics would be either. Much like models of fluids or rigid bodies, I don't think it is necessary to invoke such extreme atomic phenomena to create a physically plausible model.

However, I do think that it is important to understand how the classical model of light as a wave propagating in space relates to current rendering approaches. Based on what is done in optics, where people study things like lenses, refraction and diffusion, it ought to be enough to just work with Maxwell's equations (which ultimately reduce to the wave equation) to get a highly accurate model. Surface effects can just be plugged in as boundary conditions via BRDFs. In fact, I suspect that this is where the basic concept of a BRDF originates.

I suppose what I am asking for could be phrased more mathematically ; how does one go from a wave equation to ray tracing? Or more generally path tracing/photon mapping? This same technique ought to work for other wavelike phenomena such as sound and radiative heat transport. Indeed, it appears that ray tracing is applied to both of these problems based on my casual surveying of the literature, so there is probably some good explanation.


Edit: Fixed the heat transport blurb based on Pragma's comment.

[Edited by - robotichrist on June 18, 2010 2:42:53 PM]
This is a really good question. I think what you are looking for is called the Eikonal approximation. Basically it amounts to assuming that the wavelength of light is small compared to all other scales of interest. That's very sensible since these wavelengths are in the 100s of nanometers. I have yet to find a resource that explains clearly the sequence of steps that takes you from electromagnetism to ray tracing. You probably won't find it in the graphics literature, I would suggest an advanced textbook on electromagnetism or optics.

Unfortunately this approximation doesn't work well for sound, since the wavelengths are much longer (centimeters to tens of meters). Or perhaps I should say fortunately, since otherwise we wouldn't be able to hear around corners, and we'd have to point our ears toward people to listen to them speak. I also don't think it would apply to heat, since the heat equation is not a wave equation (it is first order in time derivatives).
"Math is hard" -Barbie
Quote:Original post by robotichrist
In physics, light propagation is described by a wave equation,

$ c^2 \del^2 \varphi(x, t) - \frac{\partial^2 \varphi(x, t)}{ \partial t^2 } = 0 $


A little off-topic... but if you want to put LaTeX equations in your posts, you might be interested in this or this if you're not already aware of them.
Wikipedia:Rendering equation
In particular photon mapping computes the integral by approximating it using a sum over n photons. Whether this converges to the integral depends on how the integral behaves.
That's "the most physical" commercial render engine I'm aware of:
www.maxwellrender.com

Two years ago when first versions hitted the market your could find technical background information about how it works and what kind of algoritms and techniques are used.
I'm not really sure of what level of details are you looking for, but the book Physically based rendering offers several chapters on the physical/mathematical principles behind rendering. Of course, it is not a physic book: it is a graphic programming book, so it might be or might be not what you need.
If you want to give it a look, be warned that the new edition is going to be out in a couple months...
I think I figured it out on my own. Here are some links which basically answer the question:

http://www.mathpages.com/home/kmath242/kmath242.htm

http://en.wikipedia.org/wiki/Fermat's_principle

As a short synopsis, the theory that light travels in rays can be described by Fermat's principle, which basically says that the light paths from a source to a point are paths of minimum distance. From this basic variational principle, one can easily deduce Snell's law and the rest of the the ray propagation theory. To get the complete story and tie everything back to the wave equation, one needs to derive this principle from a more fundamental result known as the Huygen-Fresnel principle. This basically says that the surface of an expanding wavefront propagates as an infinite sum of wave fronts along its surface. Effectively, this is just a restatement of the Eikonal equation in disguise, and provides enough information to derive the ray tracing approximation of light propagation.

I am thinking about maybe writing this up in a blog post once I take some more time to digest all of this. Fermat's principle is definitely useful, especially in ray tracing. For example, tells you why shadow rays 'work' and also what the right way to calculate lights for refractive caustics ought to be.

This topic is closed to new replies.

Advertisement