Search Unity

Mesh Combine Studio 2 (Boost Performance)

Discussion in 'Assets and Asset Store' started by eagle555, Oct 24, 2017.

  1. yonson_chappers

    yonson_chappers

    Joined:
    Feb 6, 2017
    Posts:
    19
    We're building a large open world set up with 100s of houses, churches etc. At the moment they're set up with a lod group of Lod 0 as a 3d model, and Lod 1 as an AMPLIFY IMPOSTOR (effectively a billboard). We used this approach as it means only buildings close to the player have significant drawcalls.

    However, the instantiation / destroying of all these game objects is still making it run quite slowly and i believe we could further improve performance with Mesh Combine Studio. I used it a few years ago but never got it to work in a stable manner and we gave up in the end, but could you explain if it would work with Amplify impostors? I'm guessing not - we tried it yesterday, just wanted to see if you had any thoughts about how we could achieve this?
    Thanks
     
  2. Keaneo

    Keaneo

    Joined:
    Mar 7, 2015
    Posts:
    80
    I found the issue - was related to NavMesh needing to read the generated mesh - I turned off "Make Meshes Unreadable" in MCS.
     
  3. HenryChinaski

    HenryChinaski

    Joined:
    Jul 9, 2013
    Posts:
    97
    Hi and thanks for the answer.
    We just combine our static geometry, consisting of thousands of tiles. Thought this would be the perfect use for MCS.

     
  4. deverolirc

    deverolirc

    Joined:
    Jan 19, 2014
    Posts:
    475
    Hi @eagle555

    Lovely asset, just purchased. Reading through the documentation I can't find anything related to mesh/cell render distance, I want distant cells to be completely culled.
    MCS2 seems to ignore the culling I had previously on my LOD groups. I probably missed something obvious.
    I am using "combine at runtime" and pretty much default settings.

    Cheers!
     
  5. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,511
    Hi, you shouldn't add MCS as a child of the prefab you want to combine (this would create many MCS gameobjects). What you can do is already putting MCS prefab in your Scene and use an empty GameObjects as a parent and instantiate your prefab models inside this parent. You can let MCS search inside this GameObject at runtime and combine it. You can give MCS command to combine with:
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using MeshCombineStudio;
    5.  
    6. public class TestCombine : MonoBehaviour
    7. {
    8.     public MeshCombiner meshCombiner;
    9.  
    10.     void Start()
    11.     {
    12.         meshCombiner.CombineAll();  
    13.     }
    14. }
    15.  
    Yep, glad you found the solution.
     
    Last edited: Sep 8, 2019
  6. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,511
    `However, the instantiation / destroying of all these game objects is still making it run quite slowly`

    What you mean with this? You use instantiation/destroying of the houses to stream them?

    As for MCS working with Amplify imposters, I would have to try it out to see if that works.
     
  7. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,511
    Ah ok ye
    Do you use a 32bit mesh that exceeds 65k vertices? MCS currently doesn't support it.
     
  8. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,511
    Thanks for the purchase. You can setup the Lod Group if you first do a test combine in the Unity Editor:
    upload_2019-9-8_18-37-55.png

    It's on the first child of the MeshCombineStudio GameObject. You can adjust the Lod Group (drag from the right to get the culled % in) and then clock the `delete combined' button in MCS Inpsector and then switch back to runtime mode.
     
    deverolirc likes this.
  9. Monil

    Monil

    Joined:
    Apr 24, 2012
    Posts:
    20
    Hi,
    I just bought this plugin and I'm doing some tests: regenerates uv lightmaps gives me an error, I attach an image, I read the documentation quickly, maybe I made a few mistakes.
    Thanks
    Regards
     

    Attached Files:

  10. catfink

    catfink

    Joined:
    May 23, 2015
    Posts:
    135
    I seem to be having issues with reflection probes when using the latest MCS release. Anything that is part of a combined mesh appears to be missing from my reflection probe bake. I assume this is not how it is supposed to be as reflection probes are part of the MCS dialog but when I bake the probe I see all the meshes that are not combined in the reflection and none of the combined meshes in the reflection probe.
     
  11. catfink

    catfink

    Joined:
    May 23, 2015
    Posts:
    135
    Nevermind - worked it out. Mesh combine studio marks all the meshes it combines as not static, so they were missing from the probe bake. Temporarily making them static and then baking fixed the issue.
     
    angrypenguin likes this.
  12. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    898
    I wonder if this step could be made automatic...?

    Seems useful.
     
    angrypenguin likes this.
  13. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    12,327
    Yeah, there should probably be an option for that. I imagine that much of what gets combined is level geometry which isn't going to move anyway.
     
  14. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    308
    Im using 2018.4. And im getting errors on import, for assembly references. Asset is unusable..... anybody able to help?
     
  15. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    12,327
    Not without a copy of the error messages.
     
  16. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    308
    Just reimported.
     

    Attached Files:

  17. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,010
    Is it conflicting with another plugin? You can try it in an empty project to check it.
     
  18. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    308
    I installed cliffs and overhangs and those errors went away. but if I combine anything I get another error, but looking into that one, it was conflicting with a mesh extension script from a RPG character model asset I had (and wasn't even using) I deleted that, and it seems to be working now, so now im playing
     
    hopeful likes this.
  19. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    308
    just randomly tossing a pile of objects down, I noticed that the actual batches tend to go up slightly, while triangles and that drop, setpass call I've seen go up and down slightly. but over all the FPS improve pretty good though. I figured there would be a huge drop in batches though, but maybe its cause they are just small tests, a few hundred models, im just doing a 10k models test atm. but with the original on, the batches tend to be less and has a fair bit of "saved by batching" where with the mesh combiner the saved by batching is 0 and the actual batches just increase slightly, is this normal? I mean the performance defiantly increased using MC2.
     
  20. DaleEidd

    DaleEidd

    Joined:
    Aug 11, 2019
    Posts:
    4
    Hi there!

    I have a few issues and questions. I am using MCS2 with the Caves and Overhangs extension.

    I tried this with Amplify Imposters and it is a little broken. The "Use Max Bounds Factor" no longer works because the imposter is larger than the cells (it cannot find anything anymore, even the smaller meshes). After disabling it, it works correctly only if the "Parent" object's transform is zeroed out; otherwise, position and UVs are wrong.

    The "Remove Tris Below Surface" feature can be improved. If the "Use Max Bounds Factor" is used, this will exclude larger meshes for this feature. It really should include them as removing unused tris is valuable regardless of size.

    Does the "Make Meshes Unreadable" apply to the new meshes or the original meshes or both? I also gave the "Combine in Runtime" feature a go and I got exceptions about the mesh being unreadable even though it had Read/Write enabled on the model:
    Mesh Combine Studio -> Read/Write is disabled on the mesh on GameObject <gameobject-name> and can't be combined. Click the 'Make Meshes Readable' in the MCS Inspector to make it automatically readable in the mesh import settings.​
    There is no "Make Meshes Readable" setting in the MCS inspector and the "Make Meshes Unreadable" has no effect.

    As an improvement, in addition to the search system, it could use components to tag objects of interest? Similar to NavMeshComponents.

    Lastly, can the asset transfer LOD Group parameters over instead of making assumptions? The defaults ruin the workflow completely.

    Thanks!
     
  21. MarioRuiz

    MarioRuiz

    Joined:
    Nov 7, 2009
    Posts:
    157
    Hi, swept the thread for mentions on HDRP compatibility and found none, any info on this? is it compatible? I've used it on standard rendering but as I try HDRP I found the resulting combined meshes are empty. Please some pointers on this.
     
  22. thorgaming_42

    thorgaming_42

    Joined:
    Sep 25, 2015
    Posts:
    4
    Hi I am trying to avoid using too many mcs instances, I want to procedurally generate say 10 bases at the start, separately combine them for use later, There isn't a way to set the output gameobject?

    if i clone the bases in the output gameobject they are all missing their meshes, each time i combineAll() it obviously removes the last base made from the output gameobject. I might just have 1 mcs object for each variation of base but wondered if i am missing something.

    Many Thanks, the asset is in general phenomenal but this side of the api needs work imo.
     
unityunity