Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

[V1.2.4 Released] Advanced Merger Toolkit - Boost Performance | Easy & Powerful Workflow

Discussion in 'Assets and Asset Store' started by eskovas, Nov 2, 2018.

  1. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    Advanced Merger Toolkit
    screen_516x389_asdasdasd.png
    http://u3d.as/1k1d

    A powerful, easy to use, non-destructive Mesh and Material Merger Tool.


    This tool makes it possible to combine groups of objects into a single or small groups of objects in order to improve the performance of your games without sacrificing your workflow.
    It also allows for the creation of merged LODs by re-using already existing LODs from the original objects, and controlling the percentage of objects included in each LOD and minimum size each object needs to have for each LOD.

    Features:
    - (NEW!) Merge groups of objects using a grid (Great for large modular zones);
    - (NEW!) Use custom objects for specific LODs instead of using the merger (Imposters, custom mesh, etc);
    - (NEW!) - Ability to include custom components by duplicating the original raw collection and removing not needed components.
    - Merge groups of objects with the same materials into one single object;
    - Merge groups of objects with different materials into a single object with a single material;
    - Non-destructive workflow (easily go back and forth between the original and merged objects, for a single or multiple Merger groups in the scene)
    - LOD Generation with control over percentage of meshes and minimum size per object per LOD;
    - Include/exclude specific materials from LODs;
    - Material merge specific groups of objects with specific materials into their own merged object (e.g. Separate objects for Standard Opaque and Standard Cut-Off);
    - Share merged materials between different LODs;
    - Easy and powerful texture and material setup for Material Merger with scriptable objects;
    - Re-use already baked lightmaps used by the original objects for the new merged objects;
    - Re-position UV2 Lightmap UVs so they do not overlap (for use with baked lightmaps);
    - No coding required when using in the Editor;
    - Run-time support;
    - Generate cloned colliders from original objects;
    - Perform Merger to every Merger group in the scene with one click;
    - Switch between the originals and merged objects of all Merger groups in the scene with one click;
    - Prefab creation and save all merged meshes/materials/textures inside a given project folder;
    - Preview merged statistic results before performing merge generation.
    - Full source code.

    Supports:
    - GameObjects with or without LODGroup component (Will use original object's LODs for the merged LODs);
    - Tiled/Offset/Scaled Materials;
    - Multiple Materials per object;
    - Substances (Unity 2017, Editor only, not at run-time );
    - Color multipliers in materials can be applied to textures in merged materials;
    - Unity 2017/2018 (Tested all version from 2017.1 to 2018.2);
    - Default Renderer, HDRP and LWRP;
    - Any Shader. Keywords can be enabled when using Material Merger.

    Results:
    - Massive draw call reduction;
    - Reduced number of shadow casters;
    - Improved performance on both the CPU and GPU;
    - Improved realtime lightmap results (especially for modular scenes);
    - LODs are treated for the group as a whole instead of per object;
    - Easy to work with and to change objects even after merging them.
    - Slightly higher memory usage due to extra meshes and textures;

    Current Limitations (Will be resolved in future updates):
    - No Substance support for Unity 2018;
    - No Run-time Substance support (Works just in editor);
    - No support for UVs outside of [0,1] space;
    - No skinned meshes support.

    Roadmap:
    - Share same merged material across multiple Merger groups (Even less draw calls);
    - Support for UVs outside of [0,1] space;
    - Skinned meshes;
    - Run-time Substance support.
    - Substance support in Unity 2018+;

    Possible features for future versions:
    - Automatic Mesh polycount reduction;
    - Add objects to already merged objects efficiently at run-time;

    Video Demonstration (missing some of the latest features):


















    Run-time demonstration:
    To be able to use the Merger tool at run-time, you can either use a game object that's already in the scene with a pre-defined Merger Component, or you can create one from code and use the scriptable objects with the pre-defined values, like this:

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. namespace AdvancedMergerToolkit
    5. {
    6.     public class AMT_RuntimeDemo : MonoBehaviour
    7.     {
    8.         public GameObject[] Objs;
    9.         public GameObject main;
    10.         public int count;
    11.         public Vector2 offset;
    12.         public MergerMaterialSettings genericSettings;
    13.         public MergerMaterialSettings specificSettings;
    14.         // Update is called once per frame
    15.         void Update() {
    16.             if (Input.GetKeyDown(KeyCode.M)) {
    17.                 Merge();
    18.             }
    19.         }
    20.         void Merge() {
    21.             if(main != null) {
    22.                 Destroy(main);
    23.             }
    24.             main = GameObject.Instantiate<GameObject>(new GameObject("AMT"));
    25.             Merger merger = main.AddComponent<Merger>();
    26.             merger.Setup();
    27.             for(int j = 0; j < Objs.Length; j++) {
    28.                 for (int i = 0; i < count; i++) {
    29.                     GameObject newObj = Instantiate<GameObject>(Objs[j]/*Objs[Random.Range(0, Objs.Length - 1)]*/);
    30.                     Vector3 pos = new Vector3();
    31.                     pos.x = Random.Range(-offset.x, offset.x);
    32.                     pos.z = Random.Range(-offset.y, offset.y);
    33.                     newObj.transform.position = pos;
    34.                     newObj.transform.SetParent(merger.raw);
    35.                 }
    36.             }
    37.             MergerLOD lod0 = merger.AddNewLOD();
    38.             lod0.percentageOfMeshes = 100;
    39.             lod0.lodPercentage = 35;
    40.             MergerLOD lod1 = merger.AddNewLOD();
    41.             lod1.percentageOfMeshes = 50;
    42.             lod1.lodPercentage = 15;
    43.             lod1.mergerMaterial = new MergerMaterial();
    44.             lod1.mergerMaterial.mergeMaterial = true;
    45.             lod1.mergerMaterial.genericMaterial = genericSettings;
    46.             lod1.mergerMaterial.specificMaterials = new List<MergerMaterialSettings>() {
    47.                 specificSettings
    48.             };
    49.             MergerLOD lod2 = merger.AddNewLOD();
    50.             lod2.percentageOfMeshes = 20;
    51.             lod2.lodPercentage = 3;
    52.             merger.GenerateFinalObject(false);
    53.         }
    54.     }
    55. }
    The for loop is just to randomly instantiate objects. Has nothing to do with the Merger.
    This is just the run-time demo code i'm going to include. By pressing 'm', it will generate a new random group of objects and merge them together. LOD0 uses the mesh merger, and LODs 1 and 2 use both mesh and material merger.
    You can see that it's very easy to use this tool at run-time.
     
    Last edited: Jan 16, 2019 at 11:06 PM
    OnePlusOneNS and mikew_unity like this.
  2. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    Change List

    V1.2.2:
    • New and improved Merger Inspector UI
    V1.2.1:
    • Added option to disable saving Prefab and Meshes when performing Merge (up to 35% performance boost but increased scene size)
    • Added Auto-Merge on Startup (With global option to disable this)
    • Added Auto-Enable Combined Collection on Startup
    • Added Auto-Delete Raw Collection on Startup
    • Added static functions in Merger.cs for “Show All Combined Collections”, “Show All Raw Collections” and “Merge all Collections” for easy access by script and run-time
    • When only using one LOD in the Merger Component, and “LodGroup Transition %” is set to zero, then the Merger won’t generate a LodGroup component for the final combined object.
    • Improved UI look for the LODs section of the Merger Component.
    V1.2:
    • Added Grid Generation
    • Improved algorithm setup and execution
    V1.1.1:
    • Removed NET4.6 dependency
    V1.1:
    • Massive performance and memory improvement when performing Material Merger, with up to 73% faster generation and 92% less GC allocation.
    • Added Global Merger Options, with an option to avoid doing cleanup when performing the merger. This isn't always needed and improves performance up to 21%, on top of previous performance improvements.
    • Fixed memory leak.
     
    Last edited: Jan 2, 2019
  3. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    Advanced Merger Toolkit is still pending review.

    Here's an update on Version 1.1, which is focused on a new algorithm for the Material Merger for improved performance and less generated garbage.

    V1 features a single threaded algorithm that runs on the CPU and uses GetPixels and SetPixels, which makes things a bit slower than expected when merging materials, and generates a bit of garbage in memory.
    The algorithm also wasn't as well constructed as i would have wanted, with a few places wasting some resources.

    For the runtime demo, which would merge 270 objects (LOD0 - Mesh Merger, LOD1/2 - Mesh and Material Merger), it was taking on average 2.23 seconds to generate everything, and generating 316MB garbage.
    The garbage is only for the Material Merger. The normal Mesh merger works really fast and doesn't generate almost any garbage.


    For V1.1, i've reworked and vastly improved the Material Merger algorithm, implementing 3 solutions to perform all texture merger operations: Multi-Threaded CPU (Using .Net's Parallel For), Compute Shaders and Graphics.DrawTexture.

    Here are some preliminary results for the runtime test demo when using in the Editor (Editor generates extra garbage that would not be generated in builds):
    Multi-Threaded CPU -- 0.88 seconds -- 190.2 MB Garbage (Still uses GetPixels)
    Compute Shaders -- 0.54 seconds -- 9.3MB Garbage
    Graphics.DrawTexture -- 0.52 seconds -- 9.3MB Garbage

    These are great results and these improvements also apply to using the tool in the editor while not at runtime.
    I'm still working on these solutions, but things are looking pretty well.

    I don't know if i'll include the 3 solutions, since Compute Shaders and Graphics.DrawTexture produce very similar results, but Graphics.DrawTexture works on more platforms.
     
  4. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,301
    What is the advantage over Mesh Baker from Digital Opus?
     
  5. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    Well, i can't comment much on Mesh Baker. I've never used it, so only thing i know about it is by watching the video tutorials. They are a bit old, so things might have changed quite a bit.

    After looking at the videos, i would say one of the biggest differences is down to usability and workflow.
    I don't want to directly compare the two, but i'll describe what you can do with Advanced Merger Toolkit with ease.

    I created AMT with the main focus on making it easy to work with and be as automatic as possible without affecting your workflow.
    For example, you can have multiple groups of objects throughout the scene, where each group can be a Merger group (with the component), and construct the level the same way as you would ever do.
    You don't need to re-add objects to a Merger Component/Tool, or find the objects you want to merge, don't need to update anything. Just add/change/remove objects from your gameobject group, click on a button and see it all merge together with minimal work. (You also just need to press one button to merge all Merger groups in the scene)
    This saves a lot of time and effort when creating levels, or groups of objects you want to merge together, because you don't need to keep track of objects and keep re-adding them to the tool.
    You can then, again with just one button, switch between the original objects and the merged objects in the scene, so you can go back to edit them and re-merge them again.
    All in all, you spend a lot less time managing the tool and more time doing what's actually important. Something which i think is better than all other similar tools in the asset store.

    With that said, AMT also features a lot more features, and the main one is the LOD generation.
    With LOD generation, it will generate LODs for each Merger group by making use of the original LODs of each object (using LODGroup component), controlling the percentage of objects to be included in each LOD, and the minimum size each object needs to have for each LOD.
    The LOD Generation also gives you a lot of control for each LOD, like controlling which types of materials can be included in each.
    This gives you a lot of control over the Merged LODs, and improves performance even more, while making use of LODs you might already have.

    Talking about the actual merger, it features Mesh and Material Merger tools. Mesh Merger is really fast, and as i described in the post above, the Material Merger is also going to get very fast and efficient.
    You setup the Material Merger with scriptable objects that can be re-used across all Merger groups, and also at runtime, which also simplifies a lot of work you would have to do.

    The new merged meshes/textures/materials are all saved inside the project folder automatically (if not using at runtime), and it also generates a Prefab that you can use and update later on.
    It also supports Substances(2017, not at runtime for now), color multipliers, tiled/offset/scaled materials and more.

    To end this post, the Advanced Merger Toolkit will also be significantly cheaper, priced at 35$ on launch. I will slightly increase its price once i add a few more features.


    Sorry for the very long post. If you have any questions about this asset please let me know.
    I don't usually like to directly compare assets together. I prefer to show what the tool is capable of, and you can then compare both with all information and choose the best tool for your job :)
     
    Last edited: Nov 12, 2018
    mikew_unity and Elecman like this.
  6. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    Was in time to submit an update to the asset before it's available.
    Fixed a small bug when doing texture copy operations.

    Also added the ability to use another texture's offset/scale properties for specific textures.
    I don't know how i didn't noticed this, but textures that relied on the main texture's offset/scale properties weren't using those when merging them.
    For example, In the Standard Shader, all main textures use only one offset/scale property.

    So, i added an extra option where you can specify for each MergerMaterialTextureSettings (texture to merge), the target offset/scale properties you want to use. This works similarly to how the texture for each MergerMaterialTextureSettings is setup, by using a list of texture property strings to search for in each material.
    This also works if the shader has groups of textures that use different offset/scale properties for each group in the same shader.

    OffsetScaleTarget.PNG
    Very easy to use and to setup this option.
     
    Last edited: Nov 17, 2018
  7. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    Advanced Merger Toolkit has been released on the Asset Store!
    AMT_Large.png
    http://u3d.as/1k1d
    Version 1.1 with the new Material Merger algorithm, performance improvement, vastly reduced memory usage and garbage generated will be submitted very soon to the asset store, probably tomorrow.

    Let me know of any issues you might encounter with this tool, and if you have any feedback or feature requests, please let me know :)
     
    StevenPicard likes this.
  8. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    Will try to submit V1.1 tomorrow.

    The main highlight: Improved Material Merger algorithm with Performance and Memory improvements.

    Made a slightly more detailed test scene with a total of 1244 renderers, 65904 vertices and 37084 triangles.
    I'll be comparing results between V1.0 and V1.1
    amt_demotest.JPG

    For this test, there is only one Merger group in the scene, will be making a Merged LODGroup with 3 LODs.
    LOD0 uses the Mesh Merger and LOD1+2 use both Mesh and Material Merger.
    Here's the Merger Component setup:
    amtdemosettings.jpg

    These tests are done in the Editor, so runtime tests are a bit slower and have slightly higher GC Alloc.

    Runtime tests are done while playing, and Offline tests are done in the editor while not playing.
    Offline will perform a cleanup of the merged asset folder and save all merged textures/meshes/prefab to disk.

    V1.0:
    - Runtime: 2.4s | GC Alloc: 335MB
    - Offline: 12s | GC Alloc: 389MB

    V1.1:
    - Runtime: 0.65s - 73% faster | GC Alloc: 26MB - 92% Less
    - Offline: 9.5s - 21% faster | GC Alloc: 80MB - 79% Less

    Largest difference is when Merger is performed at runtime, with the algorithm being 73% faster and generating 92% less GC Allocations.
    Offline's performance isn't as big because saving to disk and cleaning up previously merged assets that are no longer used still take some time. This will be improved in later updates.

    Also remember this test is generating a total of 3 LODs, 6 merged Textures, 8 merged meshes, 2 materials, and saving them to disk, which is the slowest part of the whole process. Still, a big improvement.

    Should be submitting this update tomorrow.

    For V1.2, i'll be including the ability to split Merger groups using a grid. Great for modular environments with a lot of detail. (will demonstrate this soon).
     
  9. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    Well, i'm probably not going to be able to submit V1.1 today. Unity is being weird and not letting me connect and use Package Upload. I'll try to submit it tomorrow.

    Here are the V1.1 notes:
    - Massive performance and memory improvement when performing Material Merger, with up to 73% faster generation and 92% less GC allocation.
    - Added Global Merger Options, with an option to avoid doing cleanup when performing the merger. This isn't always needed and improves performance up to 21%, on top of previous performance improvements.
    - Fixed memory leak.


    As mentioned in the second note, i also added a scriptable object that controls global properties that are used by all Merger groups.
    It only has one property now, but i'll be adding more to make the tool even more easy to use and add more global controls over all Merger groups.

    Capture.JPG

    As mentioned in the post above, the tool (while using it in the editor and not in play mode) will perform a cleanup of previously created textures/meshes/materials (of the Merger group that is going to be merged) in the project folder before doing the actual merger.
    Since this isn't always needed, i added this option to disable the cleanup. This way you save more time when working with the tool, and then when you want, you can do the cleanup.

    Tests show disabling this option improves performance up to 21% (on top of the performance boost mentioned in the post above), which is a pretty big boost.

    When the V1.1 is submitted, i'll update the post.
     
  10. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    729
    Hey, this looks very cool! Is there a free trial version I can try out? I would like to try before I buy because 95% of these things don't seem to actually work for me.
     
  11. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    Thank you for being interested in this tool, but i'm not exactly sure how i would go about doing a trial version at the moment.
    I also know the what it's like to buy something on the asset store and then not working out for me. If the tool isn't right for the job you want, or doesn't work like you would like, i would have no problem refunding it. Hope that gives you some sense of relief and security when purchasing my assets :)
     
    Last edited: Nov 21, 2018
  12. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    Submitted V1.1.

    Like i posted before, this is the change list for V1.1:
    - Massive performance and memory improvement when performing Material Merger, with up to 73% faster generation and 92% less GC allocation.
    - Added Global Merger Options, with an option to avoid doing cleanup when performing the merger. This isn't always needed and improves performance up to 21%, on top of previous performance improvements.
    - Fixed memory leak.

    Merger just got a whole lot faster and efficient! :)

    I'll now continue work on V1.2 which will include the Grid generation and a few more optimizations and features. I'll post some video demonstration of the new features soon
     
  13. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    V1.1 is now live!

    Features massive performance and memory optimizations to the Material Merger algorithm!
     
  14. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    Here's an update on Version 1.2.

    I've been working on the Grid generation, improving a few system along the way and preparing them for future features.

    Each Merger Component now contains a Grid parameter, where you can set the type of grid you want.
    Right now it's only possible to divide the objects into the number of divisions set below, but will also be possible to define how the object will be divided by setting the size of each grid section and its offset.
    1.JPG
    i'll probably also add a global size/offset parameter that can be used by all Mergers to simplify the setup for Mergers that want to use the second option.

    The settings above will generate 4 split sections, and each one will be a separate LODGroup. The MaterialMerger will also share all merged materials/textures between these LODGroups.
    2.JPG
    With this system ready to share the materials between groups of objects, it will also be possible in the future to share all merged materials/textures between different Merger components (this will come in a later update).

    And here's the merged result:
    0.jpg

    I also improved and simplified how the names are generated, and also simplified how and where the meshes/textures/materials are saved in the project folder.

    I'll also be adding a visual representation of the grid, so you can visualize it and see how it will be divided.
    Next time i'll use another example with a big map with lots of modular pieces, where this will be extremely useful.
     
  15. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    Here's a preview of the main feature of V1.2!

    The main feature will be Grid generation, which is perfect for merging large number of objects (especially modular objects) that occupy a large volume in a scene.
    Here's a great example of using Grid generation for merging all 3351 modular floors in this section into just 31 total objects:
    1.jpg

    The Grid option is now displayed at the end of the Merger Component, and it contains two options.
    For this example, i'm simply dividing into a 3x1x3 grid. Here's the end result:
    2.jpg
    3.jpg

    Really easy to setup. I just put all those objects into the 'Raw Collection' GameObject, set the number of divisions and hit Generate.
    You can then add/change/remove more objects and hit Generate again. No more steps needed, since it does it all automatically.

    The second option provided offers the ability to set the size of each Grid element (x,y,z length + offset). This works great if you want the grid elements to always have the same size when you're adding/removing objects, so you don't need to always keep adjusting the number of divisions.
    5.jpg

    Another option provided lets you choose local or global coordinates when generating the Grid. In this example, the floor is actually rotated in relation to map, so it's better to use local coordinates for the Grid. The preview also takes this into account when showing how the Grid will look.
    4.jpg
    (image demonstrates the Grid using Global coordinates)

    This is an awesome feature that is really useful and will save even more time.
    Should be ready for submission soon.
     
  16. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    Grid generation also works well for smaller regions if needed. No need to to split groups of objects into separate gameobjects if you don't need/want to:
    6.jpg

    Also added an option to not generate prefabs and save meshes to disk. This shaves off up to 35% of merging time in Editor.
    Although i wouldn't advice to use this option for shipping purposes, this is extremely useful for faster iteration times when in development, and don't care if the Scene object occupies more disk space.
    Only exceptions are Textures and Materials, which still need to be saved to disk.

    You can then at any time re-enable the option and merge again to save everything to disk.
     
    Lars-Steenhoff likes this.
  17. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    Hello again!

    Just submitted Version 1.2 of Advanced Merger Toolkit to the Asset Store.
    Price of the asset will slightly increase to 40$ (from 35$). I mentioned when launching the asset that i would be slightly increasing the price shortly after release, so if you are interested in the asset, you can still get it 5$ off until version 1.2 is released.

    Main feature of V1.2 will be Merger using Grid Generation.
    It's very useful when dealing with large groups of objects that you want to merge together, but still want them to be separated into 'zones'.
    Also when using the Material Merger functionality with the Grid Generation, all Material Merged LODs in all grid sections will share the same merged materials.

    Here's an example of this feature in action, combining 3351 objects into a total of 31 objects divided into a 3x1x3 grid:
    Untitled2.jpg

    In this example, i already had all floor objects as children of a parent object that was slightly rotated.
    Here i don't actually want one huge object for this region, since this wouldn't actually be that great for performance (rendering everything when looking at any part of it) and wouldn't be great for lightmapping (too large of a surface).
    I also don't want to manually split the regions in the scene into different groups of objects, where each region is inside its own parent gameobject.
    With this in mind, i will split it into a 3x1x3 grid, where only visible sections are rendered when looking at them ( with incredibly low number of objects), and lightmap resolution will be a lot higher.

    So, like i would do with any group of objects to Merge together, i use the parent object of the floor, attach the Merger component, set LOD setup, enable the Grid generation, set the number of divisions, and hit Merge.
    Very easy to do, and i can go back, change any modular part of the region and hit Merge again.


    In this update i also vastly improved the Material Merger setup and execution, making it possible for all Material Merged LODs in all grid sections to share the same merged materials. This will also allow me in a future update to make all Material Merger in all Merger components in the scene to share the same materials, and this will save even more draw calls and generate a lot less textures.

    Hope you find the Grid Generation feature very useful for your projects! :)

    And be sure to get Advanced Merger Toolkit 5$ cheaper until V1.2 is released!
     
    Lars-Steenhoff likes this.
  18. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    Here's more information about the new Grid Generation:


    This is the last option in the Merger Component, and there are two options: Divisions and Fixed Size.

    To be able to view the grid preview, pressing the “Refresh Stats” in the Lods section is necessary, in order to get the most current data of the Merger Component without wasting resources each editor frame.
    - Divisions : Divides the grid into discrete number of divisions in X, Y and Z axes.
    pasted image 0.png pasted image 0 (1).png
    Having “Use Local Orientation” enabled will generate the grid by using the rotation of the main object.

    - Fixed Size : Divides the grid where you specify the fixed length of the grid regions
    unnamed.png
    pasted image 0 (2).png

    Offset and Length can be set for each Merger Component, or by enabling “Use Global Parameters”, it will use the settings in the MergerGlobalOptions Scriptable Object.


    That's the whole setup of the new Grid Generation in V1.2 of Advanced Merger Toolkit.
    And again, the asset will slightly increase it's price to 40$ for V1.2, so be sure to get it 5$ off until it's accepted to the Asset Store.
     
    Last edited: Dec 17, 2018
    Lars-Steenhoff likes this.
  19. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    1,807
    I'm about to buy this asset, I have used other solutions before but this one seems to support a lot of features.

    Does it work well with sub meshes?
    And skinned meshes?

    And tiled textures?

    Thanks
     
  20. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    The tool does support and works very well with sub meshes/multiple materials per renderer and tiled materials.
    At the moment it does not support skinned meshes, but it will be added in a future update.
     
    Lars-Steenhoff likes this.
  21. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    Well, that was a lot faster than i expected. I was expecting it to be accepted in at least 2 days but was accepted earlier today.

    V1.2 of Advanced Merger Toolkit is now live on the Asset Store featuring Grid Generation!

    I'll be adding a few small features very soon to improve iteration times and give more options to the LOD merging system.
     
    Lars-Steenhoff likes this.
  22. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    1,807
  23. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    That's something that i've been wanting to add support for even before launching the asset.

    If the asset offers a way to bake the imposter by script, then i guess it could work together (with a future update).
    I could also make it so the LOD could use a specific group of objects (in the scene or project folder) for the last LOD, instead of doing a merge for it. That would support the imposters and even more. (would need to manually bake before being able to use it, but would be a generic solution)

    I don't have Amplify Imposters, but i'll see what i can do.
     
    Lars-Steenhoff likes this.
  24. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    Also submitted a new V1.2.1 update.

    Change List:
    V1.2.1:
    - Added option to disable saving Prefab and Meshes when performing Merge (up to 35% performance boost but increased scene size)
    pasted image 0 (6).png
    - Added Auto-Merge on Startup (With global option to disable this)
    - Added Auto-Enable Combined Collection on Startup
    - Added Auto-Delete Raw Collection on Startup
    pasted image 0 (4).png
    - When only using one LOD in the Merger Component, and “LodGroup Transition %” is set to zero, then the Merger won’t generate a LodGroup component for the final combined object.
    - Improved UI look for the LODs section of the Merger Component.
    pasted image 0 (5).png
    - Added static functions in Merger.cs for “Show All Combined Collections”, “Show All Raw Collections” and “Merge all Collections” for easy access by script and run-time
     
    Lars-Steenhoff likes this.
  25. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    With the increasing number of features being added recently and that i will be adding in the future, the Merger inspector is becoming too cluttered and slightly harder to work with, so for version 1.2.2 i'll be improving the UI to something more organized and better prepared for future features.

    Here's the current UI look:
    ui_old.jpg

    And the new UI:
    UI_new.jpg

    It's still a work in progress, but it's already much easier to work with and to add more features to it in the future.
     
  26. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    With the request from @Lars-Steenhoff , i added a new type of LOD that uses a specific object for that LOD level.

    There are now two LOD types: Default Merger and Specific Object.
    Default Merger is the one that has always been used, and the Specific Object lets you choose an object (from the scene or project folder) to be that LOD level.
    1.JPG

    This adds support for a lot of things you may want to do (a custom mesh for far away distances or even Amplify Imposters)

    2.JPG

    For testing, you can see here that i chose the Chair_1 GameObject that's in the scene, and used it for LOD2 of the combined object. I could have used the prefab from the project folder, but i wanted to have the chair in a specific position and with larger scale.

    The tool will duplicate/spawn the object and set parent to the combined object.
    If the GameObject contains any LODGroup, it will only use the LOD objects for that specific LOD level, and delete the other GameObjects linked to the other LODs in those LODGroups.

    LOD1:
    4.JPG
    LOD2:
    3.JPG

    I'm still ironing out some things and making sure everything works.
    I haven't tested with Amplify Impostors, but if they work as any other GameObject with a Renderer in a LODGroup, then this should work great.

    Unity still haven't approved V1.2.1, so maybe 1.2.2 will contain the UI improvements from the previous post, plus this feature.

    Let me know if there are more features you would like to see :)
     
    Lars-Steenhoff likes this.
  27. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    1,807
    Great looking forward to the update

    Heres a video of how imposters work in amplify

     
  28. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    Hmm, ok, seems like it would support the Merger Tool as is, given that you do the Imposter Bake after the Merge is completed. The Merger tool generates a new combined object, with a LODGroup, and you can then do the Imposter Bake on that. So even without the new feature above, you can already use Amplify Imposters.

    I would like to at least add some functionality so that the Merger tool calls the Imposter Bake automatically, and sets everything up correctly. I'll see what i can do about that.

    Still have some more features on the roadmap that i want to add next, like skinned mesh support and custom components.
     
    Lars-Steenhoff likes this.
  29. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    For version 1.2.4, i'll be adding the ability to duplicate the Raw Collection and include specific components from the objects inside the Raw Collection.

    Exclude.jpg
    The first option "Extract Unity Colliders" is the same option that's already included in previous versions, that will create a new GameObject for each Unity Collider it finds in the Raw Collection and insert them into a new "Colliders" GameObject.

    The "Include Custom Components" option will duplicate the Raw Collection, and then will remove all components defined below from all children of the duplicated GameObject.

    I included the most common Components you might want to remove, like colliders and LODGroup/Renderer/MeshFilter components. These are specified in code which is less expensive than the next option.
    If you think there are more common Components that can be included there, i could possibly add them in the options.

    Then there's the "Exclude Specific Components" list, where you define the components you want to remove by name. The name must be an Assembly-Qualified Name.
    I didn't research this too much, but was guided by this thread where this is better explained: https://forum.unity.com/threads/cant-get-type-from-string.484723/#post-3156023


    I didn't do the other way around (Include only specific Components by copying components), because it can introduce a lot of problems when trying to copy components around (not even officially supported, although it is possible https://answers.unity.com/questions/530178/how-to-get-a-component-from-an-object-and-add-it-t.html).
    This way is safer, but a bit more expensive.
    You don't need to use this feature, but can be helpful for some exceptions.

    And since the Settings UI is also getting a bit full, i added the ability to show/hide the several sections:
    Capture.JPG

    Hopefully Unity will accept the 1.2.1 version this week, and i'll be able to submit the next few ones very soon.
    Let me know if you think this could be improved in any way.

    Also, don't forget to leave a rating/review on the Asset Store :)
     
    Lars-Steenhoff likes this.
  30. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    V1.2.1 is now live on the Asset Store!

    Here's the change list:

    V1.2.1:
    - Added option to disable saving Prefab and Meshes when performing Merge (up to 35% performance boost but increased scene size)
    - Added Auto-Merge on Startup (With global option to disable this)
    - Added Auto-Enable Combined Collection on Startup
    - Added Auto-Delete Raw Collection on Startup
    - Added static functions in Merger.cs for “Show All Combined Collections”, “Show All Raw Collections” and “Merge all Collections” for easy access by script and run-time
    - When only using one LOD in the Merger Component, and “LodGroup Transition %” is set to zero, then the Merger won’t generate a LodGroup component for the final combined object.
    - Improved UI look for the LODs section of the Merger Component.

    I also already submitted V1.2.2 to the Asset Store. It's a smaller update where it includes a new UI for the Merger Inspector that will improve the workflow.
     
  31. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    V1.2.2 has also been released today on the Asset Store!

    It includes the new Merger Inspector UI with better workflow.

    I also already submitted V1.2.3 to the Asset Store. It features the ability to use any custom object for a specific LOD, so, for example, if you want a custom made mesh just for the last LOD, or use an imposter for the last LOD, you can set it up with this new feature.

    You can learn more about it in this post: https://forum.unity.com/threads/v1-...e-easy-powerful-workflow.577639/#post-4045885

    V1.2.4 is also almost complete with the ability to include custom components.
     
    Lars-Steenhoff likes this.
  32. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    1,807
    Nice progress!!
     
    eskovas likes this.
  33. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    For anyone using Unity 2017.3+, please make the following change in the MergerGenerator.cs, at line 459 in the latest version to fix an error:
    "if (totalVertexCount >= VERTICES_LIMIT || main.LimitTo8BitIndexVertices) {"
    to
    "if (totalVertexCount >= VERTICES_LIMIT || !main.NoVertexLimitPerMesh) {"

    and in Editor_Merger.cs, at line 331:
    from
    "Editor_InspectorFields.CreateEditorBoolField(myTarget, "No Vertex Limit per Mesh", ref myTarget.limitTo8BitIndexVertices);"
    to
    "Editor_InspectorFields.CreateEditorBoolField(myTarget, "No Vertex Limit per Mesh", ref myTarget.noVertexLimitPerMesh);"

    I already submitted an hotfix with the new version that's coming out.
     
  34. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    V1.2.3 is now live on the Asset Store!

    Here's the change list:
    - Added a new LOD type which offers the ability to choose a specific object for a specific LOD. (Use a custom mesh, imposter, etc)
    - Fixed error for Unity 2017.3+

    Next version 1.2.4 should be ready soon with the ability to include custom components. More info here: https://forum.unity.com/threads/v1-...e-easy-powerful-workflow.577639/#post-4053370
     
  35. HakJak

    HakJak

    Joined:
    Dec 2, 2014
    Posts:
    165
    Finally! Looks like something better than Mesh Baker is cooking up. The feature list seems to fill in some gaps already. Buying this today to support you and I'll be trying it out sometime next month.
     
    eskovas likes this.
  36. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    Thank you very much! let me know what you think of it and if you have feedback or feature requests :)
     
  37. jfran227

    jfran227

    Joined:
    Dec 29, 2017
    Posts:
    12
    Why do I have 4x the amount of verts in the combined then in the raw/ unmerged version. Shouldn't they be the same?

    Combined.PNG
    Raw.PNG
     
  38. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    That's what comes with combining objects together that have LODs.
    Each object has a LOD so in the Raw image you are seeing all objects rendering different LODs which results in less verts/tris.
    In the combined image you are seeing LOD0 of the combined object, which includes all LOD0 objects, which will result in higher tris/verts but still have much better performance.
    To counter this, you can use the grid feature that will generate multiple combined objects in a grid that will better render large amounts of objects in large areas, like i explained in previous posts.
     
  39. jfran227

    jfran227

    Joined:
    Dec 29, 2017
    Posts:
    12
    Thankyou for your quick reply. I have been playing around with the tool a bit today and I must say it is really good and easy to use. But for some of the meshes it combines them in a weird way it creates duplicates of it and then I have z fighting. I was wondering if there was a way where you could select an object so it doesn't get combined with the other objects.
     
  40. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    Thank you very much :)

    I never encountered a situation where it would duplicate a mesh when doing the merger. Although, when trying to replicate your issue i did find out that the merger is also including objects that have their Mesh Renderer disabled, so maybe that could be the problem your having. I'll include a fix for this in the next update.

    About excluding an object from being combined, the best way right now is just for the object to not be inside the Raw GameObject.
    Another way is if all its materials are specific to that object, and they are not used by any other different object, then you can add those materials to the "Materials to ignore" list in the LOD section of the Merger Component, but the original object will also be disabled after the merger because it's inside the Raw GameObject.

    I'll add an easy way to not include a GameObject in the Merger and it still appearing after the Merger. Only thing is that for this to work and to keep the rest of the tool consistent, the object is going to have to be duplicated from the Raw GameObject to the Combined GameObject.

    In this tool, i never make changes to any original object inside the Raw Collection, because you can then go back, edit anything and merge again. So only way to exclude an object from the Merger, that's inside the Raw GameObject, but still want it to appear after the merger, is to duplicate it out of the Raw GameObject.
     
  41. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    Version 1.2.4 has been submitted to the Asset Store!

    Here's the change list:
    V1.2.4:
    - Added the ability to include custom components by duplicating the original raw collection
    and removing not needed components.
    - Added ability to exclude GameObjects, that are inside the Merger's Raw Collection, from the Merger.
    - Added ability to generate cloned GameObjects of specific GameObjects inside the Raw
    Collection. These cloned GameObjects are inserted into a “Cloned GameObjects”
    GameObject inside the Combined Collection.
    - Added option to easily clear the Combined Collection and re-enable Raw Collection with a
    button in the Merger Component
    - Added global option to clear all Combined Collections and re-enable all Raw Collections
    by going to Window/AdvancedMergerToolkit/Destroy All Combined And Show Raw
    Collections.
    - Fixed bug where the Merger algorithm would include a GameObject with a disabled
    Renderer Component.


    In-Depth:

    The main feature in this update is the ability to include custom components by duplicating the original objects and removing not needed components. For more info check this post: https://forum.unity.com/threads/v1-...e-easy-powerful-workflow.577639/#post-4053370

    As requested by @jfran227, i added a couple of new options:
    1.JPG

    The "MergerObject" Component now includes two new options:
    - Exclude GameObject from Merger: This will make it so the Merger won't include any Mesh from this object and all its children in the combined GameObject.
    - Generate Cloned GameObject: This will clone the object and put it inside a new "Cloned GameObjects" GameObject that will be inside the Combined Collection.

    Like i explained before, it would still be preferable to have these objects outside of the Raw Collection so they are not included with the Merger, but now there are a few extra options if it's actually needed.

    In order to use the "Generate Cloned GameObject" option, the "Allow Cloned GameObject Generation" variable must be set to True in the Merger Component the object belongs to.
    2.JPG
    I made it this way because to clone these specific objects i will be using GetComponentsInChildren to find all MergerObject components. If you don't need to clone objects, then you can just turn it off (it's already off by default), and it won't need to get the components, saving on performance.


    I also added another functionality:
    3.JPG

    To easily clear the Combined objects, without having to manually delete them and then click on the Raw button, i made the "Clear Combined" button, that will delete the combined objects and re-enable the Raw Collection.

    Also added a global button to do this to all Merger Components in the scene:
    4.JPG



    Hope you all like this update! :)
    I'll be working on V1.3 next. If you have more feedback or feature requests, please let me know!
     
    Last edited: Jan 14, 2019 at 11:31 PM
  42. jfran227

    jfran227

    Joined:
    Dec 29, 2017
    Posts:
    12
  43. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,289
    Version 1.2.4 is live on the Asset Store!

    http://u3d.as/1k1d


    V1.2.4 Change List:
    - Added the ability to include custom components by duplicating the original raw collection
    and removing not needed components.
    - Added ability to exclude GameObjects, that are inside the Merger's Raw Collection, from the Merger.
    - Added ability to generate cloned GameObjects of specific GameObjects inside the Raw
    Collection. These cloned GameObjects are inserted into a “Cloned GameObjects”
    GameObject inside the Combined Collection.
    - Added option to easily clear the Combined Collection and re-enable Raw Collection with a
    button in the Merger Component
    - Added global option to clear all Combined Collections and re-enable all Raw Collections
    by going to Window/AdvancedMergerToolkit/Destroy All Combined And Show Raw
    Collections.
    - Fixed bug where the Merger algorithm would include a GameObject with a disabled
    Renderer Component.

    Check the previous post for the detailed information on these changes.