
180 IV Mobile Devices
V
1
, V
2
– vertex/pixel to light vectors V´
1
, V´
2
– local corrected vectors
- - - Bounding
volume
V
2
V´
2
C
V´
1
L
V
1
Figure 1.4. Representation of local correction of a vector according to the cubemap
position and the bounding volume.
Output value:
Lp—the corrected vertex-to-light vector which needs to be used to fetch
a texel from the shadow cubemap.
There may be many other methods of correcting the vector. The one that we
used is listed in Listing 1.1.
// Working in the world coordinate system
vec3 intersectMaxPointPlanes =(BBoxMax − V )/L ;
vec3 intersectMinPointPlanes =(BBoxMin − V )/L ;
// Find only intersections in the forward direction ...