Download

How to enable ray tracing in packaged game?

I’m using the latest preview 6 of 4.22 and I’m able to get ray tracing in the editor and when I play in viewport. However when I play as standalone or when I package the project and run it ray tracing gets disabled. After extensive searching I cannot find an answer to this. Is there a setting somewhere I need to turn on for it to work?

You need to use the command line argument -dx12

If you’re launching a Standalone Game from the Editor, go to the Editor Preferences > Level Editor > Play and under Play in Standalone Game, put -dx12 in the Additional Launch Parameters text box.

Then when you launch Standalone game, it should launch in DX12 mode with Ray Tracing working properly.

What’s the story with a packaged game?
I packaged a test level but results with it are not the same at all if I comparre with what I get in PIE.
What I did :

  • In project settings, select “DirectX 12” in Platforms/Windows/Targeted RHIs
  • Once my game packaged, I created a shortcut from .exe and add “-dx12” at the end of the target line.
  • Launch the app with this shortcut (same way as editor)

I guess, this is not the right worklflow…

Here is what I get : on the left, this is a Play in Editor. The weird image on the right is the packaged version for windows 64.

Also having issues with this - how to package with ray tracing enabled? The shadows are reverting to non-raytraced after building the project.

edit: seems everyone in this thread is having the same issue, Unreal Engine 4.22 Preview - Unreal Engine Forums