Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

[RELEASED] Mesh Combine Studio 2 (Boost Performance)

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

  1. colin_young

    colin_young

    Joined:
    Jun 1, 2017
    Posts:
    243
    Thanks! Good to know. I kind of assumed that might be the case since ECS is still quite experimental.
     
  2. gewl

    gewl

    Joined:
    May 19, 2016
    Posts:
    95
    Hi, I'm getting this as well—did you ever find a solution?
     
  3. JJ-Jabb

    JJ-Jabb

    Joined:
    Feb 6, 2015
    Posts:
    42
    I am looking into the issue this weekend and will get back to you on Discord
     
  4. Disastorm

    Disastorm

    Joined:
    Jun 16, 2013
    Posts:
    132
    Hey have you ever seen something where the runtime mesh conversion using CombineAll(true) works in editor but when i do a build it doesnt find the objects using the "search conditions"?
    I was able to get around this by calling the CombineAll(false) function passing false so it doesn't use them, but now its merging some meshes I don't want such as disabled objects.
    I think the main question is why combining with the search conditions isn't working for me in the build but it does in the editor. Also note this is specifically combining via script using CombineAll(true).

    *edit i got around it by unchecking searching for static objects. Not sure if its a bug or if for some reason my objects are not static in the build but are static in the editor, pretty weird.
     
    Last edited: Jan 4, 2022
  5. JJ-Jabb

    JJ-Jabb

    Joined:
    Feb 6, 2015
    Posts:
    42
    Are you using Unity's static batching? If so then those meshes are read-only at runtime and cannot be combined. Try unchecking the "Unity Settings -> Static Batching" in the MeshCombineStudio Game Object.
     
  6. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,043
    Having some issues with MCS on 2021.2.7

    (MeshCombineStudio) => UnityEngine.UnassignedReferenceException: The variable mr of CachedComponents has not been assigned.
    You probably need to assign the mr variable of the CachedComponents script in the inspector.
    at (wrapper managed-to-native) UnityEngine.Renderer.SetMaterial(UnityEngine.Renderer,UnityEngine.Material)
    at UnityEngine.Renderer.set_sharedMaterial (UnityEngine.Material value) [0x00001] in <ad50157ee00e45cdb3c8bd67012f8804>:0
    at MeshCombineStudio.MeshCombineJobManager+NewMeshObject.CreateMesh () [0x0058e] in E:\src\IbyteProductions\Personal\ULHE\AmitChai\GhostMarket\Assets\MeshCombineStudio\Scripts\Mesh\MeshCombineJobManager.cs:1392

    The combined GameObject gets created but none of the fields are filled in.
     
  7. JJ-Jabb

    JJ-Jabb

    Joined:
    Feb 6, 2015
    Posts:
    42
    It sounds like your MeshCombineStudio GameObject got corrupted - try the following:
    1) Try checking Output Settings -> Use Custom Combine GameObject and make sure it's set to the prefab at MeshCombineStudio/Sources/InstantiatePrefab
    2) If 1 doesn't work, try adding a new MCS GO to the scene and try to combine with that
    Also, are there any other related console errors?
     
  8. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,043
  9. JJ-Jabb

    JJ-Jabb

    Joined:
    Feb 6, 2015
    Posts:
    42
    That's odd, I don't think I've ever seen that happen. Can you try deleting the MeshCombineStudio folder and reimporting?
     
  10. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,043
    Thanks! that did the trick. Re downloaded from the asset store and re-installed
     
    hopeful likes this.
  11. baumxyz

    baumxyz

    Joined:
    Mar 31, 2017
    Posts:
    99
    Hello, is there a way to search the whole scene without having a parent game object that contains everything?
     
  12. JJ-Jabb

    JJ-Jabb

    Joined:
    Feb 6, 2015
    Posts:
    42
    No, there needs to be 1 or more parent game objects that contain the GOs you want to combine
     
  13. RealArt1994

    RealArt1994

    Joined:
    Jul 7, 2019
    Posts:
    5
    hi
    i have some problems with using mesh combine
    i Add LOD to Mesh tree it has just two levels: 1. LOD 0 - 2.Culled


    i wanna make mesh noCall in farDistance but after mesh Combined there is no LOD Component on Combined Mesh!

    i test LOD Group search mode with both mode (LOD group,LOD Renderer)

    can u pls help to fix that?
    its very difficult to set LOD for all Combined mesh by hand
     
  14. JJ-Jabb

    JJ-Jabb

    Joined:
    Feb 6, 2015
    Posts:
    42
    Can you send me a screenshot of the results after combining (both the MCS inspector and the MCS GameObject hierarchy, expanded so I can see the children)

    You might consider posting to the Discord channel (https://discord.gg/HhepjD9) as well, it is easier to discuss support issues there.
     
  15. RealArt1994

    RealArt1994

    Joined:
    Jul 7, 2019
    Posts:
    5
    ok i will send it descord
     
  16. sandro-ixt

    sandro-ixt

    Joined:
    May 2, 2019
    Posts:
    11
    Hey everyone,

    I've updated the plugin to the newest version today and noticed that the MeshCombiner.outputLayer field has been removed. Does anyone know what this has been replaced with? How can I set the output layer with the newest version?
     
  17. JJ-Jabb

    JJ-Jabb

    Joined:
    Feb 6, 2015
    Posts:
    42
    I think you're looking for "Combine Conditions / Change Layer"
    upload_2022-2-21_19-17-8.png

    Let me know if that's not what you're looking for
     
  18. sandro-ixt

    sandro-ixt

    Joined:
    May 2, 2019
    Posts:
    11
    Yes, that seems to be it. Thank you!
     
  19. genie_unity

    genie_unity

    Joined:
    Aug 3, 2018
    Posts:
    2
    better to perform unity static check after mesh combine?
     
  20. Keaneo

    Keaneo

    Joined:
    Mar 7, 2015
    Posts:
    99
    Hi - I use Gaia to scatter rocks over a terrain but when I use MCS to combine the rocks, most are combined (about 133 cells), some are not included (even though "search" highlights them as if they should be). Weirdly, some of the rock LODs have mixed results e.g. with 4 LODs, 0 and 3 have their mesh renderer disabled by MCS, but 1 and 2 are still enabled!

    Everything is static/active/etc. Not sure what to check!

    Thanks!
     
  21. antsonthetree

    antsonthetree

    Joined:
    May 15, 2015
    Posts:
    102
    In my project I create several 5x5 'mesh' chunks out of prefab hex tile models. Then I use many of these chunks to show my terrain. Each chunk is just a GO container for 25 separate hex meshs. Can I use MCS at runtime to combine the hexes in each chunk into a single mesh? I don't want all of the chunks combined together, just the meshes in each individual chunk. Hope that makes sense.

    ALSO - This project is amazing! Even if I can't do the above thing, I have still 3x the fps just by adding MCS to my project and tweaking some settings. Hella good work sir!
     
    hopeful likes this.
  22. JJ-Jabb

    JJ-Jabb

    Joined:
    Feb 6, 2015
    Posts:
    42
    Off the top of my head, one thing you can do is use an MCS object for each chunk, with just that chunk as the parent object.
     
  23. JJ-Jabb

    JJ-Jabb

    Joined:
    Feb 6, 2015
    Posts:
    42
    If you have "exclude single meshes" checked then cells that only have 1 rock won't be included - you might check to see if this is the case.

    I don't know why some of the mesh lods would still be enabled after combining, I will have to look into that. Is there a particular asset from the asset store you are using for your rocks?
     
  24. Keaneo

    Keaneo

    Joined:
    Mar 7, 2015
    Posts:
    99
    I'm using this for the rocks: https://assetstore.unity.com/packages/3d/environments/advanced-rock-pack-2-0-101721

    I unchecked "exclude single meshes" and all rocks are now included (so I don't get them appearing/disappearing as the LOD changes - which is great!). I'm a little confused that, in a cell where this happened, all of the rocks have a LOD0 object e.g. "MeshCombineStudio\LODGroup 3\Cell (-64.0, 192.0, -704.0)\LOD0\M_Atlas_Small_Rocks_01". However, some rocks don't seem to have LOD1 or 2 entries. In play mode, I don't see LODs changing as I approach these rocks - should they still be switching?

    Are there any performance impacts around "exclude single meshes" ("found objects" went from 8006 to 1891).

    Thanks!
     
  25. GamePowerNetwork

    GamePowerNetwork

    Joined:
    Sep 23, 2012
    Posts:
    257
    Hello! How can I add a component to the "Cell" game object at runtime? I see there's a way to add a custom gameobject to the merged mesh container. But I'd like to target the cell gameobject. Is that possible?
     
  26. JJ-Jabb

    JJ-Jabb

    Joined:
    Feb 6, 2015
    Posts:
    42
    You would have to write a monobehaviour to do that, it's not something supported out-of-the-box
     
  27. JJ-Jabb

    JJ-Jabb

    Joined:
    Feb 6, 2015
    Posts:
    42
    You don't really gain anything by including single meshes - if you turn off "exclude single meshes" then you get cells that have the original mesh and that's it - they aren't getting combined with anything, which is why "exclude single" is on by default
     
  28. GamePowerNetwork

    GamePowerNetwork

    Joined:
    Sep 23, 2012
    Posts:
    257
    Thanks! Yup I made monbehaviour for the container prefab which added the class needed to the Cell gameobject! All works well.
     
  29. bsy50642

    bsy50642

    Joined:
    Aug 9, 2021
    Posts:
    9
    Hello, I will post a question before purchasing these Assets.

    When I import the background using the SketchUp Model, the incoming object (mesh) becomes more than 500,000.
    Can you tell me how effectively the frame comes out when you compress these objects?
     
  30. JJ-Jabb

    JJ-Jabb

    Joined:
    Feb 6, 2015
    Posts:
    42
    MCS isn't going to help you here. MCS only helps with merging meshes together and removing geometry in various scenarios (such as under the ground) - it isn't going to reduce your existing polycount.
     
  31. mikew_unity

    mikew_unity

    Unity Technologies

    Joined:
    Sep 27, 2016
    Posts:
    134
    Running into these errors loading MCS into a project.

    It works fine in another empty project but when I load it into my actual game project (copying the files from one to another) it's throwing compile errors for some reason.

    Any ideas? I'm in 2021.3.4f1

    MSCErrors.png
     
  32. JJ-Jabb

    JJ-Jabb

    Joined:
    Feb 6, 2015
    Posts:
    42
    Do you have MCS Caves and Overhangs in your original project but not in your actual game project?

    In the project throwing compile errors, please check in the MCSCaves symbol is defined (Project Settings -> Player -> Script Compilation -> Scripting Define Symbols)

    This symbol is defined when importing the MCS Caves and Overhangs addon - you can either import that addon, or remove the symbol, depending on your needs, and that should clear up the compilation errors.
     
    Last edited: Jun 25, 2022
  33. Hexalted

    Hexalted

    Joined:
    Nov 16, 2017
    Posts:
    20
    Note for users encountering the `Use Custom Combine GameObject` null error: you need to re-import the prefab "InstantiatePrefab".


    MCS2 is not working in runtime in WebGL builds. I have 2 MeshCombiners, and get a log message
    (MeshCombineStudio) => No matching GameObjects with chosen search options are found for combining.
    Works in Editor, works when not runtime. Is it a limitation or am I doing something wrong?
     
  34. JJ-Jabb

    JJ-Jabb

    Joined:
    Feb 6, 2015
    Posts:
    42
    Can you try unchecking "static only" and see if that works?
    Also, do you have static batching enabled? Can you try disabling that if you do?
     
  35. Hexalted

    Hexalted

    Joined:
    Nov 16, 2017
    Posts:
    20
    Thank you very much, unchecking "Only Static" solved the problem!
     
  36. ehww

    ehww

    Joined:
    Jan 30, 2020
    Posts:
    8
    Hello, MCS doesn't support UV Channels 5 through 7, is there a chance that will be added? It only has code for up to channel 4

    I can modify it locally to work... but would be nice to get that in an update. (Unless perhaps I'm not on latest)
     
  37. JJ-Jabb

    JJ-Jabb

    Joined:
    Feb 6, 2015
    Posts:
    42
    Sounds like a good idea! If you have something I can review then I could get that into MCS faster, otherwise I will add it to the backlog
     
  38. BlackBunnyCrankn

    BlackBunnyCrankn

    Joined:
    Mar 21, 2020
    Posts:
    21
    Hi,
    I have some issues with baking lights after the combine studio has combined meshes. I am using basic synthy studio assets. I have followed the documentation/guide using unity 2020.3.37f1. All of my meshes are static, I am using the default universal pipeline lighting settings for my bake.

    Before Combine (baked lights)
    upload_2022-8-8_8-45-41.png


    Baking lights on combined objects
    upload_2022-8-8_8-45-26.png
     
  39. JJ-Jabb

    JJ-Jabb

    Joined:
    Feb 6, 2015
    Posts:
    42
    are you regenerating the UVs (after combining) and then rebaking the lighting?
     
  40. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    502
    @eagle555 Hello Nathaniel, I have a quick question about the single material shadow caster; How does this work, is it a single combined mesh used as a shadowcaster? The reason I ask is because with a very lare mesh this could have implications? Appreciate your feedback!
     
  41. JJ-Jabb

    JJ-Jabb

    Joined:
    Feb 6, 2015
    Posts:
    42
    You can use a single combined mesh as a shadow caster - the documentation for that is at http://www.terraincomposer.com/mcs-documentation/#combine-conditions, under the "Combinging all meshes separately into 1 material for shadows" section.

    If you are concerned about mesh sizes then you might try reducing the cell size.

    Also, it might be easier/faster to ask your questions on the discord MCS support channel (https://discord.com/channels/417946215615823872/736854252206686219)
     
    olavrv likes this.
  42. lzardo2012

    lzardo2012

    Joined:
    Apr 11, 2013
    Posts:
    80
    Hi, I just noticed I´m losing all lightmaps on my scenes...

    Also, the Option in "Output Settings", Prepare Lightmap Rebake does not appear in the options in the prefab on the scene...

    (it does show up when I look at the provided prefab in the meshcombine folder)

    Untitled-1.png
     
  43. Stormer2020

    Stormer2020

    Joined:
    Sep 14, 2020
    Posts:
    89
    Hi~ Thank you for the amazing plugin!
    I have a question, help please~

    How add search parent list at runtime?
    Because the gameobjects not exist yet, I want add them to the search parent list at runtime.

    WeChat Image_20230228194025.png
     
  44. AnotherMoon

    AnotherMoon

    Joined:
    Apr 8, 2022
    Posts:
    4
    Same here. I have the option disabled and the same error appears. I can't even assign anything to the gameobject. This renders this plugin completely unusable at this moment.
    I'm using version 2.997 and Unity 2021.3.15f1
     
  45. JJ-Jabb

    JJ-Jabb

    Joined:
    Feb 6, 2015
    Posts:
    42
    Sounds like the reference to the instantiate prefab was lost - I've seen this happen on occasion - try enabling it and setting it to "MeshCombineStudio/Sources/InstantiatePrefab"

    If that doesn't work, you may need to reimport MCS2
     
  46. lzardo2012

    lzardo2012

    Joined:
    Apr 11, 2013
    Posts:
    80
    Hello, I'm having a problem in my android build

    In the editor it's working perfectly, but in the device it says it cannot combine the objects?

    No Matching GameObjects with chosen search objects are found for combining.

    meshcombinerstudio.meshscombiner: addfoundobjectstoctree()

    It only happens in the device
     
    Last edited: Jun 19, 2023
  47. Please_help_me007

    Please_help_me007

    Joined:
    May 22, 2021
    Posts:
    5
    hi, did you tried mesh baker assets. what is the difference
     
  48. Please_help_me007

    Please_help_me007

    Joined:
    May 22, 2021
    Posts:
    5
    hi, did you tried mesh baker assets. what is the difference?.