In this lesson, you will learn how to strategically transition between Lumen’s Software Ray Tracing (SWRT) and Hardware Ray Tracing (HWRT) to maintain a stable frame budget in dense, geometry-heavy environments.
The Hybrid Optimization Strategy
Lumen’s default mode—Software Ray Tracing—uses Signed Distance Fields (SDFs) to calculate lighting. It is incredibly efficient for large, sprawling scenes, but it struggles with thin geometry and complex overlapping meshes. Conversely, Hardware Ray Tracing (HWRT) uses the GPU’s dedicated RT cores to trace against the actual triangle geometry, providing pixel-perfect lighting at a significant performance cost.
In complex World Partition scenarios, you should not treat these settings as global toggles. Instead, use a tiered approach:
- Prioritize Software Ray Tracing: Keep
r.Lumen.HardwareRayTracingset to0for your base environment. Since you have already optimized yourNanitemeshes andHLODclusters, SWRT will handle the majority of your global illumination efficiently. - Targeted HWRT Overrides: Use HWRT only where SWRT fails, such as areas with high-density, thin-walled architecture or complex mechanical props where SDF-based representation leads to light leaking.
- Project Settings and Console Variables: When testing your deployment, use the console to toggle HWRT to identify if your frame drops are caused by BVH build times or ray-trace traversal:
; Use this to toggle HWRT for A/B testing in your dense cells
r.Lumen.HardwareRayTracing 1
; Ensure hit lighting is used for high-fidelity reflections
r.Lumen.Reflections.HardwareRayTracing 1
Managing the Performance Hit
When you enable r.Lumen.HardwareRayTracing, you increase the workload on the GPU's traversal unit. If you notice stuttering while streaming new World Partition cells, it is likely due to the Acceleration Structure build time. To mitigate this, ensure your Nanite proxies are optimized, as Lumen HWRT utilizes these structures. If your frame rate tanks during traversal, force the project to fallback to Surface Cache mode by reducing the Lumen Scene update frequency, keeping the high-fidelity HWRT restricted to localized, hero-focused cinematics or interiors rather than wide-open landscape views.
Key Takeaway: Use Software Ray Tracing as your baseline for large-scale performance, and reserve Hardware Ray Tracing only for localized, high-fidelity areas where SDF limitations cause unacceptable visual artifacts.