Shadow Caster Volumes For The Culling Of Potential Shadow Casters
4.0 Semi-Transparent ObjectsRendering semi-transparent objects that can receive shadows is very expensive. First the scene must be rendered as normal using all opaque objects. The main steps for an additive stencil shadow algorithm [LENG02b] are given below,
Once this has been done, we need to render the semi-transparent objects, one at a time, from back to front order. To render each individual object we need to perform the following steps,
An important improvement is that the shadow caster volume calculated for each light source, semi-transparent object pair, can be greatly reduced from the general shadow caster volume for the light source. Instead of calculating the shadow caster volume from the view frustum, we instead calculate it from the semi-transparent object's bounding box.
Once we convert the semi-transparent object's bounding box to a polyhedron, the calculation of the shadow caster volume is the same as for a view frustum. We assume that the bounding box is stored as four vectors, R , S , T and C . R , S and T are the orthogonal axes of the bounding box, with the each vector's magnitude being the size of the box along the axis. C is the center of the bounding box. For each axis, we want to calculate the two planes for the box's end points. Let A be the axis we are currently dealing with.
As derived above, we can define a plane given its normal, and a point on the plane. So the two planes for an axis A are,
Given a normal convex polyhedron – bounding volume intersection test implementation, polyhedron planes that meet at an acute angle are likely to give false positives. This occurs because it is possible for an object's bounding volume to intersect the positive half space of each plane, yet still not intersect the polyhedron. Diagram 9 illustrates an example of this.
Acute angles are much more likely to occur when generating shadow caster volumes for semi-transparent objects than for view frustums. A solution to this problem is to add an additional plane to the shadow caster volume polyhedron [LENG02a].
|