DirectX12 kills performance


I have this issue with my scene, where when I enable DirectX12 (With DirectX11&12 SM5 option also enabled) my fps goes from 50-60 to 1-3FPS, and I also get an error about exceeded video memory as you can see on the image bellow

From what I read on the internet people say its the Raytracing however my raytracing is turned off. Any advice is appreciated

Ryzen 5 3600 OC 4.2Ghz 6 cores 12 threads
16GB Ram DDR4
SSD Samsung 860 EVO

It also enables nanite, since nanite requires DX12 to function. I want to say VSMs are also DX12 exclusive, but I don’t remember for sure. Combine that with Lumen (can run on DX11 or 12), and you’ll tank your performance if your scene isn’t set up around them being on.

1 Like

Something is going on with your shadows, try turning off virtual shadow maps or VSM. It shouldn’t cause that big of a performance impact, but it is more expensive.

1 Like

Hey there @benjaminko18! Wow I definitely see you have a ton of weight on shadow depths. I have tons of questions. I don’t think it’s quite DX12 alone unless there’s an issue with the DX12 installation, most of the time the combination of the new VSMs, Lumen, Nanite, and lots of foliage that casts shadows I tend to see this often enough. That said I don’t think I’ve ever seen it max out at 875 for shadow-depths alone.

So I’m gonna ask a battery of questions and we might be able to find a possible mitigating factor.

  • Is your primary lighting Movable? (doesn’t matter much since VSMs don’t bake the traditional way but I still ask)
  • Are your shadows for your foliage just contact shadows or are they full dynamic, static, and contact as fallback?
  • Do you have incredibly aggressive LOD’s for the foliage?
  • Your graphics card has 4gbs of Vram right?
  • Could we get a feel for the scene? If it’s all trees and ground foliage casting complex VSM shadows it’s going to be really messy.
1 Like

Hello, thank you for your reply

  • Yes my primary light is movable
  • My small foliage has only contact shadows, the only thing that has fully dynamic shadows are the trees
  • No, I forced my Foliage so that it doesn’t use any LOD’s apart from the second worst one and the worst one
  • Yes, my GPU has 4GB of VRAM
  • The whole scene looks pretty much like what you can see on this image, only trees should be casting shadows, and every object has a cull distance so that it doesn’t render the whole scene all the time

I tried disabling VSM, while it did give a small performance boost of about 3-5 FPS it still runs really slow. I am using Lumen, however I have been using it with DirectX11 and it was running at around 40FPS so no idea why the sudden drop. I am using Nanite on some of my meshes, but that should improve my performance right?

Oh, well I managed to find the problem.

So for my trees Im using some free tree model, however I replaced it’s leaf texture with the Megascan Black Alder leafs, which happens to be an 8k texture… So I forced the textures to 1k, haven’t really noticed a visual difference but now when I turn on DirectX12, the performance drop is at reasonable values now.

Thank you everyone for the replies, turning off VSM also helped with the performance a bit.

Dpending on your rig, 40fps in the viewport is probably entierly unacceptable.

Despite this engine completely sucking and not being used by any professional interested in performance, you should at the very least be able to get to 60fps in pie - particulalry since it isnt full screen.

You must have some other setting or underlying issue thats the cause for reduced pefromance (Or you are running on a 1060/silimar).

Try the basic steps for checking the scene.

Number of tris, number of drawcalls, number of lights, etc.
One of the most common issues is having grass cast shadows - it just shouldn’t.

Also, it may help you to bench peformance of a scene without any geometry but all the same light/settings (duplicate level, delete objects manually).
From then you usually add things back to see where you get.

Biggest expected hits are:

  1. landscape.
  2. fog.
  3. vegetation with improperly set alpha.
  4. displacing water shaders.
  5. lots of unmerged skeletal meshes.

Solving them:

  1. don’t use landscapes. Convert them to a mesh in a new level (keep the old for editing).
  2. alter fog settings based on performance, not looks.
  3. fix the alpha sheets/models to reduce the overlaps of transparency.
  4. simplify the water function.
  5. merge / cull / use lods for the meshes.


Sorry for the late reply but I’ve not been home for a bit.

I tested what you recommended me to try, and the issue seems to be with Lumen. With Lumen I get around 40FPS in the viewport, and 25 in Standalone Game. As soon as I turn off Lumen however I am getting constant 60+FPS in the viewport and in the Standalone Game too.

These are the stat GPU without Lumen

And these are with Lumen

The shadow depths get much higher with Lumen on, without me turning on shadows for any additional objects, and right after that are LumenScreenProbeGather and LumenSceneLighting, not sure if I can reduce those two numbers in any way since I don’t know what they mean and Google doesn’t seem to have an answer

I would hold off on lumen until its actually production ready before literally wasting time to make it work.
Sure, it may be several years before its ready.

That’s kind of my point.

Unless you specifically need some feature, just stay away from everything that epic advertises. Its usually underperforming trash, or just downright broken.

The things that work, in fact, are usually not epic’s… Like Loushang GPU Light Mass for instance. And once epic takes over they get worse, don’t they?

Anyway. 60fps without lumen.
Are you frame locked? - do you need to be?
If not, remove the limits and remove fps smoothing settings and all the other garbage.

Baseline with as littles as possible, even tear off the default post process and the eye adjustment. In an ideal world, you should have 60fps steady at 4k in a final publish (In pie that should easily mean above 80fps).

Except yea, you will likely need to pay some good people to optimize a custom source build to get that kind of performance…
If its even possible using ue5.
Rememeber, the graphics pipeline was altered to make lumen possible and to work with the BS they dubbed Nanite, so there is a reasonable expectation that decent performance just isnt and won’t be possible.
Particularly not when the epic developers respond to “low fps” (or performance in case of chaos too) reports with “scale down to 1080p, its fine”, or “well then just don’t have 1000 cubes all simulate”…

The best thing to check what ue5 is doing performance wise is to test the same (or similar) scene in a different engine.
Same tris, same drawcall count, same number of lights, etc.
My personal experience:
When ue4.27 gives you 60fps at 4k CryEngine gives you 120fps.
Ergo, don’t use Ue4.

If you insist you may be able to properly optimize ue5 to have a somwhat ok performance.

It’s just way easier to adjust your expectations to 30fps “if even”. I think we all agree with that :wink:.

1 Like