next up previous contents
Next: 9.3.2 Sphere Mapping Up: 9.3.1 Planar Reflectors Previous: Planar Reflections using Texture

Interreflections

 

Either the stencil technique or the texture mapping technique may be used to model scenes with interreflections. Each algorithm uses additional passes for each ``bounce'' that the light takes, stopping when the reflected image added by the pass is too small to be significant.

Using the stencil technique, we draw the reflected image with the most ``bounces'' from the viewpoint first. We compute the viewpoint for this pass by repeatedly reflecting the viewpoint through the reflective polygons. On each pass, we draw the scene, move the viewpoint to the next position, and draw the scene using the stencil buffer to mask the reflective polygons from the previous passes.

Using the texture technique, we first create textures for each of the reflective objects. We then initialize the textures to some known value (choice of this value will be discussed below). Next, we iterate over the primitives, drawing the scene for each one and copying the results to the primitive's reflection map as described above. We repeat this process until we determine that the additional passes are not having a significant effect.

The choice of the initial reflection map values can have an effect on the number of passes required. The initial reflection value will generally appear as a smaller part of the picture on each of the passes. We stop the iteration when the initial reflection is small enough that the viewer will not notice that it is not correct. By setting the initial reflection to something reasonable, we can achieve this state earlier. A good initial guess is to set the map to the average color of the scene. In a multiframe application with moving objects or a moving viewpoint, we could leave the reflection map with the contents from the previous frame. This use of previous results is one of the advantages of the texture mapping technique.


next up previous contents
Next: 9.3.2 Sphere Mapping Up: 9.3.1 Planar Reflectors Previous: Planar Reflections using Texture

David Blythe
Thu Jul 17 21:24:28 PDT 1997