How to set DefaultGraphicsRHI

I’m working on raytracing setting with DirectX Edition. It seems that After I set Project Setting → Platforms - Windows → Target RHIs → “DirectX 11&12(SM5) = Yes” and “Default RHI = Default”, it will launch with DX11 as Default always. So I want know if there is a way to launch DX12 as Default if the device environment support? and run DX11 as Default if not support?

1 Like

Is there someone know better UE4 raytracing strategy? For now I could only enable DX11 for the first time and let player select to enable DX12 then restart game to enable raytracing, that is a little inconvenient.

Finally I fixed it out. I read source code in DynamicRHI.cpp, found that there is a “bPreferD3D12” to check if D3D12 was supported and then would be loaded else D3D11 would be loaded. So I just need add content"[D3DRHIPreference] bUseD3D12InGame=True" in “GGameUserSettingsIni” file (YourProjectDir/Config/DefaultGameUserSettings.ini), and keep RHI setting as same as my first image. Attention, that only works when you launch game in package or standalone mode.




image

2 Likes