I am creating a large cube of many (hopefully >500,000) somewhat complex meshes (100 vertices). It performs decently well when there are fewer than 100,000 meshes, but it lags heavily when creating more. After looking at the profiler it seems to be mainly the Render Opaque Pass. I've checked each material and none of them have any transparency, and I've disabled the fancy environment settings (such as fog).

Here is a screenshot of my Visual Profiler when trying 1,000,000 meshes:

I saw in another post that "multimesh is NOT for immovable objects. it should only be used for particles and things like swarms" And I am using it for my immovable objects which could be the cause of the performance issues. If that is the case, there should be a disclaimer on the relevant doc page

Thank you for any help!

  • xyz replied to this.

    xyz In that picture I am using 4 multimesh nodes, each with 132k instances (so I guess not 1,000,000 meshes as I estimated, but closer to 500,000)

    • xyz replied to this.

      Michaels-Housekey Use more nodes so you can benefit from frustum culling as culling is done per node. If only a small number of instances is shown on screen at a time the renderer will still need to much them all if they are under the same node. So it's important to cleverly divide instances into nodes. Not too many nodes, but not too few either.

      Also, depending on how/what you actually show on screen think about implementing a custom space partitioning and visibility system.

        xyz Ok, thank you. I wasn't sure if having more nodes to avoid excess mesh rendering would help with this specific issue, I will do that then. What do you mean by a "custom space partitioning and visibility system"? Do you mean implementing custom logic where elements aren't rendered if they are not seen by the player?

        • xyz replied to this.

          Michaels-Housekey You can manually disable visibility on various criteria. It really depends on your use case. There's also built in distance lod/visibility system that can be useful if meshes are complex. This too operates per node so splitting stuff into more nodes is something you should do anyway.

          Bruteforcing big maps is not a wise idea. If you have a lot of stuff on a level and not all of it is immediately visible, consider splitting it into chunks (aka space partitioning), and displaying only relevant chunks.