Graphics Reference
In-Depth Information
effect. A Lie diagram for the glory is shown in Figure 16.19,
computed from MiePlot for a range of water drop sizes.
Notice that the sizes are much smaller—about an order of
magnitude—than the sizes for the rainbow; the rainbow and
the glory do not occur in the same atmospheric conditions.
You will also note that there are, in fact, several bands of simi-
lar color. We will use this diagram as a look-up map as we
did in the rainbow example, taking the radius as a constant
set by the slider variable Radius and looking up the color
based solely on the angle.
When we apply this approach to compute a glory, we
see the effects shown in Figure 16.20 against a solid quad
(left) and against a photograph of a cloud surface (right).
The code for the fragment shader that was used to cre-
ate the right-hand image of Figure 16.20 is shown below;
it is quite similar to the rainbow fragment shader. The
background cloud image is loaded and associated with the
uImageUnit in the GLIB file as was done in Chapter 9. The
angle is set up relative to the direction to the sun, not the
angle into the scene; these angles are complementary, so the
computed angle must be subtracted from 180° for the tex-
ture look-up (recall the angles shown in Figure 16.15).
Figure 16.19. A Lee diagram of
the color of the glory for different
angles and water droplet radii.
The radii are in µm.
Figure 16.20. The glory effect, seen mixed against a solid white quad (left) and as added
into a photograph of a cloud surface (right).
Search WWH ::




Custom Search