Some Questions About Optimization

Hi Everyone! I’ve recently watched the Unreal Fest 2022 video on YouTube (Maximizing Your Game's Performance in Unreal Engine | Unreal Fest 2022 - YouTube) which was about optimization. Ari did a great job in explaining some very useful features of Unreal Engine which would help in the optimization. I have also checked https://ari.games/ and I was able to find the answer to many of my questions and the solution to many of my problems, however, there are still some parts I have questions about which I was unable to find the answer for.

1: How do I optimize textures and what’s the maximum resolution I can use? My friend has an RTX 2060 and he is running out of video memory even though we used a maximum of 2k textures for the exterior and just PBR materials with no textures for other stuff. I’m assuming that even the 2k textures we used are very performance friendly since the format of the textures is also jpg.

2: Around how many active triangles should be in the camera view or scene and how can I check the triangles rendered in every frame as well?

3: How do I lit a large interior scene in an optimized way? Is it even possible with Lumen?

4: Is it possible to have as many as 5000-10000 objects in one scene without an expensive performance cost (Each with 300 triangles or less and Nanite)?

5: Do collisions on objects that don’t need to have collisions increase the performance cost?

The answer to these questions would be extremely useful to me and I really appreciate the answers.

1 Like

Just a few things to note:

  1. Main characters generally have around 100,000 vertices.
  2. Complex collisions are fairly expensive, so try to create convex ones whenever you can.
  3. You can just disable Lumen and use the default global illumination system if you aren’t relying heavily on dynamic lighting.
  4. I recommend using 1k and 2k textures whenever you can, but you will need to experiment to get the best results.
  5. If you use GPU instancing correctly, then you can have several thousand meshes in a single draw call (you can use foliage instancing, or even the Instanced Static Mesh component)
1 Like

where have you seen that?

1 Like

Ah, I didn’t realize it was optimized for low poly meshes yet. Thank you for that correction.

1 Like

Don’t go optimizing textures blindly. Remember from my presentation, I mention finding the “What” first. Instead of just “generally” optimizing textures, first figure out which textures are taking the most memory and then see why and how to fix it.

Textures in Unreal Engine are usually streamed in and out to keep memory manageable, but there are some cases where textures will not be streamed and will instead just always be in memory, like for uncompressed or non-power-of-two sized textures.

You can use the memreport -log command to see all textures (and more) currently in memory. Start with that.

Depends on your target platform. Are you having issues with too many triangles? I would say put in as many triangles as makes sense and only optimize when you see them taking too much time in the profiler. During the development of the last AAA game I worked on for PS5 we never managed to find out how many triangles were too many because we didn’t hit the limit, it hit the hard disk first (game got too large) before it slowed down the rendering at all. If we would’ve spent time setting vertex limits on everything we would’ve just slowed us down.

This of course will depend on the target hardware that you’re aiming for.

Optimized for what? Consoles? Phones? There’s a huge difference in what your target platform is.

For mobile, you’ll probably want to just use normal static baked lights. They look the best and perform really well but they take up space on the device’s storage as you’ll need to save the lightmaps. Then you’ve optimized for looks but not for storage. Did you mean optimizing for storage? Because then you would definitely not want to use static lights. They are also not dynamic, you won’t be able to move any static objects lit by the lights or the shadow will just stay on the ground in the original location.

Dynamic lights don’t use lightmaps so they don’t take any disk space, but they don’t offer bounce lighting either. So it doesn’t look as good, and it’s a bit slower than static lights. But a good middle way between both.

Lumen is like dynamic lights on steroids, giving you the great looks of static baked lights without baking anything. So it’s light on the storage but very heavy on rendering.

So yeah, different solutions for different requirements. You decide your requirements and then choose a solution to fit it.

Depends on what else is happening in the scene and what your target hardware is. Basically, put it in your scene and check it. But Nanite can definitely help in that case with its auto-instancing and LODding, it shouldn’t be a problem.

A tiny bit, yeah, you should usually turn off collisions for objects that don’t need them. For static objects I would be surprised if you even noticed though. Is it showing up on the profiler for you? Is it a problem yet?


From your questions it seems like you’re doing a lot of “Step 3: How do we fix it?” before “Step 1: Figure out what is slow.”

Remember from my presentation that we should always do these steps in order :muscle:
If it helps you can also print out the frame from the presentation to put on your desk :grinning:

3 Likes

Thank you so much for the response!

I’m going to really keep in mind and even note it down to make sure I’m following the What, why, and how steps :joy:

I’ve followed the steps and went for the what step. I’ve checked the Stat Unit box and realized that it is actually my CPU that is slowed down a lot. My GPU is taking 17ms however my draw is taking ~50ms and my game is taking ~100ms.

I’m trying to really see how I can search for what is slowing down my CPU. I’m not going to guess it so I don’t skip the what steps but I’m guessing 1400 static meshes is a lot in a scene :joy: .

I’m making a supermarket with 35000 objects that are instanced from 1400 Static meshes which if I discover that it is actually this that is slowing down my project. I have to look for a why and then the how.

Thank you so much again. These answers really helped me with my project.