PDA

View Full Version : Photon falloff goes the wrong way?



soren
September 26th, 2006, 18:45
I've been wondering something about Mental Ray's implementation of global illumination and photon mapping. I made this image to illustrate my question:

http://monkeydyne.com/lamrug/cornell_photons.jpg

Why are photons' energies distributed with the most energy at the farthest edge and no energy right in the middle? Wouldn't there be less artifacting, not to mention a more realistic representation of energy distribution proportional to distance, if the photons' falloff went the other way with brightness at the middle trailing off to dark at the edges?

This isn't causing any problems for me per se, I'm just curious why it's implemented in this way. Thomas Driemeyer is a smart guy and I'm sure he has his reasons.

(Posted here because this seems to be a Maya/XSI/3DS independent question.)

bart
October 2nd, 2006, 17:34
This has to do with the algorithm for finding few photons in a given radius. You'll only see this behavior when trying to visualize photons with few photons in the scene with relatively moderate-to-large size radii.

The reason this happens is to compensate for photons on the edges of objects, where photons spread across only a portion of the circular area of interest to indicate an illumination adjustment.

For example, consider a radius for a circular area, where an object covers half the circle, and the center of the circle, the intersection point, is just on the edge of this object. Only half the area should be used for calculating the irradiance, which is the sum of photon energies / area.

This algorithm makes it so that the edges of objects don't lose illumination energy. It only has a misleading side effect when using our GI visualization technique of reducing photons and increasing photon/GI radius to see where the photons are landing.

Assuming the spot is all in the same object, you should imagine them to be the same intensity as the middle of the spots. I.e., the bigger the circle, the less the average intensity for the same energy of photons.