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

Utilities [RELEASED] MeshFusion Pro : Ultimate Optimization Tool

Discussion in 'Tools In Progress' started by NewGameStudio, Apr 4, 2023.

  1. nehvaleem

    nehvaleem

    Joined:
    Dec 13, 2012
    Posts:
    393
    Asmdefs allows splitting the codebase into multiple dlls, but it requires having the code properly organized and having correct .asmdef & .asmref files set up. Without that, there will be errors when referencing code from external dlls like mathematics, burst, collections, etc. (cause they are set up with asmdef).

    TVE - yes, this is the vegetation engine. It might be related with that this asset uses a custom importer and it cannot be cast to ModelImporter like you are doing in your code (I think, I just looked at it really quickly last night).
     
  2. Fabbs

    Fabbs

    Joined:
    Dec 2, 2013
    Posts:
    42
    Fantastic! This one is a keeper for sure. I will have to check out your other stuff aswell.
     
  3. NewGameStudio

    NewGameStudio

    Joined:
    Oct 13, 2014
    Posts:
    63
    Thank you very much for such a response, I hope MeshFusion Pro will be useful for you.
    I will be glad if you leave a review on the Asset Store if so :)
     
  4. NewGameStudio

    NewGameStudio

    Joined:
    Oct 13, 2014
    Posts:
    63
    Hm. You've figured out how it works correctly.
    If TVE has some kind of "Make Meshes Readable" flag, then maybe MeshFusion Pro will work with that asset.
     
  5. AdrielCodeops

    AdrielCodeops

    Joined:
    Jul 25, 2017
    Posts:
    54
    Hi! First of all congratulations, your asset is very interesting. I am looking into using it for a VR Mobile project. It seems to meet all my needs, but I still have some doubts.

    • If it does not do texture atlasing, does that mean that you cannot combine objects with different materials?
    • Have you tested it with foliage?
    • Have you any benchmark on mobile platforms comparing your method with others?
    Thank you!
     
  6. NewGameStudio

    NewGameStudio

    Joined:
    Oct 13, 2014
    Posts:
    63
    Hi,

    Thanks for the questions!

    1. Yes. MeshFusion Pro is designed to work universally so that you can combine objects at any time (pre-start, runtime, scripted) and with any type of object (objects in scene, prefabs, procedural objects). Creating atlases would take a lot of CPU time.

    2. I tested MeshFusion Pro with vegetation on the Viking Villiage scene. If the object has a MeshRenderer and a MeshFilter, then it can be combined

    3. You can watch a video comparison of MeshFusion Pro with StaticBatching, GPUInstancing and SRPBatching. For mobile platforms, the data is also relevant.

    Also, if you have any questions, feel free to contact me at (andre-orsk@yandex.ru)
     
  7. AdrielCodeops

    AdrielCodeops

    Joined:
    Jul 25, 2017
    Posts:
    54
    Sorry to be skeptical. So have you managed to combine objects with different materials in a single drawcall while mantaining materials? That sounds to good to be true.

    In the comparison video you have posted, you can see that the drawcalls are higher than gpu instancing for example. Also the scene is really basic, with many repeated objects and materials. Would be incredible if you share some details about how it works internally and whats criteria it follows when combining different objects. An asset like this needs heavy documentation to consider its use in serious projects.

    Another question arises for me: Static batching supports individual mesh culling for combined meshes: Is this also the case for your asset?

    Mobile hardware is quite different from PC hardware, for example, some mobiles do not support gpu instancing or might not be as efficient as other methods, while that is not the case on PC. Even if the demo data is relevant, it would be great if you provide some demo that can be built as an .apk or .exe for us to test on our devices.
     
  8. NewGameStudio

    NewGameStudio

    Joined:
    Oct 13, 2014
    Posts:
    63
    I think it would be much faster and more efficient if I provided you with the MeshFusion Pro test files for your project. Email me at andre-orsk@yandex.ru
     
  9. unitygnoob008

    unitygnoob008

    Joined:
    Sep 17, 2016
    Posts:
    225
    how do we go about adding and removing, and adding again, mesh objects?

    i may buy this if it is supported
     
  10. NewGameStudio

    NewGameStudio

    Joined:
    Oct 13, 2014
    Posts:
    63
    Hi,

    Do you mean can you delete parts of the combined meshes and then add new ones? If that is the question, then the answer is yes :)
    You can do this through code or without scripting. If you use SourceTracking - then you only need to destroy the original object and the part of the combined meshes will also be destroyed
     
  11. Cam_Fox

    Cam_Fox

    Joined:
    Nov 23, 2018
    Posts:
    29
    I tested this asset in Unity 2022.2.18f1 URP and left a review in the asset store! :)

    Here's some additional feedback for @Andrey_Rakcheev

    There's a bunch of console warnings, maybe related to Unity 2022.2.18f1 URP. See attached image.

    When I installed com.unity.collections from git, I got several hundred exceptions that wouldn't go away. Mostly "The type or namespace name 'NativeHashSet<>' could not be found". After some googling I fixed it with Edit > Preferences > External Tools > Regenerate Project Files with all "packages" types checked, then closed and reopened the editor. MeshFusion Pro's installation process may need some smoothing if other users encounter similar issues.

    The vertex count ballooned 515% in one of my test scenes and fps was significantly lower than with unoptimized/Unity static batching. This is because I added StaticMeshFusionSource to mesh renderers in child objects, underneath parent objects with LOD Groups and LODMeshFusionSource. This may expose a bug: it's possible to set up hierarchically redundant meshfusion sources that result in exponential vert counts. You can replicate like this:

    SomeObjectLODGroup (attach LODMeshFusionSource)
    \---SomeObject_LOD0 (attach StaticMeshFusionSource)
    \---SomeObject_LOD1 (attach StaticMeshFusionSource)

    Maybe this scenario could be detected and reported in the "Incompatible Sources" list in play mode.

    QuickStart pdf says you need a StaticMeshFusionSource component on all mesh renderers you wish to combine. Turns out for LOD groups I only need LODMeshFusionSource on the parent. It would be good to clarify this in the documentation.

    Thanks!
     

    Attached Files:

    Last edited: Jun 2, 2023
  12. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    590
    hi, I'm getting a failed-to-combine issue with integration w destructibleBuildings
    mf.jpg

    if you want, I can give you a voucher for this asset
    and the scripts I used

    these two scripts are added to objects beforehand
    the objects are switched off and when destroying happens, the objects are switched on

    maybe in start() does meshFusion something that does not get called?
    maybe the AssignToController() ?
     
  13. NewGameStudio

    NewGameStudio

    Joined:
    Oct 13, 2014
    Posts:
    63
    Hi,

    Thank You for write me and I'm sorry for the delay.
    Do You have any RuntimeMeshFusion scripts in scene? You can create this via Tools->NGSTools->MeshFusion Pro
     
    bobadi likes this.
  14. NewGameStudio

    NewGameStudio

    Joined:
    Oct 13, 2014
    Posts:
    63
    Thank you for the very detailed review!
    I appreciate it and will fix all the issues you mentioned in future updates.
     
    Cam_Fox likes this.
  15. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    590
    yeah, I totally forgot about it. that was the problem.

    but is there some time range when dynamic combined objects go kinematic? I see them lose collider and rigidbody (when I do additional checks later, so I would want them to keep on)
     
  16. NewGameStudio

    NewGameStudio

    Joined:
    Oct 13, 2014
    Posts:
    63
    Combined Objects do not contain colliders or rigidbody. Combined objects track changes of source objects, so colliders and rigidbody are on source objects
     
  17. NewGameStudio

    NewGameStudio

    Joined:
    Oct 13, 2014
    Posts:
    63
    What's new in Update 1.0.4!

    Completely changed the work with LOD's.
    Previously, LOD parameters scaled depending on the size, now they are assigned new values. On the basis of tests and feedback it turned out that this is a more effective approach.
    To find the optimal parameters - try to pick up different values of cell size.
    It is also good practice to create several MeshFusionControllers with different indices and cell sizes. For example, one controller is responsible for LOD objects, and another one for static objects.

    Already available on the Asset Store
     
    Cam_Fox likes this.
  18. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    590
    I get that, but if the source object went kinematic and it turn off iskinematic, the combined object doesn't seem to follow. (is there a function for recombine? destruction buildings use timed and velocity-based and height-based recombine, if I remember correct, but when meshfusionpro runs those are turned off)
     
    Last edited: Jun 5, 2023
  19. NewGameStudio

    NewGameStudio

    Joined:
    Oct 13, 2014
    Posts:
    63
    If you set TrackingTarget as Rigidbody in SourceTracker component, you should turn off "Disable When Idle" flag
     
  20. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    590
    okay, unfortunately that doesn't work in my case. and probably won't work, unless it is possible to access individual combined source objects (for subsequent explosions and height checks).

    but I see a problem. the trackingTargets are set to transform, probably because the DynamicMeshFusionSource and SourceTracker are added procedurally in start while the objects are switched off, so probably the rigidbody is not found.

    should I add if (TryGetComponent(out _rigidbody)) to Awake() in SourceTracker
    or how would I set it explicitely when the scripts are added

    this does not work (trackingtarget is still transform) :
    NGS.MeshFusionPro.SourceTracker sourcetracker;
    sourcetracker = o1 [ix].gameObject.AddComponent<NGS.MeshFusionPro.SourceTracker> ();
    sourcetracker.TrackingTarget = NGS.MeshFusionPro.TrackingTarget.Rigidbody;
     
  21. NewGameStudio

    NewGameStudio

    Joined:
    Oct 13, 2014
    Posts:
    63
    Hmm. Everything should work after you add components. It would be great if I had a chance to look at a test scene. Can you mail it to me (andre-orsk@yandex.ru)?
     
  22. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    590
    sent you a message
     
  23. NewGameStudio

    NewGameStudio

    Joined:
    Oct 13, 2014
    Posts:
    63
    What's new in Update 1.0.6!

    This is a minor update in which I have split the code into assemblies
     
    nehvaleem likes this.
  24. Skokon

    Skokon

    Joined:
    Jul 23, 2017
    Posts:
    74
    Hi, i bought the asset but i have some issues

    Can i contact you on discord?
    looks like the invite on asset store is expired
     
  25. Skokon

    Skokon

    Joined:
    Jul 23, 2017
    Posts:
    74
    How do we use occlusion culling with the mesh fusion?
     
  26. NewGameStudio

    NewGameStudio

    Joined:
    Oct 13, 2014
    Posts:
    63
    Oh, sorry about that.

    I updated the link in Asset Store. Here is new invite : https://discord.gg/5jDTsG63Xd
     
  27. NewGameStudio

    NewGameStudio

    Joined:
    Oct 13, 2014
    Posts:
    63
    Thanks for Your question.

    In this version of MeshFusion Pro, objects are combined at scene start, which means that they cannot be prebaked into the Occlusion Culling built into Unity.

    If your objects are created at runtime - you can use some of the features of Unity Occlusion Culling :
    • You can mark the objects you create as "Dynamic Occlusion" in the MeshRenderer component.

    If you have static objects present in the scene, however, you have several options :
    • If you have my asset called AdvancedCullingSystem - you can add the created objects to the controller and they will be culled by this system.
    • At this stage of development, SuperLevelOptimizer (my other Asset) is more suited for combining simple static objects that are already present in the scene. I can offer you to contact me(andre-orsk@yandex.ru) - and I will provide you with files for SuperLevelOptimizer if it is more suitable for your tasks. Or you can make a return to MeshFusion Pro and buy SuperLevelOptimizer.
     
  28. NewGameStudio

    NewGameStudio

    Joined:
    Oct 13, 2014
    Posts:
    63
    What's new in update 1.0.7!

    Update auto selection for single meshes
     
  29. Jack_Martison

    Jack_Martison

    Joined:
    Jun 24, 2018
    Posts:
    83
    Really waiting support for TVE meshes, as this is essential asset for wind shader, due to lack of tools for tree placement, I bet combining trees would be much more profound
     
  30. UsefulWeapon

    UsefulWeapon

    Joined:
    Oct 26, 2013
    Posts:
    49
    Hey, just saw your asset in the store, my question is it working good on HDRP? I have MeshCombine Studio but with HDRP it barely makes any difference in fps due to different patterns of implementation of mesh combining for HDRP
     
  31. NewGameStudio

    NewGameStudio

    Joined:
    Oct 13, 2014
    Posts:
    63
    Hi, thanks for question and I'm sorry for delay. Yes, MeshFusion Pro works with all Render Pipelines. The lack of performance difference may be due to the fact that a different optimization method may be better suited for your project. If you give me more information - maybe I can give you some advice.
     
  32. UsefulWeapon

    UsefulWeapon

    Joined:
    Oct 26, 2013
    Posts:
    49
    Thanks! Mostly my game is a low poly synty modular assets, some with LOD's. So i dont have a big meshes on scene, most of the time it is some modular prefabs like parts of walls, floor and etc...
     
  33. NewGameStudio

    NewGameStudio

    Joined:
    Oct 13, 2014
    Posts:
    63
    I apologize for the delay. I didn't see the notifications :D In that case, the object combine sounds like the best way to optimize. That's why it's strange that it didn't work. In that case, I can't say with 100% that MeshFusion Pro will help you. But, You can email me (andre-orsk@yandex.ru) and I'll send you MeshFusion Pro files for testing.
    Have you looked in profiler what else is stressing the system?
     
  34. NewGameStudio

    NewGameStudio

    Joined:
    Oct 13, 2014
    Posts:
    63
    What's new in update 1.0.8!

    Updated BinaryTree algo
     
  35. adifrank

    adifrank

    Joined:
    Dec 11, 2017
    Posts:
    23
    Is this and Super Optimizer same but on more range basis? As I have that already and Advance Culling and they work together well.
     
  36. NewGameStudio

    NewGameStudio

    Joined:
    Oct 13, 2014
    Posts:
    63
    Thanks for the question.

    SuperLevelOptimizer and MeshFusion Pro use the same optimization method but solve different problems. For example, MeshFusion Pro can work with dynamic objects and with objects created in runtime. While SuperLevelOptimizer is designed to work with static objects, but at the same time supports atlases baking. So everyone can choose a solution for specific tasks :)
     
  37. MyZoneCat

    MyZoneCat

    Joined:
    Jul 11, 2019
    Posts:
    10
    upload_2023-9-10_18-31-11.png Why is the button for this asset in the loaded state?All the timeIt's always onAll the timeCausesIt causes me toIt causes my unity Cause my unity Asset Store's shopping cart can't be opened now, before I clicked the love to go inside and add to cart, the shopping cart didn't show up, emptied the cart, it still suggests that there are 3 assets in the cart.
     
  38. NewGameStudio

    NewGameStudio

    Joined:
    Oct 13, 2014
    Posts:
    63
    Hi, thank You for contacting me. Unfortunately, it's a bug on the Unity Asset Store side and I can't do anything about it, but You can email me (andre-orsk@yandex.ru) or write to me in private messages and we'll work something out :)
     
    MyZoneCat likes this.
  39. NewGameStudio

    NewGameStudio

    Joined:
    Oct 13, 2014
    Posts:
    63
  40. ikemen_blueD

    ikemen_blueD

    Joined:
    Jan 19, 2013
    Posts:
    341
    @NewGameStudio I am looking for a final ONE-SOLUTION all for all LOD, Mesh performance. I wonder if your system can handle all the LOD Mesh performance, once and for all, like not buying yours then have to find a way to make your system to work with an Impostor system ... I wish to have ONE-SOLUTION for all like Unreal Nanite, even a much more expensive price tag, still totally worth it.

    so, my simple workflow: I prepare 3 LOD levels for my mesh - then hook it to your system to performance my mesh renderering cost as best as possible for runtime cost, am I correct?

    Any thoughts on a ONE-SOLUTION system.
     
  41. NewGameStudio

    NewGameStudio

    Joined:
    Oct 13, 2014
    Posts:
    63
    Thank you for the question.

    Unfortunately, I have to disappoint you : it is impossible to create one solution for all cases, especially without direct access to the engine.

    You will have to choose the optimization method that suits your project best anyway. Whether it's culling, combining or creating imposters in general. Or maybe the bottleneck of your project isn't the models at all - it's the shaders you're using. So many possible reasons.

    MeshFusion Pro can combine your LODGroups, thus reducing the number of Draw Calls and increasing FPS.
    If this kind of optimization works for your project, then MeshFusion Pro is a great solution for object combining.
     
    ikemen_blueD likes this.
  42. NewGameStudio

    NewGameStudio

    Joined:
    Oct 13, 2014
    Posts:
    63
  43. ikemen_blueD

    ikemen_blueD

    Joined:
    Jan 19, 2013
    Posts:
    341
    @NewGameStudio Hi there, thanks for your answers. I purchased your MeshFusion since I read comments, lots of good feedback, and I truly a runtime combine-mesh that up to day like yours.

    Can you explain a bit about each system of your store? I am kind of confusing which one should I purchase next, to use along with MeshFusion. Many thanks.

    My use-case, probably like most users here, an OK size Terrain, but I love performance. I saw you have a custom, runtime Culling system. But, I do not know much if it works well for an open world terrain, how well it combine with a Streaming system?

    Any other tricks to gain more extra juice of FPS would be loved to hear.

    Cheers,
    Tran Thiet Duy
    @ThietDuy
     
  44. NewGameStudio

    NewGameStudio

    Joined:
    Oct 13, 2014
    Posts:
    63
    Thank you for your purchase, I hope you find MeshFusion Pro useful.

    Let me tell you a little bit about my solutions. I want to warn you that I wrote most of them in my school and university days. They work well, but there is always something to strive for, so at the moment I am in the process of reworking them. Once I finish them - they will work much better, but will cost more :)

    MeshFusion Pro is a runtime solution for objects combine. I developed this asset recently, so it doesn't need to be reworked. I tried to make this solution as clear and flexible as possible

    Advanced Culling System is a custom culling system, for any task. It consists of two modules: static culling is a solution that allows you to pre-calculate visibility zones and work quickly and efficiently, but there is a limitation that preprocessing is required and it can only work with static objects. Dynamic Culling can work with both static and dynamic objects generated in runtime or already exist in the scene. But there is a limitation that this system loads the processor more than static culling.
    At the moment I'm in the process of reworking this asset and it's about half finished. The Dynamic Culling module is already completely done and is available in the Asset Store

    Advanced Render System - allows you to replace complex objects at large distances with a single-polygon impostor. This asset I'll be reworking next.

    Super Level Optimizer is a solution that combines objects like MeshFusion Pro, but has been made to work in the editor, giving you more control to refine the combined objects and also giving you the ability to create atlases.

    The choice of optimization strategy depends on your project, if you give more information, like screenshots, profiler information, then we can come up with something :) The load can be caused not only by objects in the frame, but also by shaders, lighting, scripts, many reasons.

    By the way, if you want to try any of my assets before buying - you can fill out the form on the website : http://thenewgamestudio.com/.
     
    ikemen_blueD likes this.
  45. ikemen_blueD

    ikemen_blueD

    Joined:
    Jan 19, 2013
    Posts:
    341
    wow, it sounds good to me like a full box of performance tools kit, very nice direction.

    For the Advanced Render system, I would sugggest you to "level it up" like an Advanced Universal LOD system, so far-away distances will use Imposter, disable Physics, or less Update call, or Shader cheaper pass ... like a way to hook all the conditions like an Event system, I hope you understand what I mean. So, basically, in my mind, like a LOD system based on distance or meters (like Animation frame) I can set LOD rules from 0 to 30 meters, another set of rules from 31 to 50 meters ... so a much better LOD system not just control rendering parts only, but coding, shader-pass, physics, ...

    Super Level Optimizer since nowsaday quite famous on Re-Mesh tech, I would not recommend you to focus on this, since this could be an more modern effective ways to combines meshes at editor time :)

    Advanced Culling system, I would love a system like voxel-based that you could control how to display mesh chunks from a City or a Village with lots of polygon counts. A traditional Culling system, actually not help much on the open-world case, quite too old to load and un-load things at runtime.

    Thiet Duy