Search Unity

[RELEASED] Mesh Combine Studio 2 (Boost Performance)

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

  1. eagle555

    eagle555

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

    Thanks everyone for your feedback. I submitted the MCS updates to the Asset Store yesterday and they got accepted today.

    Mesh Combine Studio 2.7:

    Features:
    - Combine Conditions, where you can choose the condition (material, mesh renderer settings, layer and static flags) which meshes should be combined and which should be combined separately. E.g. if you use different shadow casting modes. Now it's also possible to make a separate combined mesh for the shadows which in many cases you can combine different materials into 1 big mesh and weld the vertices (so 1 normal combine with shadow casting off and another MCS instance for combining all materials into 1 and use shadows only). This can reduce the draw calls/vert count on the shadows even more, and that can help a lot with e.g. 4 cascades where shadows are rendered 4x.
    - Welding vertices for shadow casting only mode.

    Improvements:
    - GUI foldout for each category.
    - GUI alignment.
    - Progress bar when saving meshes.

    Fixes:
    - 'Parent transform scale + child scale' would result in wrong scaling on combined meshes.
    - Meshes that had read/write disabled would get re-imported multiple times when clicking the enable read/write button.
    - With the `Copy Baked Lighting` option the combined meshes would loose their lightmap index after going to play mode or back.

    MCS Caves and Overhangs 1.1:

    Fixes:
    - 2 vertices on the same position would throw an error.

    upload_2020-6-12_21-1-10.png
     
    julianr and Weblox like this.
  2. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    @eagle555 - So happy to see this is still active and in development. I'll update my Projects right away ! :p
     
    julianr and eagle555 like this.
  3. dl290485

    dl290485

    Joined:
    Feb 4, 2018
    Posts:
    160
    @eagle555 here is the MCS object inspector. I'm using Deferred. There are two directional lights, with only 1 casting realtime shadows. No baked lighting.

    Also while I'm at it,I'll mention that after doing the combining, having the inspector on the MCS object creates a HUGE lag.I'm talking a quick scroll of the mouse wheel, count to two, then it moves down that tiny bit. It's so bad I couldn't click and drag the inspector to undock it to take this screenshot better until I clicked on to another object. This is on an i7700k with 16gig ram.

    upload_2020-6-13_14-14-32.png
    upload_2020-6-13_14-15-16.png
     

    Attached Files:

  4. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    How about shadows on point and spot lights? You use any? As for the lag this seems to be an Unity 2017 issue. In U2019 it doesn't happen. I will look into fixing this.
     
  5. dl290485

    dl290485

    Joined:
    Feb 4, 2018
    Posts:
    160
    There are no other lights lights enabled in the scene, other than the two directional ones I mentioned.
     
  6. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    Ah ok, that's not causing the increase then. Can be the Lod settings for the combined meshes, but I see you only use 13 objects, so that's not likely. The other thing it can be is the culling, can you try with cell size 16 and show the MCS inspector results and stats window like before?

    Btw the MCS inspector lag is caused by that it's a prefab. If you click on the `MeshCombineStudio` GameObject and click Unity Menu => GameObject => Break Prefab Instance, it will be fixed. I will make that it does it automatically.
     
  7. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    Here's the update will also submit to the Asset Store now...

    Mesh Combine Studio 2.71

    Improvements
    - Will break the prefab instance in <= Unity 2018.2, so MCS inspector is responsive.

    Fixes
    - Saving meshes now works correctly with the progress bar.
     

    Attached Files:

    julianr and GCatz like this.
  8. GoldFireStudios

    GoldFireStudios

    Joined:
    Nov 21, 2018
    Posts:
    160
    Any plugin/script trying to access `LightmapSettings.lightmaps` is broken as of the latest MCS update since LightingSettings.cs is overwriting that reference. I'm getting lots of the following error from various scripts outside of MCS:

    'LightmapSettings' does not contain a definition for 'lightmaps'
     
  9. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    Thanks for pointing that out. I forgot to add the MeshCombineStudio namespace to that script. With the update in attachment is it fixed now?
     

    Attached Files:

    hopeful likes this.
  10. GoldFireStudios

    GoldFireStudios

    Joined:
    Nov 21, 2018
    Posts:
    160
    Yes, that fixes it, thanks!
     
    hopeful likes this.
  11. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    I submitted it to the Asset Store yesterday, and it's updated now:

    Mesh Combine Studio 2.72:

    Fixes
    - Excluding 32 bit meshes from combining
    - LightmapSettings script didn't have the MCS namspace
     
    julianr and GoldFireStudios like this.
  12. Wulf-Games

    Wulf-Games

    Joined:
    Apr 5, 2016
    Posts:
    9
    Hello!

    Just purchased this asset to help us improve performance on our game using HDRP, so far we are happy with the results but there's a feature we were looking forward to and we can't find it (Remove Overlapping Tris).

    I saw the video and it seems we don't have the option to remove overlapping tris:

    upload_2020-6-16_17-12-20.png

    On the video, there's an option on output settings:

    upload_2020-6-16_17-14-20.png


    Was there a change for it's usage? and if so, where is it now?

    Also, what do you recommend for best practices on HDRP using your tool.


    Thank you!
    Looking forward to a boost in performance.


    Cheers
     
  13. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    Hey,

    Thanks for the purchase. The inside geometry removal is an extension for MeshCombineStudio:
    https://assetstore.unity.com/packages/tools/terrain/mcs-caves-overhangs-144413

    I wanted to put on a card in the video mentioning that, but it's not possible. It's in the video title/description though and also in the description of MCS on the Asset Store.

    HDRP does a depth pre-pass, so first draws all opaque meshes with a very cheap shader that writes only inside the depth buffer. So with the second pass where everything gets drawn with the real materials it will avoid overdraw in the pixel shader, as the GPU skips pixels that are behind pixels in the depth buffer. This leads to double draw calls though and double vertex processing and cell combining will help a lot reducing the draw calls. Removing geometry will help reducing vertex processing.

    As for testing the difference before and after combining, make sure the vert/tris count in the stat window doesn't increase too much after combining and to check performance difference it's best to do in a build. The bigger the cell size the lower the draw calls but frustum culling gets less efficient because of mesh bounds getting higher (which increases vert/tris more triangles get outside of screen bounds, the pixel shader will be skipped, but vertices still will be processed). There's a sweet spot for best cell size depending on the situation, best is to check different cell sizes to see which works best.

    I'm curious how does HDRP work out for you? I've only made some test projects with it so far. We're still using standard rendering in our game.

    Cheers,
    Nathaniel
     
    Last edited: Jun 17, 2020
    hopeful likes this.
  14. Sholms

    Sholms

    Joined:
    Nov 15, 2014
    Posts:
    85
    Hi, I have the cave system too, but I cant find this option there.
     

    Attached Files:

  15. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    It should look like this now:
    upload_2020-6-18_7-25-24.png

    That option is handled automatically now...
     
    Last edited: Jun 18, 2020
    Weblox likes this.
  16. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    Hi @eagle555 - I'm using MCS in nearly all af my Scenes and love it a lot, but I still have some UseCase Questions, that Im not fully clear about:

    - When working with Prefabs, what Level do we make the Prefab? I suppose not from the Mesh Combine Studio GO, so I use to make it from its "Cells" child GO. Is that the correct way? Also do we need to keep the script on the combined meshes (in the Prefab)?

    - When using the "Remove overlapping tris" option, at times I find undesired wholes in my optimized Geometry. I suppose in such cases every "overlapping tris" are removed. ( E.g. Two tris overlap and both get removed, what causes a whole in the Geometry.) I further assume that in such a case of two overlapping tris only one of them should be removed, to keep the remaining Geometry intact after optimization. What can I do to remove unnecessary tris without breaking my Geometry? I always set the "overlap layer mask" to the layer my Geometry is on. Is that the correct way?

    - After optimizing with MCS, batching and drawCalls are improved alot, but as you mentioned before, verts and tris count is (sometimes a lot) higher. What can I do to improve verts and tris count? -> I tried increasing cell sizes up to 256/512 but that seems to be a very high number (for frustrum culling), compared to the default value...

    - Since the FBX exporter tool is out my workflow changed quite a bit. After optimizing my Scene with MCS (to Prefab) I export the Prefab to FBX and reexport with 3DSMax to reduce filesize.My next step would be to further optimize the created FBX with Mesh Baker to reduce DrawCalls with Texture Atlas baking and go through FBX exporter and 3DSMax again.

    - Do you have any plans to implement Texture Atlas Baking into MCS? This really would make MCS an allround optimization solution and save so much time in my situation... (pretty plz :p)

    Thanks in advance and keep up the good work...
     
    Last edited: Jun 18, 2020
  17. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    Hi Weblox,

    Thanks, that are good questions:

    1). Yes you can make a prefab from the "Cells" child GO. You can remove all scripts from the prefab. It's handy to keep the LODGroupSetup script though in case you use LOD groups.

    2). We also sometimes have cases where it happens on our arenas. I will look into fixing this...

    3). The vert/tris count in the result should never be higher, but in Unity's stats window it can be higher:
    The bigger the cell size the lower the draw calls but frustum culling gets less efficient because of mesh bounds getting bigger (which increases vert/tris more triangles get outside of screen bounds, the pixel shader will be skipped, but vertices still will be processed). There's a sweet spot for best cell size depending on the situation, best is to check different cell sizes to see which works best.

    * Forward Rendering. For each point/spot light each mesh in their range will be redrawn, same applies here regarding cell size. Deferred Rendering doesn't have this issue because all lights are rendered in screenspace.
    * Directional Light shadows, same applies here regarding cell size.
    * Point/Spot Light shadow, same applies here as the forward rendering, only the shadows in range need the meshes to be redrawn, so same applies here regarding cell size.

    4) How are you able to reduce the FBX size from 3DS Max? Is that automatic? Does Mesh Baker still has texture atlassing or only texture arrays? As I don't see texture atlassing in the description on the UAS anymore...

    5) Yes I plan to start working on Mesh Combine Studio 3 after I finish (takes a few more days) my new Asset called 'Debugging Essentials'. A big time/headache saver when it comes to debugging/testing. I submitted it to the Asset Store on 7 June, can get accepted any moment...I recently made the runtime hierarchy and deep inspector, because I had enough of wasting time on making offline builds/compiling/restart/reproduce, etc. More info about it soon...
    upload_2020-6-18_20-52-47.png

    Mesh Combine Studio 3 will have the following added features:
    * Split triangles per cell. Which only works for non-lod meshes, which will make culling/shadows more efficient. And with this we will be able to split big 32bit meshes. In our arenas we have big 32bith meshes like buildings, pipes, handrails and terrain that our artist exported as 1 big mesh out of the 3d program. So currently we don't have this optimal and with this feature we can optimize this.
    * Depth prepass. Can help with avoiding overdraw, we use it in our arenas and it helps quite a lot with performance.
    * Texture arrays to combine materials. I will also add atlassing if it has some pros over texture arrays.
    * Mesh simplification for making lod meshes.

    I think with this it will be the most complete mesh combining solution available for Unity. Any feature that I'm forgetting?
     
    Weblox likes this.
  18. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    @eagle555 - Thanks a lot for your quick and detailed answers.

    1.) Awesome. I still need to figure out the best way to integrate LODs into my workflow when exporting to FBX. I assume we could re-add the LODGroupSetup Script to our optimized meshes...

    2.) I'm very excited about this... :p

    3.) Okay, thats alot of information. I still have difficulties to understand different rendering methods, but atm I tend to mainly combine Geometry and keep Special Effects and lights seperated (for the moment). I just had noticed the increase of verts/tris in the Stats window...

    4.) Yes , thats pretty much automatic. Since I have noticed huge file sizes when optimizing Scenes with any meshes that are "rebaked" inside Unity (LODs / Mesh Baker / MCS/ etc...). Exporting to FBX with Unitys FBX Exporter also gives HUGE File sizes. I have exported medium sized Scenes resulting in FBX with over 4GB. Simply opening these huge FBX files in 3DS MAX 2017 and resaving them (as FBX) produces an output FBX file of roughly 160MB (see Screenshot for a smaller example ~ before [~57MB] and ~ after [~3.7MB] resaving the Unity FBX exporter file in 3dsMax). Maybe this is due to a packaging algorythm Autodesk isn't sharing? I have mainly done this with Syntis LowPoly Demo Scenes, but it should be the same with Higher Poly (I hope). I am doing this mainly because I want to easily move things around between Unity Projects, but I am not entirely sure how this practice affects my Projects FPS rates, so I would be happy if you could try this workflow for yourself and share your experience with it. :)

    FBX Max Before after.PNG

    Actually Mesh Baker has both Output Options available. You can optimize to Atlas OR TextureArray if you prefer (I personally like the Atlas better) and it does a good Job, but it also creates (optimized) meshes with those huge filesize (which totally might be a Unity/Autodesk thing). However nothing beats the ease of use that MCS offers, so I am really looking forward to your plans with MCS3.

    5.) I will ofc be following the release and keep an eye out on the new Asset :p - YAY - MCS3 feature list is awesome! I love the LODs feature and ofc especially the Texture Atlasing (the other mentioned too ofc) and can't wait to try it out.

    Thanks a lot for all your answers. I'll be sure to keep an eye on future release & updates!
     
    Last edited: Jun 19, 2020
  19. Wulf-Games

    Wulf-Games

    Joined:
    Apr 5, 2016
    Posts:
    9

    Thanks Nathaniel,

    I bought the package and it's working great, so far we´re having an increase in performance, though we need some work on the scene to use it to its full potential I can see.

    The scene is a little big so it takes some time to finish removing the vertices.

    Thanks for the thorough explanation, as for HDRP:

    We decided to go with it because it gives us the atmosphere we were looking for the game plus we're aiming for high end pc and consoles. It's been a lot of learning really, it needs much more attention and time.

    one thing to notice though, we had a problem porting the game from built in to HDRP, for some reason an empty project worked better on performance so we just passed everything over on packages. The first try had weird graphics issues and weird errors. You can see some of those graphic issues here: https://www.wulfgames.co/devblog

    Hope that helps for when you decide to port over or create a project on HDRP, if you're not aiming for high end or (ps4/xbox) I recommend URP (It runs much faster than built in and doesn't require as much attention as HDRP).


    Cheers!
    Thanks for the awsome tool
     
  20. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    3). The biggest difference between `Forward` and `Deferred` rendering mode is that 'Forward' from the shader only writes into 1 render texture target outputting directly the final colors (this is faster, but lights have to redraw the geometry around their bounds, so lots of lights can make it slower). While in 'Deferred' (in Unity) the shaders render to 4 render texture targets: Diffuse, Specular, Normal and Emission. This way the lights can be applied as an 'image effect', Unity only draws a light as a quad in screenspace. 'Deferred' rendering still uses a 'Forward' rendering pass for transparent objects...Unity standard rendering has 'Forward' and 'Deferred' rendering option. URP currently is only 'Forward' (will as get a 'Deferred' rendering mode) while HDRP is 'Deferred`.

    There must be a reason for the difference in file size. Maybe the Unity FBX export includes the textures and the 3DS Max one not? Textures take most space...

    Oki I will add Texture Atlassing then as well ;)
     
    Last edited: Jun 19, 2020
    hopeful and Weblox like this.
  21. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    Great to hear your performance is increasing with MCS. Feel free to leave a review...

    Thanks for explaining your HDRP experience. Yes we're planning to migrate to URP as soon as it gets a 'Deferred' mode, as we do a lot of custom rendering and in HDRP this is more tricky. We also aim for high quality graphics:
    https://store.steampowered.com/app/987020/DRONE_The_Game/
    We have quite good results with standard rendering, but we rewrote a lot of rendering stuff...E.g. our buildings/dynamic/static objects are all rendered with 1 material and one big texture atlas. Our graphics programmer made quite an impressive decal system. We can spawn an insane amount of decals like 32k without much performance overhead all have POM (fakes depth look) and overlapping takes decal depth into account. During the match the arena turns into a swiss cheese with bullet holes :). Also he improved the screenspace reflections image effect, it runs like 4x faster while reflecting a lot bigger distance. We don't use Unity light probes for the dynamic objects as that kills performance, we use a 3d textures instead that cover the entire arena. Btw we have a free demo on Steam in case you're interested in checking it out...
     
    Last edited: Jun 19, 2020
    hopeful likes this.
  22. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    @eagle555 - Thanks for taking the time to explain all this. I will dig deeper into this to get a better understanding ...

    No actually there are no textures included in both files (only blank Materials ofc). But now you got me all curios, can you plz make a test yourself and check the output ? Just take an already MCS optimized Scene, export with FBX exporter, import and resave the FBX with 3dsMax (I have V.2017). Since I am not a very professional User it would be great to hear about your point of view on this... (and also if it is a good practice to keep or not).
     
    Last edited: Jun 19, 2020
  23. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    Oki I will take a look into this...
     
    Weblox likes this.
  24. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    @eagle555 - Awesome...did u have a chance to test already?
     
    Last edited: Jun 21, 2020
  25. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    Yes I did ;) What's happening is that the Export Format of Unity's FBX exporter is on 'ASCII' on default. This is text file format which takes ~10x more disk space than 'Binary' (Also happens to Unity Scenes if you save them to text files instead of binary). What you need to do is select the 'Binary' export format and then the file size is 10x smaller like the result you get in 3DS Max:

    upload_2020-6-21_19-35-4.png
     
    Weblox likes this.
  26. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    @eagle555 - That was fast! Also that's great information and good to learn. Thanks so much for taking the time to test, this will help alot! :p
     
    eagle555 likes this.
  27. occupiedsince85

    occupiedsince85

    Joined:
    Mar 31, 2020
    Posts:
    2
    Hello, I just purchased MCS2 and was wondering if there's tutorial of how to use it. So far I don't see it do anything.. I tried watching demo video but no matter what I do, nothing happens.

    I am currently using unity 2019.3.15f
     

    Attached Files:

  28. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    Hi, thanks for purchasing. Yes it's explained in the documentation as well. Does the link not work for you?
    http://www.terraincomposer.com/mcs-documentation/

    Can you show me a screenshot of your Unity window and how the MCS Inspector is setup?

    All you need to do is:
    1). Drag&drop the MeshCombineStudio prefab in your Hierarchy window.
    2). Drag&drop the GameObject parent in the 'Parent' slot in 'Search Options' in the MCS Inspector. This parent should contain all the GameObjects with the meshes you want to combine, can be LOD Group GameObjects as well as MCS supports LODs.
    3). Click the 'Combine' button.
     
  29. occupiedsince85

    occupiedsince85

    Joined:
    Mar 31, 2020
    Posts:
    2
    hello! Thank you so much for responding. I tried all of the above, but when I combine, the game objects disappear. and I don't see the sectorial split like in video. I think I need it a little bit more newbied out lol.

    so, whenever I search or combine it destroys the object. do I have the settings selected properly?
    upload_2020-6-24_9-58-11.png

    when I click on search or combine nothing happens. Also, the Condition filter doesn't let me do dropdown under either of the options like in the image from the online manual.


    When I move objects under MSC, it destroys them on search or combine.

    upload_2020-6-24_10-6-0.png
    upload_2020-6-24_10-20-59.png

    so I am not sure what I am doing wrong. I didn't find the Draw Gizmos option either to see the cells. I am likely just missing something fundamental in the process. If I could trouble you to provide screenshots with step by step with highlights, I would really (super) appreciate it!
    Thank you so much!
     

    Attached Files:

  30. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    Hi, thanks for your detailed screenshots. You don't need to modify the 'Search Options', the settings on the default prefab are fine to start. I think it might be because of the backface removal, looks like your screenshot you don't want it in this case. I explain in the manual how to use it...

    I recommend to start over again:
    1). Delete this MCS prefab and drag&drop the MCS prefab again in your Hierarchy.
    2). You can put all rocks in a parent GameObject and assign this parent GameObject to the 'Parent' in 'Search Options'.
    3). Click 'Combine' button. Does this work?
    4). Try the 'Remove Tris Below Surface' in 'Output Settings'. Click 'Combine' again, does it still work? And are the triangles below the terrain removed?
     
  31. Sholms

    Sholms

    Joined:
    Nov 15, 2014
    Posts:
    85
    I'm traying to use it, but its no working, I'm traying to delete the vertices at the same position.
     

    Attached Files:

  32. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    Ah yes, I think I only released it on the forum here. Thought I automated it, but didn't. I implemented it again and also noticed that removal gets more inaccurate the more away from the scene origin the meshes are. So I offset combined cells and colliders to the Scene origin now (only when removing) which gives accurate results.

    I have submitted it to the Asset Store and they both are accepted already ;)

    Mesh Combine Studio 2.74:

    Fixes
    - Wasn't working on Unity 2019.1 as had dependent compilation error.
    - Vertex welding gave an error when using geometry removal.


    MCS Caves and Overhangs 1.2:

    Features

    - Remove same position triangles. E.g. will remove insides of cubes that are snapped together.

    Improvements (MCS Caves and Overhangs)
    - Removal of overlapping triangles more accurate.
     
    Last edited: Jun 25, 2020
    julianr likes this.
  33. Sholms

    Sholms

    Joined:
    Nov 15, 2014
    Posts:
    85
    I tried again with both updates, but still not working.
     
  34. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    Can you try it with this tweak? (gives a bit more snapping tolerance...)
     

    Attached Files:

  35. franky_li

    franky_li

    Joined:
    Aug 8, 2016
    Posts:
    163
    @eagle555 Just bought your asset and have the problem, that each combine disables the colliders in the original assets. The combined stuff has no colliders then and if I use the output option to add mesh colliders, parts of the geometry are disappearing in the combined object.
    Any suggestions what goes wrong?
     
  36. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    Hi, thanks for purchasing. Can you show a screenshot/s of your settings in the MCS Inspector?
     
  37. franky_li

    franky_li

    Joined:
    Aug 8, 2016
    Posts:
    163
  38. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    Thanks, the settings look ok. I'm able to reproduce the original colliders deactivating, it's something I introduced by mistake with the new update. The fix is in the attachment, will also submit to the Asset Store.

    As for the geometry disappearing can you show screenshots of that?
     

    Attached Files:

  39. franky_li

    franky_li

    Joined:
    Aug 8, 2016
    Posts:
    163
    It seems that your asset is also changing colliders that not belong to the combine group, after working with your asset my terrain collider and my players collider were disabled and I have no clue what colliders else were disabled now, what a mess!
     
  40. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    Just reload your Scene and don't save it. Should be fine with the fix...
     
  41. franky_li

    franky_li

    Joined:
    Aug 8, 2016
    Posts:
    163
    Just found, that all colliders in my project are disable now, all props, animals, trees, my whole project is broken:(
     
  42. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    That is not possible with my code. I search only for colliders in the loaded Scenes in the Hierarchy window...
     
  43. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    Code (CSharp):
    1. static public void SaveCollidersState(LayerMask layerMask)
    2. {
    3.     var sceneColliders = Methods.SearchAllScenes<Collider>(false);
    4.  
    5.     int layerMaskValue = layerMask.value;
    6.  
    7.     for (int i = 0; i < sceneColliders.Count; i++)
    8.     {
    9.         Collider collider = sceneColliders.items[i];
    10.         GameObject go = collider.gameObject;
    11.  
    12.         if (collider.enabled && go.activeInHierarchy && Methods.LayerMaskContainsLayer(layerMaskValue, go.layer))
    13.         {
    14.             collider.enabled = false;
    15.             colliders.Add(collider);
    16.         }
    17.     }
    18. }
    19.  
    Can see the code here. It's in CreateOverlapColliders.cs in line 54. It only disables colliders from active gameobjects that are on the layer that needs triangle removal.
     
  44. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    Do you have Skype/Discord? I can help you in a call to revert it...
     
  45. franky_li

    franky_li

    Joined:
    Aug 8, 2016
    Posts:
    163
    What happens when the gameobjects are on the default layer and the default layer is selected as overlap layer mask. It will disable all colliders on the default layer?
     
  46. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    It disables them while combining, but enables them again after...
     
  47. franky_li

    franky_li

    Joined:
    Aug 8, 2016
    Posts:
    163
    It seems that this is not always working, I could see that it sometimes keep the colliders but sometimes they stay disabled, even with your patch. I enabled the terrain collider (terrain is on a separate layer) did a combine and the collider was disabled. Enabled it again, did an other combine and then it stayed enabled. So it's a kind of unpredictable.
    I'll restart from a backup and try it again.
    You should only touch colliders that are in the branch of the given parent object, I guess.
     
  48. franky_li

    franky_li

    Joined:
    Aug 8, 2016
    Posts:
    163
    OK, I started with a fresh backup and your patch and now it seems to work like expected:)
     
    julianr and eagle555 like this.
  49. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    It was quite tricky to make, could have been more simple/faster by directly using `collider.Raycast` but Unity had a bug in backface collision detection only when using raycast on the collider directly. Maybe in the meantime this got fixed, will look into it. But the work-around is like it currently is that all colliders on the layer need to be disabled to not interfere with the inside geometry detection.

    Oki good to hear. MCS Caves & Overhangs has been released for 14 months and nobody had this issue before. I made it in such way that always everything can be reverted easily by undoing the combining. I introduced the bug with the update of last Thursday. Thanks a lot for pointing this out...I submitted the fix to the Asset Store...
     
  50. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    Hi @eagle555 - So the Release available on the Store atm is MCS 2.7.4 and Caves & Overhangs 1.2 ... Is this the fixed updated Version already or should we still wait for the next Version number?

    Also great to see how much work is being put into this Asset, I can't wait to try the improved removal of overlapping triangles... :p
     
    eagle555 likes this.