Horizon-Based Ambient Occlusion (HBAO)
- HBAO is a real-time rendering technique that approximates ambient occlusion by integrating horizon data over a surface hemisphere.
- It employs an advanced visibility bitmask to discretize occlusion into sectors, efficiently handling thin geometries and multi-directional lighting.
- Quantitative evaluations show that HBAO delivers high visual fidelity with minimal performance overhead compared to classical methods.
Horizon-Based Ambient Occlusion (HBAO) is a screen-space technique for approximating ambient occlusion (AO), essential for visually plausible global illumination in real-time rendering. HBAO analytically integrates local geometric occlusion by evaluating visibility across a hemisphere over the surface normal, traditionally reducing the AO integral to a series of horizon-angle slices. Recent advancements extend this framework with the introduction of a visibility bitmask, offering robust handling of thin geometry and multi-directional light probes with minimal performance overhead (Therrien et al., 2023).
1. Classical HBAO Formulation
Let denote the binary visibility at point along direction on the hemisphere above . The ambient occlusion at is given by:
Expressed in spherical coordinates about :
HBAO approximates this by dividing the integral into 0 azimuthal slices 1. For each slice, depth samples are taken outward to locate occlusion “horizons,” i.e., maximum and minimum elevation angles 2. The inner 3 integral is then analytically computed over the non-occluded regions, yielding per-slice contributions:
4
The AO is then assembled as
5
This reduction achieves 6 complexity (7 = samples per slice), with each slice requiring storage of two angles.
2. Extension to Visibility Bitmask Representation
The core innovation of the “visibility bitmask” is to encode occlusion not as two horizon angles per slice but as an 8-bitmask 9 per slice, with each bit representing the occlusion state (occluded/un-occluded) of a sector. The hemisphere elevation 0 is uniformly partitioned into 1 sectors, each mapped to bit indices 2. During the depth-marching, at each sample, both “front” (3) and “back” (4, with 5 a fixed thickness) points are projected. Their elevation angles 6 define an occlusion interval 7, which is mapped to sector indices 8:
9
The corresponding bit pattern is formed by
0
and OR’ed into 1. After processing, 2 reflects which sectors in the slice are occluded by any “slab” of thickness 3. This discretized encoding naturally supports multiple non-contiguous occluded intervals, in contrast to the original two-angle model (Therrien et al., 2023).
3. Ambient Occlusion Integral with Bitmask
Occlusion integration with the bitmask replaces analytic intervals by summing over sector midpoints:
4
with 5 if occluded, 6 if not. Full AO is assembled across slices:
7
If the original 8 weighting is desired, precomputed per-sector weights 9 may be used:
0
1
In most practical cases, uniform weighting suffices and incurs less computational overhead (Therrien et al., 2023).
4. Real-Time Implementation and Pseudocode
Each pixel maintains 2-bit temporaries (for 3), typically consuming 4–8 uint32 registers or shared-memory space. The GPU implementation per slice consists of:
- Sampling 4 points along the slice from the depth buffer.
- For each, computing front/back angles, mapping to sector interval 5, constructing the respective bitmask, and OR’ing into 6.
- After all samples, computing 7, a native single-GPU instruction, to count occluded sectors.
- Calculating AO as 8.
For indirect-diffuse GI, each sample’s contribution is tested against the already-occluded mask with 9 before accumulation, ensuring unique lighting per visible sector. Pseudocode in the source paper outlines this per-pixel, per-slice workflow, covering both AO and single-bounce GI (Therrien et al., 2023).
5. Quantitative Performance and Quality Metrics
Empirical results for a 1920×1080 RTX 2080 configuration are summarized in the tables below.
| Radius | Samples/half-slice | GTAO AO (ms) | Bitmask AO (ms) |
|---|---|---|---|
| 0.8 | 8 | 0.49 | 0.51 |
| 1.0 | 12 | 0.75 | 0.77 |
| 1.0 | 16 | 0.95 | 0.97 |
| 2.0 | 16 | 1.12 | 1.13 |
| 3.0 | 16 | 1.12 | 1.13 |
The bitmask overhead at 0 is approximately 0.01–0.02 ms (∼2%), rising to 5–10% for 1.
Indirect-diffuse GI performance:
| Config | Rays (slices×steps) | Resolution | Sampling (ms) | Denoise (ms) | Total (ms) |
|---|---|---|---|---|---|
| (a) | 4×(8 const) | full | 0.90 | 0.33 | 1.23 |
| (b) | 4×(8 const, r=4) | full | 1.70 | 0.33 | 2.03 |
| (c) | 4×(16 const, r=4) | full | 2.30 | 0.33 | 2.63 |
| (f) | 4×(16 exp, r=4) | half | 0.97 | 0.10 | 1.07 |
Comparative studies demonstrate reduced noise against SSR tracing at equal sample budgets (because each sample yields occlusion), fewer over-darkening “halos” around thin geometry, and AO visually close to ray-traced references—capable of capturing small-scale detail even at low sample counts. Multi-cone ambient occlusion improves the smoothness and directionality of shading over bent-normal approaches (Therrien et al., 2023).
6. Thin Geometry Handling and Multi-Cone Ambient Lighting
Traditional HBAO construes the depth buffer as a height field, failing on light passing behind thin, disconnected features. The bitmask mechanism models each sample as a ground “slab” of finite thickness 2, permitting light leakage through gaps if any sector remains unoccluded after all sample slabs are OR’ed. This multi-interval encoding is efficient, enables the capture of complex visibilities, and mitigates overdarkening near thin surfaces without resorting to deep G-buffer or stochastic approaches (Therrien et al., 2023).
Moreover, the bitmask allows efficient sampling of ambient lighting in 3 cones per slice. The 4 azimuth is divided into 5 segments; per subrange, the unoccluded bit fraction weights the ambient probe in that direction. This generalizes bent normal lighting (6) to multi-directional probes, enabling robust, directionally-aware ambient shading with negligible added cost, as per-popcount operations suffice (Therrien et al., 2023).
7. Summary and Significance
HBAO with visibility bitmask advances the state-of-the-art in real-time screen-space ambient occlusion and indirect illumination by discretizing the occlusion horizon into multiple sectors per view direction. It preserves 7 sampling costs while supporting accurate modeling of thin geometry and multi-directional occlusions. The method’s generality extends to indirect diffuse and multi-cone ambient illumination, achieving visual results comparable to ray-tracing or multi-layer techniques but with the storage and performance footprint of classical HBAO (Therrien et al., 2023).