Skip to content

Add XeGTAO ambient occlusion - #983

Open
ehardesty wants to merge 25 commits into
Novum:masterfrom
ehardesty:gtao
Open

Add XeGTAO ambient occlusion#983
ehardesty wants to merge 25 commits into
Novum:masterfrom
ehardesty:gtao

Conversation

@ehardesty

Copy link
Copy Markdown

Summary

Adds a Vulkan compute implementation of Ground-Truth Ambient Occlusion based on Intel's XeGTAO.

The implementation is designed for vkQuake's existing renderer and does not depend on TAA or temporal accumulation. GTAO is disabled by default and can be enabled from the graphics menu or with r_gtao.

Features

  • Adds GTAO depth preparation, horizon search, spatial denoising, and compositing
  • Uses half-resolution rendering with depth-aware reconstruction
  • Adds Off, Low, Medium, and High graphics-menu presets
    • Low: half resolution, quality 2
    • Medium: half resolution, quality 3
    • High: half resolution, quality 4
  • Supports MSAA depth and stencil classification
  • Suppresses AO appropriately for translucent water, slime, lava, and teleport surfaces
  • Supports multibounce approximation and configurable GTAO tuning cvars
  • Includes visualization modes for debugging the AO, depth, and liquid mask
  • Restores the original renderer resource and execution path when GTAO is disabled
  • Adds shader embedding to the Meson and Visual Studio build systems
  • Includes the upstream XeGTAO attribution and MIT license

Implementation notes

GTAO uses a five-level view-space depth pyramid followed by horizon sampling and an edge-aware spatial denoiser. Half-resolution output is reconstructed using full-resolution depth information to avoid bleeding across geometry edges.

The menu presets all use half resolution because this provides a better performance-to-quality tradeoff, particularly at 4K. Higher presets increase the number of horizon samples instead of increasing the AO buffer resolution.

Temporal accumulation was intentionally omitted because vkQuake does not have TAA or motion-vector infrastructure.

Changing GTAO between enabled and disabled requires a renderer restart so the renderer can switch its depth/stencil attachment usage and storage behavior. With GTAO disabled, the renderer retains its original resource and execution path.

Validation

  • Built all seven GTAO shader variants in Debug and Release configurations
  • Validated the generated SPIR-V modules
  • Completed an MSVC Release build
  • Ran with Vulkan validation enabled using:
    • odd framebuffer dimensions
    • half-resolution GTAO
    • quality level 4
    • 4x MSAA
    • MBOIT
  • Manually tested GTAO presets and enable/disable behavior

@ehardesty
ehardesty marked this pull request as ready for review August 12, 2026 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant