Search Unity

Question Performance impacts of multiple meshes?

Discussion in 'General Graphics' started by SoranoKiseki4280, Oct 20, 2020.

  1. SoranoKiseki4280

    SoranoKiseki4280

    Joined:
    Oct 6, 2020
    Posts:
    1
    Currently, I am trying to model a spaceship in Blender, my strategy for which is building it with multiple different objects and moving them to be adjacent to each other, where their meshes are not actually connected. This makes the modelling process a lot easier and flexible imo. Although I do realize that this may create performance issues. In which case what can I do? I see three options,
    1. To the best of my ability, combine most of them into one mesh via boolean operations. This seems problematic as it would create god knows how much work to fix the resulting mess. (remove ngons and etc) And it does not seem to be sustainable in the long term.
    2. Blender allows me to join two objects and make them into one object, although they are still disconnected meshes, I am uncertain as to whether that is any different than having them in two different objects?
    3. Maybe I could leave it as is, and fix the unnecessarily disconnected ones, how much impact on performance would there actually be?
    Thanks in advance!
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    A single joined mesh vs multiple meshes is actually different. As for which is better than the other depends on a lot of factors.

    If the model is multiple meshes, it means the CPU has to handle each as a separate object, which is more expensive in the general case, but also means it can cull parts that aren’t visible when occluded (if you’re using occlusion) or outside of the view frustum. For extremely large and detailed meshes this can be a benefit, like if you were to build an entire building with multiple floors and rooms it’s probably better off as many separate meshes.

    For rendering, on both on the CPU and GPU, if all the parts are using a single material then merging them is generally faster. If each part has a unique material, then as far as the GPU and CPU rendering thread is concerned there’s no different between the two methods.

    Boolean ops can be beneficial too, if the number of vertices you’re removing from the mesh is greater than the number being added. Often it’s better to leave the intersections and manually delete hidden triangles. But ultimately it’s about vertex count... and the platform you’re targeting.
     
    brainwipe likes this.