
932 Chapter 20 Special Effects Using Shaders
The sample application also has a dynamic update system. If the environment
changes, the scene is re-rendered to create the cube maps. Of course, the objects that
will receive the reflection are also rendered. If one reflecting object reflects another,
you will not see the environment map on the reflected object.
Example
20.1
Create a cube map whose texture RGB values are compressed unit-length vectors.
If V generates (s , t) on one of the faces, and if U = V/|V|=(u
0
, u
1
, u
2
), the texture
RGBcolorisC(s, t) = ((1, 1, 1 ) + (u
0
, u
1
, u
2
))/2. This is called a normalization map.
GivenavectorV, a lookup into the normalization ...