IV. ANÁLISIS DE CONTEXTO Y DE LA SITUACIÓN ACTUAL
IV.3. LIDERAZGO
The following list is a summary of the modifications required to support logarithmic rasteri- zation:
Figure 7.5: Depth compression visualization. The depth buffers on the top row are compressed using the linear depth compression algorithm of Hasselgren and Akenine-M¨oller (2006). Our algorithm was used on the bottom row. The images are tinted red for compressed tiles and blue for tiles where the sample depths are either all 1 because they were untouched during rasterization or all 0 due to depth clamping. (Left)Both algorithms perform well on a standard shadow map using linear rasterization. (Middle) The linear depth compression fails completely for a logarithmic warped shadow map at lower resolutions (512×512) due to the curvature of the primitives induced by the warping. (Right) At higher resolutions (1024×1024), the linear depth compression starts to work on tiles far from the viewer where there is less curvature.
• An increase in bit width in the rasterizer to support the 24-bit fixed-pointycoordinates. Details about the bit widths in current GPUs are not generally available. A GPU supporting 4K×4K buffers with 4 bits of subpixel precision would have to support at least 16 bit fixed-point coordinates.
• Evaluators to compute the exponentials in the edge and interpolation equations.
• Application of the logarithmic parameterization toy coordinates in setup. • Computation of generalized polygon offset in setup.
• A new depth compression unit.
The rest of the graphics pipeline remains the same.
We believe that these enhancements are feasible because they are incremental and leverage existing hardware designs. The modifications are isolated to only two fixed-function elements of the GPU pipeline. The changes to the rasterizer are incremental. The new depth com- pression unit using our algorithm would have complexity comparable to other algorithms. If desired, the depth compression unit could sit alongside the existing one used for linear rasterization. Because our algorithm also provides comparable compression ratios for linear rasterization, our depth compression unit could feasibly replace the existing unit, thereby enabling a single unit to handle both linear and logarithmic rasterization.
Our enhancements require only a modest increase in on-chip calculations but deliver sig- nificant reductions in bandwidth and storage requirements. Using increased computation to save bandwidth aligns well with current hardware trends because for the same cost, com- putational power continues to increase rapidly while bandwidth lags considerably behind. Therefore, these enhancements provide a good balance between bandwidth reduction and implementation cost.
CHAPTER 8
Conclusion
The goal of this thesis has been to generate high-quality, hard-edged shadows for real-time applications. Shadow maps are one of the most attractive algorithms for achieving this goal because of their flexibility and good performance characteristics, but they suffer from aliasing artifacts. Our focus has been on reducing aliasing error by using a better sampling distribu- tion to render the shadow map. Ideally, we would like to sample exactly where the shadow map queries are generated. But this is difficult to do with real-time performance because the irregular data structures that such an approach requires are difficult to implement efficiently on current hardware. Instead we have proposed a new warping technique, logarithmic per- spective shadow maps (LogPSMs), which is more suitable for current hardware designs. The logarithmic rasterization required to support this technique can be implemented through rel- atively minor enhancements to existing hardware, and can achieve performance comparable to the real-time shadow map algorithms used today, but with less error.
Like existing warping methods, LogPSMs use a perspective projection to tightly fit the extents of a shadow map to the view frustum or its side faces. This causes the spacing between shadow map samples to increase quadratically along the view direction. In general, however, the spacing should increase linearly to match the spacing between shadow map queries, thus avoiding high error. LogPSMs correct the quadratic spacing by applying a logarithmic transformation.
We have conducted an in-depth analysis of aliasing error to determine just how much improvement LogPSMs can give over existing methods. The focus of our analysis has been to minimize the maximum error at any point in the view frustum without requiring information about the scene. Since the perspective factor of aliasing error does not depend on the orien-
tation of the surfaces in the scene, we minimize this factor. We have introduced the storage factor as a metric for perspective aliasing error which takes into account the maximum error along both shadow map dimensions. Minimizing the storage factor yields a parameterization that is near optimal. Unfortunately, this parameterization is quite complex and therefore impractical. We have shown however, that LogPSMs have the same maximum error as this parameterization. This is not the case with existing warping algorithms. This means that the error of LogPSMs is closer to the lower bound.
8.1
Benefits of logarithmic perspective shadow maps
One of the primary benefits of LogPSMs is that they give a more uniform error distribution throughout the view frustum. Other methods may actually have lower error than a LogPSM for different parts of the scene. For instance, a standard shadow map will typically have less error than a LogPSM for regions at the far plane, but this comes at the expense of much higher error at the near plane.
In general, a LogPSM algorithm has lower maximum error than the corresponding algo- rithm based on perspective warping. We have shown that the storage factor for perspective warping is O(f /n), where f and n are the near and far plane distances. In contrast, the LogPSM parameterization has a storage factor ofO(log(f /n)). Therefore, LogPSMs give the greatest improvement over other methods in scenes with highf /n.
The LogPSM parameterization can be used to warp a single shadow map or it can be can be combined with a partitioning technique such as face partitioning orz-partitioning. A single shadow map LogPSM can provide the greatest error reduction of any existing scene- independent warping technique, but only for a subset of all light directions. The lowest error is achieved when the light direction is perpendicular to the view direction. The highest error occurs when the light is behind or in front of the viewer, in which case warping cannot be used. To obtain low error for these light directions, a partitioning scheme must be used. z- partitioning reduces the error for the light behind case, but does not affect the error when the light direction is perpendicular to the view direction. As the number ofz-partitions increases the relative difference between LogPSM warping and perspective warping decreases. For a
large number of partitions, warping provides little benefit over a uniform parameterization. Therefore, the LogPSM parameterization gives the greatest relative advantage over a uniform or perspective parameterization when only a few z-partitions are used.
To get the benefit of warping over all light directions, a face partitioning scheme must be used. This increases the number of shadow maps that need to be rendered. We show that for the same number of shadow maps,z-partitioning actually gives lower error than face partitioning combined with perspective warping (unless z-partitioning is also used on the faces, but then face partitioning is better only with a large number of shadow maps, and the relative difference is quite small.) This is not the case with LogPSMs. With face partitioning, LogPSMs always have a lower maximum error over all light directions than z-partitioning. But with a sufficient number of partitions, az-partitioning scheme can get quite close to the same error as a LogPSM. Section 5.3.6 describes how a LogPSM can be approximated withz- partitioning. For a directional light, 8–16z-partitions begins to be competitive with LogPSMs, even for the worst case light directions. For an omnidirectional point light, LogPSMs have more of an advantage overz-partitioning becausez-partitioning would have to be applied to multiple faces. In the end, the benefit of LogPSMs comes down to the relative difference in cost between rendering a few shadow maps with logarithmic rasterization and rendering a larger number of shadow maps withz-partitioning.