Scalable Ambient Obscurance

Scalable Ambient Obscurance

High Performance Graphics (2012) C. Dachsbacher, J. Munkberg, and J. Pantaleoni (Editors) Scalable Ambient Obscurance Morgan McGuire1;2, Michael Mara1;2, and David Luebke1 2NVIDIA; 1Williams College Alchemy AO [MOBH11]: r = 0:10m, 1280×720 in 2.3ms New SAO Result: r = 1:5m @ 1920×1080 in 2.3ms Figure 1: Given a fixed time budget, our new algorithm substantially increases ambient obscurance resolution and quality over the 2011 AlchemyAO algorithm, which uses the same mathematical estimator. The resulting increased shading fidelity in this example allows the viewer to better discern shape in regions such as the archways and curtains. Abstract This paper presents a set of architecture-aware performance and integration improvements for a recent screen- space ambient obscurance algorithm. These improvements collectively produce a 7× performance increase at 2560 × 1600, generalize the algorithm to both forward and deferred renderers, and eliminate the radius- and scene-dependence of the previous algorithm to provide a hard real-time guarantee of fixed execution time. The optimizations build on three strategies: pre-filter the depth buffer to maximize memory hierarchy efficiency; reduce total bandwidth by carefully reconstructing positions and normals at high precision from a depth buffer; and exploit low-level intra- and inter-thread techniques for parallel, floating-point architectures. 1. Introduction gorithm requires as input only a standard depth buffer (i.e., it eliminates AlchemyAO’s position and normal buffers), so it The Alchemy Ambient Obscurance algorithm by game stu- integrates with both deferred and forward renderers. Second, dio Vicarious Visions [MOBH11] produces high quality where AlchemyAO was designed to scale down to limited screen-space ambient obscurance (AO). They described its hardware at fixed resolution, our algorithm assumes mod- design goals as: first, scaling down from then-current GPUs ern hardware and scales up to high resolutions and world- to the low-end Xbox 360, and second, integration with a de- space sampling radii. This addresses a known limitation of ferred renderer at 1280×720 resolution. The AlchemyAO al- many previous screen-space AO methods, in which cache ef- gorithm, like prior screen-space AO techniques, has received ficiency and thus net performance falls when gathering sam- significant interest within the games industry. ples far from a pixel (shown in figure5). This paper introduces a new variant of AlchemyAO for modern and future graphics architectures. We maintain the Figure1 demonstrates the practical impact of our changes core mathematics of AlchemyAO but evaluate them with a for real-time applications. Both images show the factor by new Scalable Ambient Obscurance (SAO) algorithm that im- which environment lighting will be attenuated due to occlu- proves on AlchemyAO in two ways. First, the new SAO al- sion at various scales. The left image shows the obscurance c The Eurographics Association 2012. M. McGuire, M. Mara, & D. Luebke / AO result by the original algorithm. It exhibits the desirable fea- improve cache coherence, but apply it to the z input instead tures of AlchemyAO: grounded contact shadows, fine detail, of the AO output. To appreciate the difference, consider the and robustness to viewing direction. However, at the rela- obscurance cast onto a distant a receiver object. MAO gath- tively modest 720p resolution, AlchemyAO can only sam- ers onto large receivers. Thin features and high frequency ge- ple a 0.1m radius in 2.3 ms, limiting it to extremely lo- ometry can create flickering because they are undersampled. cal obscurance effects. The right image shows that even at Our SAO gathers distant occlusion from large casters. This higher 1080p resolution, the new SAO algorithm can sample means that the shadows cast by thin objects fade out quickly a large 1.5m radius in the same execution time, capturing (which one expects under area illumination), but that they more global occlusion. receive shadowing at all scales. Because we always sample every object at every pixel, there is no undersampling and As screen resolution increases, variance across pixels our approach is temporally robust. becomes less perceptible and bandwidth requirements in- creasingly limit performance. Holding the obscurance radius 2. Algorithm fixed and reducing filter quality provides a comparable vi- sual result at the same execution time. Our algorithm takes as input a standard depth buffer and makes a series of passes over the full screen that result in an We also discuss approaches for maximizing precision of an ambient visibility value 0 ≤ A ≤ 1 at each pixel. The ap- the depth buffer. This careful treatment of z precision enables plication’s forward or deferred lighting pass then modulates us to discard the position and normal G-buffer of Alche- environment an area illumination by A. The supplemental myAO and use a standard depth buffer instead, and then materials for this paper include GLSL implementation of all leads to our strategy of using fewer filter taps across a z- shaders. The input depth buffer is larger than the screen so hierarchy to reduce bandwidth without sacrificing quality. that objects in a guard band slightly outside the frame can create obscurance. The following sections describe the pur- 1.1. Related Work pose and optimizations of each pass. Concurrent academic and industry work by Shanmugam and Arikan [SA07] and Mittring [Mit07] introduced 2.1. High-Precision z Prepass physically-motivated screen-space ambient occlusion/ob- The input depth buffer typically arises from a depth-only scurance for real-time rendering. Subsequent papers and ∗ prepass, for which modern GPUs are highly optimized. Most presentations [Kaj09,Kap10,FM08,BS09,LS10,SKUT 10, renderers perform such a pass to avoid later shading frag- MOBH11] improved performance and quality. ments that are ultimately occluded. Mathematically, our technique combines the Alche- Precision for the depth buffer is key because we will de- myAO [MOBH11] estimator, a rotating sample pat- rive all other values in our algorithm from it. Research and tern [Kaj09], and a bilateral filter for reconstructing smooth industry have carefully studied depth buffer formats to maxi- AO from samples distributed over screen-space and the vis- mize the depth discrimination precision (e.g., [LJ99,AS06]), ible hemisphere [Kaj09, Kap10]. We also inherit the Alche- but given less attention to maximizing the reconstruction ac- myAO estimator’s treatment of the depth buffer as a thin curacy of camera-space points and normals from depth val- shell (instead of an infinitely thick volume) for view robust- ues. The latter problem involves the entire pipeline: creation ness, which was first developed by Loos and Sloan [LS10]. of the modelview projection matrix on the host, the vertex AlchemyAO [MOBH11] makes three passes: noisy AO es- transformation, hardware attribute interpolation, and storage timated from s samples at each pixel, and horizontal and in a depth buffer. Every arithmetic operation in that pipeline bilateral blur respecting depth edges. Its AO estimator for introduces error, so one must minimize operations and max- imize the precision at which they are performed. camera-space point C = (xC;yC;zC) with normaln ˆC is: !k We observe that the following increase the accuracy of z 2s s max(0;~v · nˆ + z b) A(C) = max 0;1 − · i C C (1) values computed from a depth buffer on modern GPUs: s ∑ ~v ·~v + e i=1 i i 1. Compute the modelview-projection matrix at double pre- where constants s, b, and k are chosen for aesthetics and e is cision on the host before casting to GPU single precision. a small offset to avoid division by zero. The estimator relies This comprises three matrix products (projection, cam- era, and object), divisions, and trigonometric operations. on points fQ1;:::;Qsg distributed on a ball about C, each of which yields a displacement ~vi = Qi −C. We use their esti- mator unmodified within a new algorithmic structure that is 2. Choose zf = −∞ in the projection matrix [Smi83]. This both more generally applicable and exhibits better absolute reduces the number of floating point ALU operations re- and asymptotic performance. quired for the matrix product [UD12]. Multiresolution AO (MAO) [HL12] computes AO at differ- 3. When using column-major matrices (the default in ent output scales and then upsamples with joint-bilateral fil- OpenGL), multiply vectors on the left (~v0 = ~vTP) in the tering before compositing. We also leverage this approach to vertex shader. This saves about half a bit of precision. c The Eurographics Association 2012. M. McGuire, M. Mara, & D. Luebke / AO Note that camera-space positions and normals stored in a use t = 7 for s = 9). Angular offset f is the random rotation G-buffer, such as those by AlchemyAO, also contain error. angle at a pixel. We use AlchemyAO’s XOR hash, The rasterizer interpolates those across a triangle as C=z;nˆ=z, f = 30x0 ^ y0 + 10x0y0: (8) and then divides by z at each pixel, where z itself was inter- 0 polated as 1=z with limited fixed-point precision. Because MIP level mi for sample i depends on hi and not a screen-space derivative, we explicitly compute: 2.2. Hierarchical z Pass 0 0 mi = blog2(hi=q )c (9) This pass converts the hardware depth buffer value 0 ≤ d ≤ 1 z = zmi (x0;y0) + h uˆ )=2mi (10) to a camera-space value z < 0 at each pixel by i i i 0 c0 Constant q is the screen-space radius increment at which z(d) = ; (2) we switch MIP levels; the optimal value depends on the res- d · c1 + c2 olution, number of GPU cores, and cache size. In our experi- where z and z are the locations of the near and far planes, n f ments, all 23 ≤ q0 ≤ 25 gave equivalent results. Lower values and constant array c = [z ;−1;+1] when z = −∞, and n f caused multiple taps at adjacent pixels to map to the same c = [z z ;z − z ;z ] otherwise.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    7 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us