How do games handle enabling-disabling RTX setting from the Menu? So the ideal flow could be to detect at the beginning/first run if the user has RTX capable (IsRayTracingEnabled() function does this and checks almost everything which can enable RTX). Now despite the machine supporting RTX, there’s a possibility that the user may still choose NOT to use it. In that case, if it’s disabled via the menu, then the game needs to be restarted, but am not sure what all flags to be modified after restarting so that RTX is OFF. Also, if user decides to turn it on, am assuming those same set of flags can be enabled?
Extending to this, if user system doesn’t support RTX, then how do you take the non-RTX path for the game using C++?
i’m pretty sure you just need to toggle “r.Raytracing.Enable” Cvar. Before UE 5.5 you had to restart the game for it to take effect, starting with 5.5 “r.RayTracing.EnableOnDemand” Cvar is now enabled by default so you should be able to toggle “r.Raytracing.Enable” at runtime without restarting.
Docs still say it’s experimental to “Toggle Ray Tracing at Runtime”, but it’s enabled by default now (5.5+) so i think they just didn’t update the doc page.