Path Tracing Optimizations in Indiana Jones™: Opacity MicroMaps and Compaction of Dynamic BLASs

The first post in this series, Path Tracing Optimization in Indiana Jones™: Shader Execution Reordering and Live State Reductions, covered ray-gen shader level optimizations that sped up the main path…

Louis Bavoil
12 min readintermediate
--
View Original

Overview

This article discusses the path tracing optimizations implemented in Indiana Jones™ using Opacity MicroMaps (OMMs) and the compaction of dynamic Bottom-Level Acceleration Structures (BLASs). These optimizations significantly reduced GPU processing times and VRAM usage, enhancing performance in vegetation-heavy scenes.

What You'll Learn

1

How to implement Opacity MicroMaps for optimizing ray tracing in graphics applications

2

Why dynamic BLAS compaction is essential for managing VRAM in real-time rendering

3

How to reduce GPU processing time for alpha-tested objects in path tracing

Prerequisites & Requirements

  • Understanding of ray tracing concepts and GPU architecture
  • Familiarity with Vulkan and DirectX ray tracing specifications(optional)

Key Questions Answered

How do Opacity MicroMaps improve ray tracing performance?
Opacity MicroMaps reduce the number of Any Hit Shader invocations by precalculating an opacity state for micro-triangles. This allows the GPU to avoid unnecessary shader calls, resulting in a 55% reduction in GPU time for the TraceMain pass when enabled.
What impact does dynamic BLAS compaction have on VRAM usage?
Dynamic BLAS compaction reduced the VRAM required for all BLASs from 1027 MB to 606 MB, achieving a 41% savings. This optimization is crucial for maintaining performance in scenes with dynamic vegetation.
What are the key settings used for the graphics in the profiled scene?
The graphics settings for the profiled scene included a 4K UHD output resolution, DLSS Ray Reconstruction in Performance Mode, and a High graphics preset. This setup was crucial for testing the optimizations effectively.
What challenges were faced during the OMM baking process?
The OMM baking process faced challenges with some OMMs taking excessively long to bake due to the complexity of UVs and alpha maps. To mitigate this, parameters were adjusted to skip OMMs that exceeded a certain workload size.

Key Statistics & Figures

GPU time for TraceMain pass with OMMs OFF
7.90 ms
Initial performance before implementing Opacity MicroMaps.
GPU time for TraceMain pass with OMMs ON
3.58 ms
Performance after implementing Opacity MicroMaps, showing a 55% reduction.
VRAM usage before dynamic BLAS compaction
1027 MB
Total VRAM allocated for all BLASs in the scene.
VRAM usage after dynamic BLAS compaction
606 MB
Total VRAM allocated for all BLASs after applying compaction.

Technologies & Tools

Graphics Optimization
Opacity Micromaps
Used to enhance ray tracing performance by reducing shader calls.
Graphics API
Vulkan
Utilized for implementing Opacity MicroMaps and managing GPU resources.
Graphics API
Directx Ray Tracing (dxr)
Framework for implementing ray tracing features in the game.

Key Actionable Insights

1
Implement Opacity MicroMaps in your ray tracing applications to significantly reduce shader invocation overhead.
This optimization is particularly effective in scenes with alpha-tested materials, as demonstrated by a 55% reduction in GPU time in the TraceMain pass.
2
Utilize dynamic BLAS compaction for managing VRAM in scenes with dynamic geometry.
This approach can lead to substantial memory savings, as shown by the reduction from 1027 MB to 606 MB in the Indiana Jones™ game, allowing for better performance on lower-end GPUs.
3
Regularly verify the presence of OMMs in your models to ensure optimal performance.
Using a debug mode to visualize ray tracing results can help identify areas where OMMs are missing, allowing for timely adjustments in asset preparation.

Common Pitfalls

1
Overlooking the complexity of UVs and alpha maps during OMM baking can lead to excessive processing times.
This issue can be avoided by setting parameters to skip OMMs that exceed a certain workload size, ensuring efficient baking without unnecessary delays.

Related Concepts

Ray Tracing Optimization Techniques
GPU Memory Management
Shader Performance Tuning