How to Enable and Disable Lumen "Use Hardware Ray Tracing when Available" during Runtime

Enabling “Use Hardware Ray Tracing when Available” makes Lumen lighting more accurate at a cost to performance. I would like to give my users the ability to toggle on and off this setting in-game. How would I go about doing this?

In the following screenshots I’ve demonstrated the quality and performance impact of toggling on and off “Use Hardware Ray Tracing when Available”.

Off, 50ish FPS

On, 40ish FPS

1 Like

I believe that might be up to the engine’s .ini file, but I know there are commands that let you mix and match software and hardware RT elements at once, I don’t know what they are off the top of my head though. I’d imagine you could, but I’m unsure about the shader compalition needed to support one versus the other, not to mention potential memory constraints as an effect of software lumen.

You can switch with the command r.Lumen.HardwareRayTracing in run time

3 Likes