Search Unity

[RELEASED] Mesh Combine Studio 2 (Boost Performance)

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

  1. Macanudo

    Macanudo

    Joined:
    Apr 20, 2017
    Posts:
    4
    Here is the SS as you asked... I think I have found a better configuration, but its still not good for me... When I turn the shadows on it gets a crazy amount of tris and verts...

    upload_2017-12-4_15-29-33.png



    COMBINE OFF
    SHADOW OFF

    upload_2017-12-4_15-49-36.png

    COMBINE ON
    SHADOW OFF

    upload_2017-12-4_15-52-57.png

    COMBINE OFF
    SHADOW ON

    upload_2017-12-4_15-56-22.png

    COMBINE ON
    SHADOW ON

    upload_2017-12-4_15-59-24.png
     
  2. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    Strange that the tris and vert count increases that much. Cells look too big in your screenshot. Have you tried with smaller cell sizes between 6-16? Maybe we can do a Skype call tomorrow to see what is going on. My account is Nathaniel.Doldersum

    Nathaniel
     
  3. Macanudo

    Macanudo

    Joined:
    Apr 20, 2017
    Posts:
    4
    Hi Nathaniel,

    I have tried smaller cells but I did not get enough draw calls reduction... I would like to call you at skype, but my english is not very good, but I can try anyway ;)

    I just want to be sure I am not doing something wrong, will add you and maybe we can talk tomorrow.

    PS: thank you very much for your excellent support.

    Regards,
    José Francisco Jr
     
  4. Stanton560

    Stanton560

    Joined:
    Aug 21, 2017
    Posts:
    14
    Hi Nathaniel

    I think you are correct. Apologies, I have found the objects. I'm starting to think that my issue has rather to do with lighting. I will explore more before wasting any more of your time! Thanks for the great support :)
     
  5. damian0

    damian0

    Joined:
    Sep 3, 2014
    Posts:
    4
    Hi,

    Should MCS still "combine" an object if it only finds a single combinable object for a given cell?

    Currently it looks like it does which in effect would just duplicate the original mesh data (not that this is likely to be especially huge).

    cheers
     
  6. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    Ah yes it does and isn't needed. Thanks for pointing this out, I will make it skip it.

    Nathaniel
     
    blitzvb likes this.
  7. abunwaaf

    abunwaaf

    Joined:
    Jun 14, 2014
    Posts:
    2
    Hi,
    Is there a detailed video explanation
     
    blitzvb likes this.
  8. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    Not yet, but I will make them soon (this month). I updated the documentation which is detailed now:
    http://www.terraincomposer.com/mcs-documentation/

    MCS is very easy to use and Inspector is self explaining, also there are tooltips.

    Nathaniel
     
    blitzvb and hopeful like this.
  9. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    Cool!

    You are still working on the chunk system?

    I was wondering if I should replace all LOD by your octree LOD (even for object not combine) should I ?
     
  10. lolclol

    lolclol

    Joined:
    Jan 24, 2013
    Posts:
    212
    hi eagle555, can i test your mesh combine unitypackage?
     
  11. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    Yes its on the roadmap also combining/uncombining for runtime level editors.

    I did benchmarks on LODGroups and it turns out that it's very fast. Issue is that it gives CPU overhead with many thousands of LODGroups, but a LODGroup per cell greatly reduces the number and won't make much difference with the octree LOD switching (an octree gets more and more effective with higher amount of objects). I decided to use Unity's LODGroup instead of distance based as it switches based on the screenspace bounds of the object/cell which is better than distance, as screenspace bounds takes camera field of view into account (so if you zoom in on an object it switches its LOD, while distance keeps the same and won't switch it).

    If your original GameObjects have LODGroups, they will be automatically detected and you can unfold the MeshCombineStudio GameObject and for each LOD amount there's a dummy LODGroup that you can modify and applies it to all LODGroups in the children (which are on the cells).

    Nathaniel
     
    blitzvb likes this.
  12. Arganth

    Arganth

    Joined:
    Jul 31, 2015
    Posts:
    277
    That demo is broken.
    if you press f1 the output says: approximately:
    array out of bounds (mcs execute jobs)
     
  13. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    676
    F1 worked for me, though it didn't toggle the console off. I didn't even know F1 did anything.

    @eagle555

    If it safe to assume your Modular City Alley Pack demo does not use occlusion culling? I found a spot with a plain alley with very little in view and was getting 130FPS, where other areas with much more going on I was seeing 300+ FPS.

    Also, when hitting TAB to disable MCS, is it switching back to Unity's static batching, or to no batching at all? I would assume it's the former, but if it's the latter, what about a demo that compares MCS and Unity's built-in static batching?
     
  14. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    That is strange here it works fine, can you show a screenshot?

    upload_2017-12-10_21-4-6.png

    Nathaniel
     
  15. Arganth

    Arganth

    Joined:
    Jul 31, 2015
    Posts:
    277


    my system:
    win 10
    i5-6600 3.5 ghz
    16 gb ram
     
  16. MoribitoMT

    MoribitoMT

    Joined:
    Jun 1, 2013
    Posts:
    301
    Hi,

    I use the latest version of combiner studio. %75 of times it works perfectly, however some objects material / texture become broken after combine. And always gets this dark texture on them.

    Screen Shot 2017-12-12 at 20.03.31.png
    Screen Shot 2017-12-12 at 20.03.17.png
     
  17. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    676
    @eagle555

    Should "Batches" in Unity's Stats window be ignored when using MCS? The FPS boost is noticeable, but when using MCS the Batches count rises (from 6 to 111 in my test), with 0 saved by batching. Just wanted to confirm since MCS replaces Unity's static batching.

    Please advise.
     
  18. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    162
    I think that I may be experiencing a similar problem but thought that it had to do with light mapping. Haven't had a chance to investigate it further yet. PossibleMCSBug.jpg
     
    MoribitoMT and blitzvb like this.
  19. Afogle17

    Afogle17

    Joined:
    Jul 27, 2017
    Posts:
    3
    Is there a tutorial for getting this working? For the life of me, I cant even get this working, I see in the example how it works, but I cannot apply it to my own scene. Am I supposed to place all my props into one gameObject and then apply that to the parent?
     
  20. Afogle17

    Afogle17

    Joined:
    Jul 27, 2017
    Posts:
    3
    I guess the question I should be asking is, does this work with VR?
     
  21. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    162
    I am no expert on this product or VR but even if you didn't get any massive FPS increase there are other benefits to doing mesh combining to do with memory etc. In my own case I am working on an iOS top-down arcade racer which had already been heavily optimised prior to any mesh combining so I am not really getting any benefits on the FPS side but am alleviating stress on the target device. I also cannot test to see if there is any FPS increase on the device because iOS forces Vsync.

    I can't see that a VR project would be any different to other project types. Anyway, onto basic use... in my project I just moved all of the things that I wanted to combine into an empty game object. I drag the MCS prefab into my scene and make sure it’s selected, then dragged my new parent GameObject into the ‘Parent’ slot in the Inspector under the Search Options section (the red section). I also disable Static Batching because this asset is a replacement for that. I left all of settings in the Search Options section as default although tinkering with the Use Max Bounds Factor, Use Vertex Input Limit, and Use Vertex Input Limit LOD are something you may want to play around with.

    In the Output Settings (the blue section) you need to play with the Cell Size a bit (i.e.: if its heaps of small objects like Trees and Rocks etc this can be a small value - once again dependent on your own project). I also enable ‘Remove Tris below Surface’ and for the Surface Layer Mask I just picked my Ground layer (being my ground plane). I also leave the Make Meshes Unreadable enabled. Everything else here I left as default settings - but the Documentation explains the extra functions quite clearly.

    Then it’s a matter of deciding whether or not you want to Combine the Meshes at Runtime (eventually I will but for the moment I am still tinkering around with settings). After that just click the ‘Combine’ button and you should see some visual feedback (Gizmos) in the Scene View. The one thing that I tend to double-check is that the Disable Original Renderers and LODGroups button (Blue) gets clicked. You may want to deselect and reselect the MCS prefab in the Hierarchy to be sure this is getting done.

    The asset provides other means of selecting which objects you want to combine (under Search Options section) too. Once again all in the Documentation.

    When tinkering with settings again you just click the green ‘Enable Original Renderers and LODGroups’ button, make your changes, and then click the Combine button again - and once again be sure that Disable Original Renderers and LODGroups has been clicked. Oh, you will need to re-bake LightMapping too. I also re-bake Occlusion to be on the safe side.

    In essence, from what I can tell, that’s the basic use of the product. Results and usage will vary from project to project.

    NOTE: I only read about this last night but Static/Dynamic Batching may or may not improve performance and as to where and when to use it will also be on a per project basis. Hope this info helps out and that it doesn’t sound condescending. I am no Unity game-dev expert and my only experience in VR is with 3d animation rendering for Film.
     
    Afogle17 likes this.
  22. Afogle17

    Afogle17

    Joined:
    Jul 27, 2017
    Posts:
    3
    Thank you for the input, I am still messing with it. I guess I am a little disappointed because I keep seeing all these numbers being thrown around of the thousands of percents added to fps and everything. I purchased this thinking it would help in some way, but I don't see any boost to any performance, no matter how I try to set it. I'm just starting to feel like I bought snake oil.
     
  23. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021
    Hi @Afogle17,

    Not sure if you have already tried this but one thing I would always say is make sure the original prefab with all the original objects in is disabled after using the suite. It's easy to forget to do - I know from experience. This will result in both the optimised version and originals running at the same time meaning more work for the system not less. Not sure if Nathaniel added a selection to auto switch off the original prefab in a later patch as prefer to do all this manually for more control. Like I said I've had great success with this tool. Massive performance boost in some scenes. For the amount it's doing it's really easy to use. Just put all the desired objects into a parent object and drag and drop. A few clicks later and it's done.

    Another thing is what version of unity are you using? I'm still on 5.6 as I've found it to be most stable. I've seen a few other threads for assets where they having real problems with 2017.2 even the latest version.

    I'm sure Nathaniel will get back to you soon. If he's not responded there's usually a good reason.
     
  24. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    162
    Hello, The enable/disable original renderers buttons are definitely in v1.16. However, I noted yesterday, and this could just be something to do with 2017.1.2, that you can select the MCS prefab, disable the original renderers etc but if you bake occlusion after that then sometimes the MCS prefab seems to switch back to original renderers and you have to click the disable button again. To make it stranger this only happened with one of the two MCS prefabs that I had in the scene. Possibly this is just something to do with my own project and setup but thought that I had better mention something. Yeah the 2017.x.x releases are an absolute mess with the current 2017.2.1 being completely unusable for iOS games as the physics interpolation is broken - in 2017.1.2 it's still okay though.
     
  25. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021

    Yep. From what I can see it's always worth staying behind a couple of versions if you can. I had to as didn't want to break my game but glad I did anyway. By time game released and know whats happening 2017.4 will be out so will be using 2017.2 then. That's if my game sells enough that I can make more :)
     
  26. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    I will take a look into fixing it this coming week.


    Can you show comparing screenshots MCS vs Unity's batching?

    The total bathes with Unity static/dynamic batching enabled is 'Batches' + 'Batches saved'. Batches saved are the meshes that are batched by Unity's static/dynamic batching. So disabling this will but this to 0.

    So this has the wrong material? Can you show a screenshot how it should look?

    Yes like that and you can use multiple MCS instances, but first need to get it working. I will make tutorial videos the coming week.

    I understand how you feel, but it's definitely not snake oil, the performance gain depends a lot on the setup. The more smaller meshes are used, the bigger the gain over Unity's static batching. It doesn't mean that in any case it will boost performance magnitudes (that's why I write significant to dramatic), but still MCS can give a significant performance boost. It's probably a matter of the right settings. I answered your email and offered to do a skype call to get it working for you with your Scene/Project.

    Nathaniel
    Yes it's compatible with VR.


    I made the original mesh renderers and lod groups disabling automatic and should work. But still something might go wrong, it depends a lot on the setup hard to tell without seeing any screenshots.

    Nathaniel
     
    docsavage likes this.
  27. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    676
    I attached a comparison image, but according to your second paragraph it sounds like this is normal behavior.
     

    Attached Files:

  28. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    162
    UNITY :: 2017.1.1(f1) on OSX
    TARGET PLATFORM :: iOS using Metal

    Hey Nathaniel, I will have to get back to that particular scene - it's my first of the dirt track type so I have lots to work through but essentially the rocks that appear darker should look like the rock in-between the two white box outlines the image - also the metal barrels are also being affected by whatever is wrong. Oh, it's the exact same material/texture map too.

    However, I loaded another scene this morning and spotted something even worse but I also suspect it is something to do with the light mapping. In this instance it's like the material is screwed up on some prefabs - but the prefab is the exact same one, just duplicated when I position it. Due to the fact that it isn't darker, like the other issue, and completely black, I am guessing that it might be a UV issue - I say that because in my texture map the background behind all of the UV shells is pure black. Once again I will investigate further.

    EDIT: Must be something to do with the light mapping because I cleared the whole GI cache, re-baked it, and now the result is similar to the other 'darkening' issue. For what it's worth I am manually doing the baking.
    Enable-Disable-Renderers.jpg
     
    Last edited: Dec 21, 2017
  29. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    162
    Hello, hopefully someone can shed some light on this... if MCS is a replacement for Unity Static Batching, and I am only using MCS for static objects that are small like trees and rocks etc, then what happens to all of the other objects that would also have been marked for Static Batching like the ground plane, race track pieces (road/bumpers/rails), large background rocks, and realtime shadow-casting objects (see image in previous post)?
     
    hopeful likes this.
  30. yonson_chappers

    yonson_chappers

    Joined:
    Feb 6, 2017
    Posts:
    33
    Quick query regarding LOD grouping replacement. I've got an object with 3 LOD levels, and an LOD group object, but when running MCS it only detects 1 group, so at run time with MCS on there is no LOD switching at all. As a side issue it still runs faster(!) but obviously I'd like to improve the performance further.


    Is this an issue with naming conventions or am I doing something wrong? The object I'm combining is '3Storey_LOD' in the screenshot.

    Many thanks!

    upload_2017-12-21_15-34-9.png
     
  31. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    762
    Hi,
    Seems Tris and Verts increase heavily when MCS is enabled
     
  32. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    762
    upload_2017-12-23_0-2-34.png
     

    Attached Files:

  33. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    762
  34. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    162
    Hello eaque, just wondering if you clicked on the Disable Original Renderers and LODGroups button. I too noticed a rather big increase in the tris/verts count but then I redo Occlusion and the Lightmapping and it all goes to the same amount prior to using MCS or less. i.e.: mine showed around 120 verts before and is around 70 after.
     
  35. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    762
    hi, thanks for your help. I guess i did, as you can see on the pic...If i'm not wrong?!:)
     
  36. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    162
    My mistake, I didn't realise that the Enable/Disable Renderers stuff looked different when doing Realtime Combines so I didn't spot it in your images.
     
  37. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    762
    many thanks anyway!;):) still searching...
     
  38. Meka_Games

    Meka_Games

    Joined:
    Mar 3, 2016
    Posts:
    345
    Hello. I did not see any performance impact. What can I do to make it better? (Unity 2017.1.1f)

    6.png
    7.png
    8.png

    Without MeshCombineStudio: Unity's default batching. It's better. so why am i using this asset?

    2.png

    Or Can we make a Skype call? But my English is not very good.
    This is an optimization tool and it does not work. If my problem is not resolved, I will request a refund. There are no tutorial videos. Documentation is not enough.
    I'm completely disappointed.
     
  39. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634

    I suggest using 2017.1, or 5.6...I don't use higher versions of Unity due to , to many issues with Unity updates them selves...and it turns out many issues are related to Unity.... So I suggest to try another version.. I also seen Nath offered a Skype chat....
     
  40. Meka_Games

    Meka_Games

    Joined:
    Mar 3, 2016
    Posts:
    345
    Same with 2017.1
    I hope I can get a response!
     
  41. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    676
    Hi @rikiLL

    Is there a particular reason you're using MCS in runtime? I've found it painfully slow to initialize the scene this way, but if you're doing something special that requires it, by all means.

    Anyway, I had 15 minutes to kill this morning, and noticed you're testing with this pack. I recently grabbed it as placeholder for a prototype, and as an MCS user I decided to give it a go to see if I could help. I also used 1.16b, which has not been added to the Asset Store yet. @eagle555 posted the hotfix earlier in this thread here.

    I used the Day version of the demo map. Static camera angle for accurate testing. V-sync disabled (otherwise it caps at 60). Excluded all foliage that needs to be dynamic for wind to work. Removed the rotation script from air_con_02 (just for testing). Assuming you are testing with the same demo map, I noticed that a significant amount of objects are being used less than 10 times, which MCS wouldn't benefit. Moreover, most objects were not set to be 'Static', which I fixed for both examples. However, I don't know if MCS requires this or not to work effectively.

    Here are the results:

    mcs_off.jpg mcs_on.jpg

    Obviously performance in both examples can be further optimized in other ways, but just wanted to provide my findings.

    Hope this helps. I'm sure @eagle555 can help a great deal more. In my own usage, I typically only use MCS for objects that are used at least 40+ times, and for objects used infrequently, I find creative ways to combine them with other less-used objects to reduce batch count and set pass calls. That, or I make sacrifices to limit the number of unique objects.
     
    recon0303, MudPuppet and Akshara like this.
  42. Meka_Games

    Meka_Games

    Joined:
    Mar 3, 2016
    Posts:
    345
    Thanks for your effort. But i tried every option. And my fps is better without MCS. So thats why i will request a refund. Please check your pm eagle555
     
    Last edited: Dec 28, 2017
  43. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    162
    Well that's strange... In that recent example with the buildings etc your SetPass calls actually reduce whereas in my own project they increase. Out of curiosity did you hit Play when doing the screenshots? I never trust the Stats window and only look at the results when hitting Play or testing on my target device with an FPS asset. I too am curious about what happens with any GameObjects that are marked for Static Batching and have just been assuming that when you disable Static Batching that it just gets ignored on any GameObjects where it is marked. Although I don't get any real FPS increase I can still use MCS for alleviating stress on my mobile phone, or in the event that I wanted to use realtime shadows then MCS would reduce the amount of shadows being cast as meshes have been combined. I am still playing around with settings though and still have not found where things screw up with light mapping.
     
  44. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    762
    Shadow caster reduce heavily thanks to MCS, but it seems it has not a lot of influence on fps count?!

    Do shadow casters ahve real impact on fps? compared with draw calls and poly counts??
     
  45. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    762
    How many MCS object do you use in your scene? I guees only one ?
    Try to separate objects with same material by tag and try several MCS with the same parent but click "use tag" in options. So 1 MCS by tag and more depending on verts count...I do like that don't know if it's best but i'm getting results.
    ...Never know...

    I must admit that Nathaniel should do more videos of his tools but this one seems quite easy...
     
  46. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    762

    To me you don't need to set objects as static to get MCS work. It's more like a search option as you are asked to disable Static batching in settings...

    I noticed MCS was usefull with a lot of objects but not with few...WOuld like to have more details about that, hope nathaniel will answer...
    :)
     
  47. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    162
    I just did a quick test... I had 3 x realtime shadows. With the 3 x realtime shadows I maxed at around 150FPS and with shadows disabled on the light source I got just over 160FPS. I have read so much conflicting information though on anything from Draw Calls, Batching, Shadows, you name it. I just always test on the target platform which is the only way I can tell if anything I touch makes a difference and with iOS it forces vsync. I guess that this will always go back to that common saying that every project is different. Unfortunately in my own case I am working on a top-down race game but most info that I see for that game genre is usually about rear view race games so even with just the optimisation side of things it's like a big guessing game vs trail and error.
     
  48. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    162
    Hey Nathaniel, I have just managed to get my game running at awesome performance with a solid 60FPS on iPhone. Also, it appears that the light mapping issue I had was to do with the Mixed Lighting / Baked GI being set to subtractive - dunno if this info helps with regards to the darkened objects issue in my images above. I had it like that so I could bake shadows but I went from around 150FPS to 200FPS with realtime shadows and using Baked Indirect instead. In actual fact my Batch, Set Pass Calls, Tris/Verts counts are all now down by about 1/3rd.
     
  49. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    197
    Hello i have only ONE question does lightprobe ruin your system or not? How lightprobe work with combined object they still recieve correct light from correct probe? Or it just take middle probe in tetragone?
     
  50. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    197
    Also please add support for 32 bit mesh buffer, I also have issue with doubling tris count, I guess that it caused by different lightings, meet this bug with bunch of spot and point light.
     
    blitzvb likes this.