16. Serious Fun
within a scene, and we consider the familiar rainbow and the common, but
perhaps less familiar, glory eect by simulating them with shaders and puing
them in the context of scenes. We go on to note the various ways you can cre-
ate an interesting path from zero to one and how we can manipulate motion
with these techniques. Fog is next on the list, and we show how we can make
fog more interesting by applying noise techniques to vary the fog’s density.
We then look at morphing (some might say “abusing”) 3D geometry. A short
excursion into a dierent kind of exploration gives us algorithmic art, where
we operate on either pixels or texels to create some new kinds of 2D images.
We then consider the concept of information in an image and explore a way
we can provide information with pure motion. We close with a bang, with an
explosion shader that the geometry shader makes possible. This gives you an
indication of just how many things you can do with shaders, and we would
love to hear from you, via the book’s website, about your own creations.
The general concept of light interference is that two light waves can interfere
with each other, reinforcing each other at times or canceling each other at
Figure 16.1. How a CD or DVD acts as a diraction grating.