Storing Your Photons

[ LiB ]

Storing Your Photons

You should now understand the nature of how photons move, but you haven't learned what the effect is after the photons interact with a surface. The nature of a photon after it has intersected an object must be simulated. Simulating the flow of light as it intersects objects using a series of photons is based on the object's material properties. The whole process can be broken down into two simple categories. One of two things can happen:

  • The photon can be absorbed into the object as heat or kinetic energy.

  • The photon can be reflected (or transmitted) from the object.

The absorption of photons is a very simple notion and can be easily simulated. But the types of reflection can be broken into a few functions for diffuse and specular surfaces. The behavior of the photon is determined by the type of material the photon encounters. Depending on the type of surface encountered , the specific reflection/transmission code is executed. It is very important to remember that a photon interaction with a material is very different from a ray interaction (as in ray tracing). Photons represent incoming illumination (flux) in the scene. Let's cover the procedures and rules necessary to construct the photon map.

First, photons are stored only when they hit diffuse surfaces. The reason why photons are not stored when they hit specular surfaces is because the storing of photons on specular surfaces is really a waste of memory and doesn't provide any important information. For example, a mirror would pose a problem for specular reflections using photon mapping because perfect specular reflections require a tremendous amount of photons to reflect the image in the opposite direction. Ray tracing does a better job at specular reflections in the mirror direction and it should be used for this purpose. When a photon originates from a light source, it can bounce from object to object diffusively and specularly. This means that the same photon can be stored in the photon map several times along its path if it encounters diffuse surfaces. This process is what builds the photon map.

The illumination information is stored separately from the geometry using the photon map, which is much better than radiosity meshing and its inherent memory constraints.

Note that the energy coming from the light sources is recorded by each pho-ton in the photon map. The photon map represents the direct and indirect illumination. It also represents a special lighting effect called caustics , covered later in this chapter. The more photons that propagate into a given region, the higher amount of strong incoming energy. The nature of a photon that interacts with a point on a surface in the scene can be one of four possibilities, described as follows :

  • When a photon hits a diffuse surface, you store the photon's incident direction and energy in the global photon map. The photon map is constructed only by diffuse interactions.

  • When a photon hits a specular surface, you do nothing to the global photon map but reflect the photon either in two ways. Depending on the opacity of the object, either mirror reflection or refraction (transmission) is simulated.

  • If the surface is partially diffuse and specular, you must use a method to randomly determine which component of the material carries higher weight. This is a simple method of proportionally and randomly choosing a probable outcome.

  • If the photon hits the object and somehow gets absorbed into the object, you store the photon in the photon map and end the photon's life.

You have to carefully plan and simulate these absorption and reflection/transmission factors of light. The next section takes a closer look at each effect that should be simulated when a photon interacts with a point on an object in the scene.

NOTE

TIP

It's very important to remember that when a photon intersects a point on an object,one of two things generally happens.The photon can be absorbed or reflected/transmitted.

[ LiB ]


Focus On Photon Mapping
Focus On Photon Mapping (Premier Press Game Development)
ISBN: 1592000088
EAN: 2147483647
Year: 2005
Pages: 128
Authors: Marlon John

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net