Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[RELEASED] Mesh Combine Studio 2 (Boost Performance)

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

  1. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,674
    Thanks for reporting this. I will take a look now and try to fix this issue asap
     
  2. CliffCawley

    CliffCawley

    Joined:
    Mar 30, 2009
    Posts:
    19
    Sweet, I'm happy to hear that and can't wait for the fix!
     
  3. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,674
    So basically the issue was missing tangents on one mesh, and MCS put black values there instead of default 1, like reported before. I forgot to implement this fix. I will fix it and make MCS automatically refresh it's mesh cache when changing import settings on a mesh and put a log warning if one of the meshes is missing e.g. tangents or vertex colors compared to the rest.
     
  4. CliffCawley

    CliffCawley

    Joined:
    Mar 30, 2009
    Posts:
    19
    Thanks for the fantastic support @eagle555 ! Amazing asset, keep up the great work!
     
    eagle555 likes this.
  5. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    272
    Hi @eagle555 - Thnks 4 the update too. :p

    Is this already implemented in this update?

    I also read this in the MCS Ratings. Has this ever been addressed or is it a User Error?
     
  6. anpd03

    anpd03

    Joined:
    Aug 7, 2013
    Posts:
    57
    Any plans to improve runtime adding and removal of objects to the combined mesh? Would like to test it as an alternative for trees and compare to gpu instancing.
     
  7. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,674
    Geometry removal without colliders is not in the update yet. As for runtime giving different search results. It always worked on my side and I need to know how to reproduce it. The message just means that MCS didn't find anything to combine according to the search rules selected.

    Unlike rocks, mesh combining is not good for trees like SpeedTrees, GPU instancing is the way to go. Unless the trees are lower poly meshes that are static (no wind).

    Re-combining in runtime is very useful for editors where players can build their own levels out of modular objects. It's something that is on the roadmap to be able to add and remove from a cell and re-combine at runtime only the cells that changed.
     
    hopeful and Weblox like this.
  8. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,835
    @eagle555 I imported the new version and I get the following error on Unity 2017.1.5f1:

    Assets/MeshCombineStudio/Editor/MeshCombinerEditor.cs(846,78): error CS0117: `UnityEditor.EditorGUILayout' does not contain a definition for `EnumFlagsField'
     
  9. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,674
    Code (CSharp):
    1.  outputLayer.intValue = EditorGUILayout.LayerField(new GUIContent("Layer", "The combined GameObjects will be on this layer."), outputLayer.intValue);
    2.             #if UNITY_5 || UNITY_2017_1 || UNITY_2017_2
    3.             outputStatic.intValue = (int)(StaticEditorFlags)(EditorGUILayout.EnumMaskField(new GUIContent("Static", "The combined GameObjects will have these static settings."), (StaticEditorFlags)outputStatic.intValue));
    4.             #else
    5.             outputStatic.intValue = (int)(StaticEditorFlags)(EditorGUILayout.EnumFlagsField(new GUIContent("Static", "The combined GameObjects will have these static settings."), (StaticEditorFlags)outputStatic.intValue));
    6.             #endif
    Change:
    #if UNITY_5
    To:
    #if UNITY_5 || UNITY_2017_1 || UNITY_2017_2

    Seems that Unity changed it since +U2017.3

    I will have it fixed in the update, but currently I'm in the middle of it.

    Nathaniel
     
  10. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,835
    Thanks. That worked.
     
  11. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,835
    Are we supposed to turn off Unity's Static and Dynamic Batching?
     
  12. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,674
    If you with MCS combine in runtime static objects that are marked with `Batching Static` and Unity's static batching is enabled, it will combine those before MCS can do and it will go wrong. So in that case you need to turn it off or disable the Batch Static flag on those GameObjects. Dynamic Batching can be turned on.
     
  13. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,835
    I can't get any kind of decent performance from this. I tried out on the Cathedral scene from 3DForge Village Interiors and my frame rate drops to about 12-18 fps from 25-35 fps. My platform is the Wii U so I'm trying to get steady 30 fps , but this actually made it worse.
     
    Weblox likes this.
  14. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,674
    I think it's a matter of setup, I DM'ed you a message to look into this together.
     
  15. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,179
    I think your site is down -- not getting to the documentation page. Was looking into using this for a project but needed a refresher.

    Do you have any videos showing how to set this asset up properly?
     
  16. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,674
    The site and documentation link works on my side. Does anybody else has this issue?

    I don't have any tutorial videos yet, but I'm working on a major update (overlapping geometry removal on e.g. rocks to be able to make performant caves and overhangs) and once I finish that I will make tutorial videos.
     
    Weblox and awesomedata like this.
  17. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,674
    Hey Everyone,

    I'm making good progress with the new MCS update which will have a free extension called `MCS Caves & Overhangs`, basically has the feature to remove overlapping geometry to optimize rocks to the max. There's other use cases for it but this is the most obvious one I can think of.

    I opened a new thread for it here and made a video showcasing it
    https://forum.unity.com/threads/mcs-caves-overhangs-will-release-soon.659845/

    MCS Caves & Overhangs4.JPG
     
  18. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,674
    Hey Everyone,

    I submitted a new MCS 1.4 update to the Asset Store:

    Improvements:
    • Displays amount of materials found
    • Displays combine time
    • Destroying MCS GameObject will restore original meshes
    • Added progress bar for combining per frame mode
    • Cells pivot are at cell center instead of Scene origin
    • Automatically unpack MCS prefab in +U2018.3 to make inspector more responsive.
    Fixes:
    • Hang on combine jobs
    • Loosing reference to original objects when Unity re-serializes
    • Loosing combine specs when Unity re-serializes
    • First click "Search Button", then make a change on the original objects and then click "Combine" button wouldn't include the change.
    • A LODGroup was added to cells with only 1 lod level.
    • Fixed Combine ready event being called multiple times if combined mesh exceeded 65k verts
    • Canceling combining in per frame mode didn't work correctly.
    • Multi-threaded combining per frame sometimes didn't execute.
    • LOD objects sometimes didn't get combined because their individual bounds were taken into account which could lead to being in another cell.
    Also the free extension MCS Caves & Overhangs is ready and works now with LODs, and will submit that as well.
     
  19. rattlesnake

    rattlesnake

    Joined:
    Jul 18, 2013
    Posts:
    138
    Hello eagle555 !

    Is it possible to "un-combine" an object by name ?

    For instance if I would like to animate a 3D object wich is combined.
    Is the API allow to find a combined sub-object by name and "un-combined it" ?

    Thanks
     
  20. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,674
    Hi,

    What MCS does is uncombine all submeshes and recombine everything that has the same material. Otherwise they will be separate GameObjects. So yes you can use MCS to uncombine a submesh by putting another material (in the Mesh Renderer component) on it then the rest of the sub meshes (which is most likely already the case, as submeshes are meant for different materials).
     
  21. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,674
    Hey Everyone,

    Yesterday I submitted MCS Caves & Overhangs to the Asset Store. Also I submitted new version of MCS which I decided to name version 2, because I think the overlap removal feature is a major feature that as far as I know hasn't been done before. And it makes things possible that were not easily possible before.

    MeshCombineStudio 2

    Features:
    • Remove overlapping geometry (in form of free extension)
    • Automatically disables original colliders if "Add MeshColliders" option in enabled.

    Also I will add more major features next week:
    * Splitting a mesh into cells, if you have e.g. like one big 32 bit mesh. So instead of cell combining based on objects position it will just add all triangles of the same materials to it's proper cell, this can lead to better culling. We need this feature for our pre-made arena buildings and terrain which are currently one mesh.
    * Optimizing the shadows with being able to combine different materials into 1 mesh with the above mesh splitting feature, as shadow casting only needs 1 shader.
    * Leaving original meshes on shadow cast only in the case of point light and spot light shadows. As mesh combining is good for normal drawing and directional light shadows, but it's not good for point/spot light shadows, which can lead to an explosion in vert / triangle count to draw (because the bigger meshes are not good for point/spot light shadow culling). This is probably the major reason why some report performance drops instead of increasing after combining. I will also go in depth in the documentation about this. With real-time point/spot lights in forward rendering it has the same issue and this cannot be solved with combining. So either all lights would need to be baked or switching to deferred rendering would be needed.
    * Improve the GUI a bit.

    After that I will start make tutorial videos and update the documentation to go more in detail where combining is good and gotchas to take into account.

    P.s. our artist made a new cave arena, think it looks stunning. I exchanged the screenshots on the MCS Caves & Overhangs thread:

    MCS Caves1.jpg

    Nathaniel
     
    Last edited: Apr 18, 2019
    twitchfactor, Weblox, faduci and 3 others like this.
  22. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,048
    Awesome, thanks for the update. Glad to see you are back. : D
     
  23. rattlesnake

    rattlesnake

    Joined:
    Jul 18, 2013
    Posts:
    138
    Thanks !
    I tried to change the material at the Run Time but it didn't uncombine the object.
    Maybe there is a function to launch in order to update ?

    Seb
     
  24. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,674
    You need to do it in the Editor. MCS creates new GameObjects with meshes that are children of the MCS prefab. So can use these as replacement.
     
  25. rattlesnake

    rattlesnake

    Joined:
    Jul 18, 2013
    Posts:
    138
    Thanks for your answer !
    I tried the following steps :

    1 => Config :


    2 => Play the scene

    3=> Select in the viewport the object I want to unCombine (which is indeed a child of MeshCombineStudio/LODGroup 1/Cell (0,0, 0,0, 0,0))

    4 => Apply a new material to its MeshRender component.

    5=> The material changes but the object is still combined.

    Thanks for your help.

    Subsidiary question :
    Are instances well handled by MCS ?

    Seb
     
  26. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,674
    Do it like this in Unity Editor (not Play the Scene):

    Can see the buildings has 3 sub-meshes.
    upload_2019-4-20_6-53-6.png

    Use these settings. Disable where I put the X. Then click "Combine" button and you will see that the sub-meshes get uncombined and they are inside the MeshCombineStudio GameObject.
    upload_2019-4-20_6-55-50.png
     
    rattlesnake likes this.
  27. KenneyWings

    KenneyWings

    Joined:
    Sep 29, 2016
    Posts:
    26
    Whenever I combine on runtime (default settings) it seems to successfully combine but also spawns these errors which stop the game from working;



    To elaborate;
    - Unity 2018.3.4f1
    - Default settings for mesh combiner, except for "on runtime" enabled
    - No objects are static, static batching is disabled
     
  28. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,674
    Thanks for reporting. It's a debug message for testing I overlooked to comment out (it's only triggered in certain cases). You can comment out the Debug message and it should be fine. I will remove it for the next update.
     
  29. KenneyWings

    KenneyWings

    Joined:
    Sep 29, 2016
    Posts:
    26
    Great, thanks!
     
  30. faolad

    faolad

    Joined:
    Jan 27, 2013
    Posts:
    108
    Since the last update, I can't use the Mesh Combiner without crashing Unity =(
     
  31. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,674
    Can you show me a screenshot of your settings in MCS? Also does it hang Unity or Unity crashes?
     
  32. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,674
  33. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    272
    @eagle555 - Awesome news! :D

    I'm just playing around with the demo Scene and it seems to be a huge boost. Now there is only one thing I'd love to see in MCS: Automagic Texture Atlasing - any chance you will add this feature in the (near) future? :cool:

    Thanks for the great update and keep up the good work!
     
  34. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,674
    Yes the performance gain is unbeatable, GPU Instancing is magnitudes slower.
     
    Weblox likes this.
  35. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,674
    Hey Everyone,

    Seems that free doesn't get good ranking on the Asset Store which I wasn't aware of, since I never tried it before.

    I'm trying to recover my sales / reputation a bit, so I'm able to put more time into the Asset Store again to continue with major updates with new features, improvement and fixes for my Assets as I have many cool ideas.

    Normally when releasing a new Asset with this amount of downloads I would reach top ranking. So I decided to ask 12.50 for the MCS Caves & Overhangs extension. It's still is under-selling to what can be adhieved with it. I submitted the change to the Asset Store and you can still download it for free for another 3.5 hours.

    Nathaniel
     
    Last edited: Apr 24, 2019
    Quique-Martinez and julianr like this.
  36. Quique-Martinez

    Quique-Martinez

    Joined:
    Oct 1, 2013
    Posts:
    112
    Hi,
    I (and probably many others) would be glad to support asset creators through something like Patreon.
    I think that it could be a good way to make sustainable the assets we already own.
    Have you considered it?
     
  37. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,674
    Hi,

    Interesting idea, will think about it.
     
    awesomedata likes this.
  38. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,800
    I don't have patrion. I will stick with the assetstore, even with its downsides
     
  39. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    272
    @eagle555 - Please, can you add texture atlasing for our combined meshes? ;)
     
    Last edited: Apr 24, 2019
  40. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    631
    Could you please elaborate why?
     
  41. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,674
    It's something that would be cool to add, will look into this.
     
  42. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,674
    4000 rocks instanced with Graphics.DrawInstancedIndirect (fastest way of doing it):

    upload_2019-4-24_17-24-52.png

    same combined:
    upload_2019-4-24_17-26-6.png

    GPU instancing is always slower than combining (it has some additional overhead), it can be a bit more efficient with culling so it would need to disregard less triangles out of the camera frustum, but that doesn't help that much also culling itself costs, that's why e.g. Vegation Studio uses cells for culling, basically the same as MCS does. So if MCS reduces the rock geometry to only one third (so 33% of the original), then it will give at least 3x the fps that you would get with GPU instancing. As with instancing you can't remove individual triangles from each rock.
     
    Last edited: Apr 24, 2019
    lod3 likes this.
  43. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    631
    Interesting. Thanks for the insight!
     
  44. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,674
  45. jenkaro3

    jenkaro3

    Joined:
    Dec 9, 2015
    Posts:
    14
    Hi, thanks for the great tool, it greatly simplifies and speeds up the process. The only thing that is still missing is texture atlasting. Really looking forward to.
     
    eagle555, Weblox and Lars-Steenhoff like this.
  46. rattlesnake

    rattlesnake

    Joined:
    Jul 18, 2013
    Posts:
    138
    Hi !
    I have a simple demand for the next release :)

    In the MeshCombiner script, is it possible to add a "Use Component Filter" with the condition "not" inside the Search Option area.
    Because I have some animated gameObjects with an "Animation" component. As far as I understand, these objects can't be properly animated when combined. Si I decided to combine all the static objects without the animated ones.

    Thank you and have a nice day,
    Seb
     
  47. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,674
    Good request, will add that in the next update ;)
     
    rattlesnake likes this.
  48. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    272
    @eagle555

    Now i have a silly question: When making prefabs from saved combined meshes, do we make it from the MCS parent game object (with the MCS Script) or create it from the child object (named: "cells") ?
     
    Last edited: Apr 28, 2019
  49. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,674
    Make it from a child. There's not need to include the MCS script for it.
     
    Weblox likes this.
  50. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,674
    Hi Everyone,

    Got another demotivating review today...Luckily I was able to contact and he removed it.

    If you haven't made a review yet, maybe you can help to put MCS in more positive day light.

    P.s. I'm currently working on adding the features I promised to MCS 2 which will take it to the next level.

    Nathaniel
     
    Last edited: Apr 30, 2019
unityunity