Flylib.com

Books Software

 
 
 

Absorbing Light

[ LiB ]

Absorbing Light

If an object is opaque , it absorbs most of the incident light. This means that you must simulate this concept using photon mapping of light being absorbed. Light is absorbed mostly on diffuse surfaces. Sometimes when light hits an object, it is randomly absorbed. The random absorption of light in an object can become a very complex task because this is a factor of an object's molecular structure. In nature, light scatters in an object and reflects many times before it comes back out from some arbitrary direction. See Figure 11.10, which shows two photons . P1 depicts a photon released from the light source and sitting at the point of intersection. P2 shows the same photon randomly positioned because of the object's molecular structure.

Figure 11.10. Absorption of a photon released from a light source interacting with an object.

graphic/11fig10.gif


The light that is reflected outside the object can end up in some mysterious places you would never expect, and deriving an efficient rendering algorithm poses a series of problems. For this reason light is absorbed at the point of intersection. Recall that when a photon hits an opaque object and somehow gets randomly absorbed, the photon is recorded at the point of intersection and doesn't travel any longer. The photon's life is ended. How opaque the object appears must be taken into consideration when absorbing a photon. This means that when storing photons for absorption in the photon map, an object's opacity must be incorporated.

[ LiB ]
[ LiB ]

Transmitting and Reflecting Light

The transmission and reflection of light to other surfaces can be broken into two simple categories, specular and diffuse. The movement of light to other surfaces in a scene from the point of intersection can be random, bent, or straight. In the case of photons , the power of a mirror-reflected photon is scaled by the material's specular coefficient. The transmission of light through the object is scaled by the object's opacity. The diffuse interaction and reflection of light are based on the material's diffuse coefficient. The next section takes a closer look at the reflection/transmission effects that must be simulated using photon tracing.

Diffuse Interaction and Reflection

Diffuse interaction and reflection are induced by a material's diffuse coefficient. Diffuse interaction and reflection is responsible for most of the light you observe with your eyes. When a photon interacts with a diffuse surface, it is stored in the photon map at the point of intersection and is reflected as well. Because diffuse light can randomly scatter to nearby objects in the scene, as in radiosity, you have to randomly reflect diffuse photons. Because it's a reflection effect, a new photon is yielded to randomly reflect the light in some particular direction. The direction of the reflected photon can be arbitrary from the point of intersection. You can determine the power of the new reflected pho-ton by scaling the incoming photon with the diffuse reflectance coefficient of the material. The code for performing diffuse reflection is from Chapter 3.

Specular Reflection

Specular reflections are induced by a material's specular coefficient. If a pho- ton interacts with a specular surface, one of two things can happen:

  • The photon can be reflected in the mirror direction.

  • The photon can refract in or out of the object.

Mirror Reflections

When light is incident on a perfect specular surface such as a mirror it is reflected in the opposite direction. This means that a new photon should be reflected the same way. See Figure 11.11 for an example mirror reflections.

Figure 11.11. An example of specular (or mirror) reflection of a photon interact ing a surface.

graphic/11fig11.gif


The formula for perfect specular reflection is used as in ray tracing. But instead of reflecting a ray in the opposite direction, a reflected photon is traced. The specular coefficient must also be taken into account when specu-larly reflecting a photon. If the surface were a mirror, the outgoing photon is equal to the same power of the incoming photon because the surface has very few imperfections. Recall that photons are not stored when they encounter specular surfaces; photons are only stored on diffuse surfaces. A photon can be specularly reflected multiple times by specular surfaces but is only recorded in the photon map when it finally intersects a diffuse surface.

Refraction

Recall that objects that are transparent allow light to pass (or transmit) through them. When light changes between two mediums, the speed of the light normally slows. It may also bend in order to travel to its destination. Figure 11.12 shows an example of refraction. In the case of light (a series of photons) changing mediums (such as from air into the object), the photons will travel through the object and will bend to an angle specific to the object. The new location of a refracted photon is based on the index of refraction.

Figure 11.12. Refraction of a photon changing mediums as it leaves air and travels into an object and then back out from some arbitrary direction.

graphic/11fig12.gif


NOTE

NOTE

All the effects such as diffuse interaction,diffuse reflection,specular mirror reflection,and refraction are available in photon mapping.

[ LiB ]