The future of automatic LOD generation and actor merging in UE4

Hello!

I have a question for you about what features are planned for UE4 concerning automatic LOD generation, polycount reduction and actor merging in the future? I’m asking because of Simplygon being currently the only solution for that, and an expensive one at that.

If you don’t mind, i’ll elaborate on what we would like to see (mostly based on the needs of our next project) and what we are seeing now:

  1. First is actor merging. We know there is Merge Actors already, but how easy is it to automate using this feature, do you think? How could we use it from code? Will there be any improvements to the feature at all?

  2. UV generation when merging materials. For now the biggest thing that makes Merge Actors pretty much useless is that UVs of each mesh are laid out in a grid. The amount of texture space that wastes is huge. Will this be solved in the near or not so near future?

  3. Big thing we would like to have is merging materials on skeletal meshes. So, if we have a kind of character generator we use where we create a bunch of NPCs out of different combinations of body parts, we would like to bake all their materials in to a single one. Is it possible at all? I’ve tested Simplygon, there were issues with material baking on skeletal meshes, but it is there.

  4. Reduction or remeshing of Static and Skeletal Meshes when generating LODs. This probably speaks of itself. Are there any plans at all to provide Epic’s own solution for this? Yet again, Simplygon does good job there.

  5. HLOD system seems really clunky and awkward to use. All of the setup seems to be manual, as automatically generated clusters often don’t make any sense. Issues with UV generation are there as well. Also, we didn’t have any luck creating HLOD clusters with respect to existing LODs on actors. So cluster in HLOD level 0 used LOD0, but it’s guaranteed that player will see this cluster further away, so different mesh LOD should be used. Be weren’t able to determine how to set this up. But my biggest question here is how should we use HLOD in an open-world game scenario. We can’t rely on automatic generation, and we can’t spend a bunch of time setting it up manually. So, will something be done with HLOD system and when, if so?

  6. Another useful feature would be bone LODs that i’ve seen in Simplygon, so we could decrease the number of bones with distance as well as polycount.

These features ((except maybe HLOD) are what we are interested the most, and which Simplygon does provide. But if there is an option to wait reasonable amount of time, we could do that too.

Thank you in advance. Please feel free to ask additional question or correct me if i’m wrong somewhere.

Alexander

  1. Work on the texture layout is scheduled for 4.14 so work on this should be starting soon, in regards to automating this feature you are basically describing the HLOD system (for groups of meshes?) or just individual meshes?
  2. See above
  3. This is something that has not been scheduled yet, and has not popped up on the radar so thank you for bringing it up! I’ll look into leveraging the material baking process for skeletal meshes as well (but cannot promise anything).
  4. We always strive for having a general solution to enable the whole community to use a specific feature, that said we at the moment are looking into options for generating static mesh LODs but no promises.
  5. The clustering algorithm does indeed need a fair bit of work, this however has not been planned out yet but I’ll make sure we get it on the schedule. The same goes for the material baking, 4.13 included material baking from blueprints which opened up a better path for doing the material baking as well. As a side-note on Paragon the cluster were hand authored, this to allow for optimal packing/grouping of meshes! There is an option called ‘Calculate correct LOD model’ in the settings which will determine the mesh’s LOD level according to the specified screensize, this should tackle your issue with LOD0 being used in the HLOD mesh.
  6. The same as with the skeletal mesh materials applies here, we’ll take a look what we can do, however cannot promise anything in regards to when or how this will be tackled!

Hope to have informed you, and let me know if you have any further questions!

Cheers,

Jurre

Hello Jurre,

Thank you for taking you time to answer!

  1. HLOD is not automatic at all. I mean it tries to be, but what it does makes no sense, to me at least. What i’m talking about is that we wan’t to say automatically merge certain meshes following certain rules. Like, if we have a building made from generic constructor elements, we would want to merge those elements into a single mesh for every side of the building and a roof. So the main difficulty is we can’t afford to do it just in editor, since it would involve artists manually selecting meshes, pressing Merge Actors, setting merge parameters, choosing place to save, repeat. Or, in case of HLOD they would have to manually create clusters and then generate proxies, which will end up in HLOD folder, and then artists will have to move them and their mateials/textures as well to correct folders. And all of this for couple hundred buildings. That is not automatic in any way. And all of that is if we forget that buildings are generated, so they are all in the same actor. We need to organize them from code. That’s what i mean by automation. And all that will be left for an artist is to press a button. Hope it makes sense for you. If something is unclear, ask away!

  2. See above

  3. Got it, thank you!

  4. Got it, thank you!

  5. You use Paragon as an example, and i can understand how hand-authoring clusters there can be effective. But what if we have an open-world city with a bunch of buildings (around 1000-2000, can’t remember for sure). We can’t allow to make clusters by hand. Now if we could create them from code, but then i’m not sure how that would work, since it ties to the map and stuff. And i didn’t know about “Calculate correct LOD model”, good to know it exists now.

  6. Okay, thank you!

Alexander

Hi Alexander,

You should be able to follow the same path as the HLOD system for automating this process, (see MergeStaticMeshComponents for the core functionality), but then according to your own rules. I do understand that hand-authoring a large open world level is a pain and thus is something we need to rethink in regards to the HLOD clustering algorithm in the future.

Cheers,

Jurre

Hi Jurre, do you have the CL for “Calculate correct LOD model” change we can pull to 4.11?

Sorry for taking so much time to answer.

I’ll tell our programmers to take a look at that as you suggested, that sounds interesting.

Thank you very much, you can close this with your answer marked (i would do that but i can’t convert your question into an answer).

Alexander

3071645 should contain what you’re looking for.

Thanks Jurre. In fact would you be able to list a set of important HLOD fixes that we could need for 4.11 (if you could)? Also on Paragon after you HLOD do you get good savings in InitViews processed primitives stats? Currently we have too many prims for culling and are hoping HLOD will help with this.

Not necessarily no, since there more than a handful of edits to the HLOD system/mesh merging path since 4.11.

On the InitViews part I’m not sure, I’ll get something to take a look at your question from a rendering perspective.

There’s potential savings although as HLODs are technically separate actors from their included objects, they are both still processed to some degree. Once HLODs appear they should help in culling other objects behind (or within) them and improve the grouped occlusion query system results allowing more objects to early out of visibility processing.

If you have a particular scene in mind it would be worth testing the performance on a more recent engine version. As Jurre mentioned there’s been a fair amount of minor improvements and fixes that affect HLODs across the pipeline from creation to culling to rendering.

Thanks for the reply. As you can imagine it’s not so trivial for us to test in vanilla engine version. If we get the chance we may look into it.