# RayTracing on/off on shipped game?

**URL:** <https://forums.unrealengine.com/t/raytracing-on-off-on-shipped-game/319933>\
**Category:** Rendering\
**Tags:** sidescroller, Shadows, ray-traced-distance-, Shipping, unreal-engine, Lighting, question\
**Created:** [May 27, 2015, 6:57pm UTC](https://forums.unrealengine.com/t/raytracing-on-off-on-shipped-game/319933 "2015-05-27T18:57:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lostra01](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lostra01](https://forums.unrealengine.com/u/Lostra01)\
**Post date:** [May 27, 2015, 6:57pm UTC](https://forums.unrealengine.com/t/raytracing-on-off-on-shipped-game/319933/1 "2015-05-27T18:57:52Z")

</div>

Hey there!

I’m working on a 3D Sidescroller game, and I tought it would be nice if I could include Distance Field AO and RayTraced shadows in my game. The problem is, that I don’t really wanna cut anyone from the game, just because these high demanding features. Any of you know if it’s possible to turn it off in the shipped game, via console command (options menu)?

Thanks for the help 🙂

---

<div class="post-metadata">

**Author:** ![Tim\_Hobson](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tim\_Hobson](https://forums.unrealengine.com/u/Tim_Hobson)\
**Post date:** [May 27, 2015, 7:55pm UTC](https://forums.unrealengine.com/t/raytracing-on-off-on-shipped-game/319933/2 "2015-05-27T19:55:31Z")

</div>

Hi Lostra,

This shouldn’t be too hard to setup in your menu system to enable/disable console commands that can execute.

For instance, if you wanted to disable distance field shadowing you would use the console command r.DistanceFieldShadowing 0 in a Execute Console Command Node in your blueprint.

For DFAO you would use r.DistanceFieldAO 0 will disable the feature.

There have recently been significant improvements for DFAO to improve performance on mid range machines.

I hope this helps.

---

<div class="post-metadata">

**Author:** ![Lostra01](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lostra01](https://forums.unrealengine.com/u/Lostra01)\
**Post date:** [May 27, 2015, 9:39pm UTC](https://forums.unrealengine.com/t/raytracing-on-off-on-shipped-game/319933/3 "2015-05-27T21:39:38Z")

</div>

Hey Tim,

So it works just like that, and no need to do some magic all around 🙂  
Thank you for your answer, and making it clear. I was hoping for an answer like this 🙂

---

<div class="post-metadata">

**Author:** ![Lostra01](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lostra01](https://forums.unrealengine.com/u/Lostra01)\
**Post date:** [May 27, 2015, 9:42pm UTC](https://forums.unrealengine.com/t/raytracing-on-off-on-shipped-game/319933/4 "2015-05-27T21:42:45Z")

</div>

One more quick question. Does it work runtime, or do I have to restart the game in order to take effect (by a config file loading at the start)?

---

<div class="post-metadata">

**Author:** ![Tim\_Hobson](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tim\_Hobson](https://forums.unrealengine.com/u/Tim_Hobson)\
**Post date:** [May 28, 2015, 1:24pm UTC](https://forums.unrealengine.com/t/raytracing-on-off-on-shipped-game/319933/5 "2015-05-28T13:24:22Z")

</div>

While some console commands require the editor to be restarted before taking effect, the ones like above can be used during runtime.

The can be executed easily in Blueprints for your UI to toggle these settings.

As an example, I packaged a small project with distance fields enabled and a tree in my scene that cast shadows. By setting up a toggle in the level BP to execute the console command for r.DistanceFieldShadowing 0 to turn off and r.DistanceFieldShadowing 1 to enable the shadowing I can do this with a simple key press.

If you’re having trouble with it let me know and I’ll help where I can. 🙂

---

<div class="post-metadata">

**Author:** ![Lostra01](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lostra01](https://forums.unrealengine.com/u/Lostra01)\
**Post date:** [May 28, 2015, 4:19pm UTC](https://forums.unrealengine.com/t/raytracing-on-off-on-shipped-game/319933/6 "2015-05-28T16:19:36Z")

</div>

Awesome! Thank you for the help 🙂

---

<div class="post-metadata">

**Author:** ![BernhardRieder](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BernhardRieder](https://forums.unrealengine.com/u/BernhardRieder)\
**Post date:** [November 5, 2020, 3:24am UTC](https://forums.unrealengine.com/t/raytracing-on-off-on-shipped-game/319933/7 "2020-11-05T03:24:45Z")

</div>

and what’s the full command you need to enter to the execute command field?  
To Turn off all Raytracing?

---

<div class="post-metadata">

**Author:** ![AlexSabbioni](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AlexSabbioni](https://forums.unrealengine.com/u/AlexSabbioni)\
**Post date:** [September 17, 2024, 2:34pm UTC](https://forums.unrealengine.com/t/raytracing-on-off-on-shipped-game/319933/8 "2024-09-17T14:34:24Z")

</div>

I just resume this old post hopefully someone smarter than me can help:  
because I had some performance issue, as i posted in this thread  
I noticed a “only Software tracing shipping build” performance a lot better than a hybrid shipping “HWRT/SWRT build” when it’s running in software tracing like the single option build( I disabled the Hardware raytracing by command line. )  
I think just command line option to disable HWRT is not enough but I don’t know what i missed and documentation is not clear

> [@HW raytracing support enable drop performance even if it's disabled in level](https://forums.unrealengine.com/t/hw-raytracing-support-enable-drop-performance-even-if-its-disabled-in-level/2004957):
>
> Hi Guys I’ve got 2 identical build games: one with hardware raytracing support ON and one without the HW raytracing run at 20FPS : the SW raytracing run at 45/50FPS: the HW raytracing build have an option to disable the hardware raytracing in game by the command line: r.RayTracing.ForceAllRayTracingEffects 0 r.Lumen.HardwareRayTracing 0 so in theory if I disable the HW raytracing in game should have a similar performance of the non HW supported ver…
