Graphics Reference
In-Depth Information
Within the PS_DualMa p pixel shader, we simply skip the current pixel if it has a negative
DualMapZ property. It may also be necessary to adjust the value slightly to include more
pixels in the output; otherwise, you may get gaps along the hemisphere seam, for example,
when directly looking down on one of the spheres in the example scene. To sample our DPM,
we must take the reflection vector and transform it into the reflective surfaces' view-space,
thus adding the DualMapView constant buffer property. This allows us to determine the UVW
coordinates for the texture lookup. Based on the sign of the reflection's z value, we assign
half of the dual paraboloid to it. We have separated the DualMapView property from the
WorldViewProjection matrix so that we are able to sample other DPMs for the reflections
of reflective surfaces. Compared to a cube map of the same resolution, a DPM requires
one-third of the texture memory. The DPM does waste some of this space due to the curved
images (the sampled portion is a parabola, as highlighted in the cross section of the following
diagram), and as a result, the quality of the DPM is less than that of the cube map:
Visualization of sampling from one half of a dual paraboloid map, note the cross section.
Our simple test scene achieves a very similar performance for both dual paraboloid mapping
and cubic environment mapping. Before geometry instancing and improvements in hardware
support for cube mapping, we would have seen a greater performance difference between
dual paraboloid and cube mapping. As it stands, fewer geometry instances are most likely
offset by the increased sampling cost within the pixel shader.
 
Search WWH ::




Custom Search