
56 I Geometry Manipulation
Figure 4.3. A collection of explosions rendered using different primitive types.
The color of the explosion at each step is calculated by performing a lookup
into a gradient texture using the
displacementOut parameter (from Listing 4.1) as
a texture coordinate. This color is then blended with the other samples gathered
from previous steps before the next step of the ray.
This process is repeated either until we hit the exit point of our ray or, as
a further optimization, until the output color has reached full opacity and no
further steps would contribute to the final color of the pixel. (It is important to
note that this optimization ...