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. The application will need to determine the maximum number of interreflections to be rendered.
When using the stencil technique, it is necessary to rearrange the stencil operations so that the reflected scene images are masked directly by the stencil buffer. Render the reflections with the deepest recursion first. Concatenate the reflection transformations for each reflection polygon involved in an interreflection. Render each reflected image as follows:
The choice of the initial color applied to reflectors in the scene 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. A good initial guess is to set the initial color to the average color of the scene.
When using the texture technique, render with the deepest reflections first as above. The texture algorithm is more simple in that the only operations for each reflection are to apply the concatenated reflection transformations, copy the image to texture memory, and apply that image to the reflector during the next pass.
In an interactive application with moving objects or a moving viewpoint, it may be acceptable to use the reflection texture with the contents from the previous frame. This use of previous results is one of the advantages of the texture mapping technique.