Download

UE4 Rendering FAQ - Performance

Mar 30, 2021

If our modular pieces have LODs, is using Hierarchical Instanced Static Meshes the preferred instancing method?

  • UE can dynamically batch render instances. This is not perfect batching and HISM/ISM can result in improved performance depending on conditions. You will need to test which is best for your game.**

What are the advantages/disadvantages of using Hierarchical Instanced Static Meshes over non-hierarchical?

  • HISM creates clusters of instances. Culling, occlusion, and ‘lodding’ is done on a per cluster basis for HISM but is done on the Actor for ISM.**

Is the foliage system based on HISM, and is using the foliage system the only way to take advantage of HISM?

  • The foliage system is using HISM. You can aggregate instances in HISM manually or through the ‘Merge Actors’ tool in the editor. HISMs are just components as well, so you could also build your own systems on top of HISM.**

Is the new custom per-instance data for Instance Static Meshes in 4.25 also supported in HISM?

  • Yes, it is supported on HISM.**

Do we cover all of our rendering components with our thread safety guarantees?

  • Some of our components, including rendering, still have their state created on the game thread, so thread safety isn’t guaranteed, and would need to be worked on for these components. There may be some bugs in the implementation, but currently (as of 4.25) only 1 rendering component is entirely created on the rendering thread.**

Do we remove render components from the render queue when we can determine that a render proxy is not needed for that component?

  • Probably not, since we still have to process the task generated by queuing the component between threads, so that could introduce some thread safety issues**

For mesh decals or deferred decals, is it fine to use baked or dynamic lighting? Anything to watch out for?

  • For baked lighting, you need to use DBuffer decals, as they get rendered before the base pass (in the prepass). For dynamic lighting, either can be used.**
  • We’re investigating deprecating the deferred decals so we only have one pass**

How does UE4 best support high quality LOD0 for platforms of different power levels?

  • We only support different MinLOD for different platforms**
  • Scalability changes the transition distances, but not the LODs themselves**

Do we stream in textures out of the box?

  • Texture streaming should be enabled by default for textures that are not in the UI category, anything with mips**
  • If you spend a lot of time in the streamer, you may be able to save 0.5-1 milliseconds by loading all mips ahead of time**

For next-gen platforms, how does tessellation behave?

  • Probably just as bad as it is on current PCs, shouldn’t be worse but probably not better. We actively try not to work with it due to the heavy maintenance required to keep it up to date over time, especially when compared with the long term of potential of Nanite in UE5.**

In general what are the best practices for setting up the material architecture for our game?

  • Best practices will be hard to come up with here as it’s so very content dependent.**
  • In general, you have to strike the right balance of features and flexibility without going overboard on instances. You’ll probably have master materials for each primary item type. Ideally customization would be through parameters like scalars, vectors, etc.**
  • Avoid static switches when you can. Best to be mindful of creating permutations, lots of switches + usage flags creates many permutations. Usage flags being the killer, ie: having the same material usable on static meshes and skeletal should be avoided. This overflows very quickly if not managed.**
  • Our work on the Material Layering system might help. You can make instances of layers and not cause a recompile/permutation if you swap in the same layer type.**

Why was the texel density view removed from UE4?

  • This was removed as part of the purge when moving from UE3 to UE4 because it was burdened by too many legacy assumptions. It’s not likely that this feature will be added in the future.**

Shadows are our biggest performance issue, since we cannot use lightmaps. Is there a way to optimize shadows for “static” objects at runtime?

We have many interiors that would benefit from pre-computed object visibility. Is there a way to group objects for optimized culling at runtime?

Is there a work around for the hard limit on reflection captures?

  • There’s no existing workaround for reflection capture limits, but you could change the code.**

What are your recommendations for an inexpensive depth of field for background objects?

  • The current depth of field has a good quality for cost tradeoff. You could in theory bring back the now mobile-only Gaussian DOF but sometimes it’s not actually faster. There’s also a ‘depth blur’ that simulates atmospheric blur embedded in the DOF that’s fairly cheap that runs even when things aren’t ‘out of focus’. You could try ramping that up.**
  • r.DepthOfField.DepthBlur.Amount**
  • r.DepthOfField.DepthBlur.Scale**
  • r.DepthOfField.DepthBlur.ResolutionScale**

What are good setups for various levels of pre-baking?

  • I think there’s some good answers in this video class of ours: Lighting with Unreal Engine Masterclass | Unreal Dev Day Montreal 2017 | Unreal Engine - YouTube
  • Baking everything will be fastest. There are some good trade offs like stationary lights where you can change parameters of the light but not the position. Ray tracing would even be an option for next gen consoles, and we have support for that. LPV specifically is not a great solution because we never got it to a production ready state. Global Illumination that is performant is still an open challenge, but we do have a team exploring new options, and with the new features of the next generation of consoles, maybe it’ll be a bit more realistic of an option.**

LightBaking: How would we bake small parts of a large world and have it blend with other baked (or unbaked) areas?

  • We don’t currently support baking selected actors only, but even if implemented, there would likely still be problems with blending. The best option at the moment would be always baking volumetric lightmaps and baking some surface lightmaps on some objects, letting the unbaked use the volumetric lightmap.**

SDF-AO vs baked worlds?

  • At the moment there’s no way to mix baked skylight occlusion (bent normal) with the one coming from the DFAO. We use one or the other based on skylight mobility. There are no fundamental limitations though and you can mix those two by modifying the engine.**

Localized ambient (“tent in a desert”-scenario)

  • If the tent is not movable and you can bake it into volumetric lightmaps or lightmaps then it could use bent normal. If it is movable, then it can use SSAO or DFAO**

Decals with normal-falloff?

  • Decals use material graphs just like surface materials. Decals are capable of reading normals from the GBuffer and outputting properties based on that. Decals can also modify normals in the GBuffer.**

Cascade shadows take a massive hit in quality once kicking them down from Epic to Medium scalability, are there any settings to slightly improve Medium?

  • The biggest difference between the high and medium scalability setting for shadows is that the number of cascades goes from 3 to 1. To improve visual quality, you may change the corresponding ini settings, of course being aware that this will come at a cost. This is configured for the engine in /Engine/Config/BaseScalability.ini. To override this on a per-project basis you can modify/create [ProjectDirectory]\Config\DefaultScalability.ini**
  • To similarly override for a platform add [ProjectDirectory]/Config/[Platform]/[Platform]Scalability.ini**
  • See Configuration Files | Unreal Engine Documentation for ini file override rules.**

What are the recommended anti-aliasing methods?

  • TAA is the expected anti-aliasing method for all UE4 rendering.**

Is there any way around detail loss from TAA?

  • Inherent fundamental techniques of TAA can’t be avoided, but can be mitigated with higher detail content. TAA will eat subpixel features and is sensitive to very high contrast.**

Temporal AA is OK, but causes all kinds of weird ghosting and generally makes the screen look muddy. From your experience, have you found any tweaks to Temporal AA or using one of the others like MSAA that work better?

  • r.TemporalAA.HistoryScreenPercentage 200**
  • The ghosting is likely happening when the input noise to TAA is too high. The command “vis SceneColor UV0” will show that.**
  • r.TemporalAA.HistoryScreenPercentage is expensive, but a technology that relies on Nyquist theorem to keep the sharpness of the detail as the frame gets reprojected in TAA. We’ve used that in many of our demos since The Reflection demo. This allows for instance to keep all the details of the skin as the character is constantly moving.**
1 Like