RayTracing on/off on shipped game?

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 :slight_smile:

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.

Hey Tim,

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

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)?

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. :slight_smile:

Awesome! Thank you for the help :slight_smile:

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

1 Like