Search Unity

[RELEASED!] Non-Convex Mesh Collider. Automatic Generator

Discussion in 'Assets and Asset Store' started by Plawius, May 9, 2019.

  1. Plawius

    Plawius

    Joined:
    Feb 27, 2014
    Posts:
    44

    You want to have dynamic concave colliders, to create something like this:

    But 'Non-convex MeshColliders with non-kinematic Rigidbodies are no longer supported in Unity 5.0':mad:?

    And probably you also don't want to spend days creating compound convex colliders in Unity using other solutions available on Asset Store?

    Then you could use our automatic generator! Click here!
    Need fast, accurate physics but tired of `painting` each triangle to make convex colliders? Just click `Generate`!

    It works in Unity Editor.
    And it works in runtime, so you can bake concave colliders for procedural geometry! (Windows, macOS, Linux support is ready so far. If you want to have other platforms - please let us know)

    Industry-standard automatic generation algorithm that other big engines are using!
    This asset will save you and your artists tons of time (and money)
    We would love to hear your feedback!

    Asset store link: https://assetstore.unity.com/packag...nvex-mesh-collider-automatic-generator-117273
    :rolleyes:
     
    Last edited: Jun 22, 2021
  2. Marcu_poilu

    Marcu_poilu

    Joined:
    Jun 7, 2019
    Posts:
    1
    Hello,

    I'm a new buyer of the Non Convex collider package and I find it great, it fits my needs pretty well.
    I'm using trigger AND collision detection in my game and I noticed a problem using the package.
    It's a logical problem, my trigger exit and enter gets called a lot because unity trigger systems considers that the mesh is composed of several Mesh Collider (that is the case) My question was : I wonder if there is a possible way (included in your package) to "fuse" the collider together, or to make them act as one big trigger collider ?

    I basically want to keep the generated compound collider but make it work as one big trigger. Thanks a lot in advance for your response !

    Morgan Castejon

    -

    Ikimasho's Unity Game Developer
     
  3. Plawius

    Plawius

    Joined:
    Feb 27, 2014
    Posts:
    44
    That's an interesting request. Will take a look at this problem as soon as possible!
     
  4. Utopien

    Utopien

    Joined:
    Feb 15, 2016
    Posts:
    46
    hello very interesting asset how does it handle complex geometry like a house with windows and door hole or cars skeleton or just mesh with hole ? do you have a try version cause concave colliders solution has always been very disappointing work .
     
  5. Plawius

    Plawius

    Joined:
    Feb 27, 2014
    Posts:
    44

    So, unfortunately there is no way to tell Unity or Physix to do what you ask. But I can add a custom logic that introduces OnTriggerEnter/Exit for NonConvex collider itself. Do you think it will be useful?
    If you want to workaround it on your side - you have to track OnTriggerEnter/Exit a bit differently - add a special check 'were we already in a collider of THIS object?'

    That's the whole point of this asset. It uses the industry-standard algorithm (see Unreal Engine). Take a look at the video - chains have holes, and everything is generated well. You can send me geometry, I will send you collider / image if you want.
     
    Utopien likes this.
  6. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    Hey @Plawius ! Thanks for making a great tool. You mentioned wanting to know if people need more platform support - yes, indeed.

    Would you be able to extend support for iOS + Android? And, later, WebGL?
     
    SurferDUDEe likes this.
  7. Plawius

    Plawius

    Joined:
    Feb 27, 2014
    Posts:
    44
    Hi Adrian!

    Runtime generation is windows/macOS only for now. I'm working on another solution for all platforms (including webgl), but it is still in progress. Also, probably WebGL will be slower than you expecting (WebGL doesn't support multithreading)
     
    Fibonaccov likes this.
  8. renel12345_unity

    renel12345_unity

    Joined:
    Sep 13, 2019
    Posts:
    3
    Hello,


    I am looking to purchase something like your asset however I want to spend my money wisely.


    Please let me explain my situation.


    I have a lowpoly water plane (it is not animated at present but I might later). I purchased the SYNTY Polygon Pirate pack and am using one of the ships as a model.


    I want to place a third person character on the boat and switch a camera from outside and behind the boat and then a camera inside behind the character.


    I write to you with respect to the model.


    I will attach a screenshot of the hierarchy.


    The boat child object is a single mesh and it has various floor levels and it’s children are masts and sails in either up or down state.


    The child boat mesh is quite complex and I tried to add a mesh collider to all the children game objects.


    The parent game object has a rigid body component that I access from a boat controller script that I use to propel the boat through water plain using WASD keys.


    When I placed the character inside the boat he walked around just as expected only when the parent game object rigidbody component Is Kinematic is checked on.


    However if I uncheck Is Kinematic on the rigidbody component on the parent boat and run the scene I receive the famous error message:


    Non-convex MeshCollider with non-kinematic Rigidbody is no longer supported since Unity 5.



    If you want to use a non-convex mesh either make the Rigidbody kinematic or remove the Rigidbody component.



    Scene hierarchy path "Boat/SM_Veh_Boat_Warship_01_Hull_Attachments", Mesh asset path "Assets/PolygonPirates/Models/SM_Veh_Boat_Warship_01_Hull.fbx" Mesh name "SM_Veh_Boat_Warship_01_Hull"



    ...and same error message for every mesh collider because each mess collider does not have the Convex option checked on.


    If Is Kinematic is checked on, the boat of coarse becomes static and doesn’t move on the plane.


    Can your asset help solve my problem?


    Respectfully,

    Rene Leger

    upload_2020-3-26_9-6-11.png

    upload_2020-3-26_9-6-49.png

    upload_2020-3-26_9-7-19.png

    upload_2020-3-26_9-8-1.png
     
  9. Plawius

    Plawius

    Joined:
    Feb 27, 2014
    Posts:
    44
    Hi Rene! You can try to solve this problem with my plugin by generating the ship colliders. But it could be too many details, so physics performance can be not that great. Answered you in more details in email
     
  10. vrod2000

    vrod2000

    Joined:
    May 28, 2020
    Posts:
    17
    Hi, I have an object with many child objects that contain meshes. Can I send 2 models to you, and you can let me know how well they worked with your program.

    thanks.
     
  11. SurferDUDEe

    SurferDUDEe

    Joined:
    Mar 11, 2017
    Posts:
    1
    Hello Any update on this? :)
     
  12. davitsedrakian

    davitsedrakian

    Joined:
    Jun 23, 2018
    Posts:
    30
    Hello! @Plawius I need to add Non convex mesh collider to Spline Generated Mesh during runtime, is it real with your asset ?
     
  13. SupremeSmash

    SupremeSmash

    Joined:
    Nov 30, 2018
    Posts:
    30
    I am trying to use this on a building with widow and door holes but cant seem to get it to work. Do you have any video tutorials?
     
  14. Plawius

    Plawius

    Joined:
    Feb 27, 2014
    Posts:
    44
    Just add a rigidbody to your building and mark it as static - then you can use non-convex colliders. You don't need to use our plugin in this case.
    Our plugin's use case is dynamic rigidbodies with complex colliders that should be non-convex
     
  15. Plawius

    Plawius

    Joined:
    Feb 27, 2014
    Posts:
    44
    Yes, only on Windows and macOS for now. There is a runtime API that can take Mesh as an input
     
  16. Plawius

    Plawius

    Joined:
    Feb 27, 2014
    Posts:
    44
    Don't ask, just send to our email :)


    > Hello Any update on this? :)

    Working on it, it is not easy to implement properly
     
  17. davitsedrakian

    davitsedrakian

    Joined:
    Jun 23, 2018
    Posts:
    30
    Thanks, Actually I need for iOS :(
     
  18. climberDev

    climberDev

    Joined:
    Apr 10, 2014
    Posts:
    3
    I really like the idea of this asset! I will need my game to run on Android/iOS eventually.
     
  19. Plawius

    Plawius

    Joined:
    Feb 27, 2014
    Posts:
    44
    Do you need to generate the collider on iOS device itself? How long that could take and be OK for you?

    If you don't need to generate on the device and can pre-generate in the editor - the asset already will work for you.
     
  20. climberDev

    climberDev

    Joined:
    Apr 10, 2014
    Posts:
    3
    I need to generate the collider dynamically on mobile. Basically I am creating a mesh from a drawing, and want to then create the compound convex colliders for that mesh so I can use it as a rigidbody with physics.
     
  21. MultivariousDev01

    MultivariousDev01

    Joined:
    May 22, 2014
    Posts:
    28
    Hi @Plawius !!

    I was curious about the performance of the runtime mesh decomposition in your plugin.

    My use case is running a depth camera to grab depth data and reconstruct a surface mesh, and then dumping simulated water on it using the NVIDIA Flex system. (I'm A-B testing both of the plugins that are available in the store right now, the official NVIDIA Beta and the drkorzen uFlex plugin, to see which one holds up with my current use case better)

    The surface mesh is getting deformed and recalculated constantly in realtime based on the incoming depth data and there are thousands of Flex particles simulating and rendering fluid blobs. As you can imagine, this is a pretty resource-heavy application, it is constantly scanning over itself and updating small pieces of the overall mesh, recomputing normals and bounds, etc. (Years ago it was able to be background-decomposed on-the-fly, or whatever magic PhysX/Unity was automatically doing with concave mesh collisions to make them work with the Flex particles directly. It was nice, even though we knew the performance was bad and it was going to need to eventually change.)

    Is your plugin fast enough that I could make it the last step of my overall mesh update function, or would it need to be a less-frequently-called step? That's basically the question I'm pondering. The dynamically updated collider mesh can run at higher or lower resolutions, which is nice to tune for performance. The full, self-updating mesh that I'm trying to decompose will be on the order of about 1,500 to 6,500 vertices. The topography is always all "hill-and-valley" so it should have quite low concavity factors, at least. So far, it's just been a simple surface mesh, but I could fill out the bottom and make it a closed volume mesh if that's what your software would expect.

    Do you have any insights into how quickly your software could bust a mesh of that size down? Could it be reasonably done every frame? Is it asynchronous and/or tolerant of tight resources? Can it work in-place in memory or would it be generating a bunch of garbage every time I call it?

    I'd appreciate any insights before I purchase it, mostly because I wouldn't want to waste a day or more experimenting with it only to find that it can't quite meet our needs. Thanks so much for anything you can provide to help me make this decision!
     
  22. w34edrtfg

    w34edrtfg

    Joined:
    Nov 23, 2014
    Posts:
    72
    Plawius likes this.
  23. Plawius

    Plawius

    Joined:
    Feb 27, 2014
    Posts:
    44
    Thank you! Updated!

    It is not optimized for iterative, temporal use, unfortunately.

    BTW, the new version with Linux support released. And 50% discount is currently active!
     
  24. Artini

    Artini

    Joined:
    Jan 29, 2016
    Posts:
    181
    So, one cannot use it with WebGL at all?
     
  25. Plawius

    Plawius

    Joined:
    Feb 27, 2014
    Posts:
    44
    You can generate colliders in the Editor and use them in the WebGL build.

    Or do you mean generate colliders in runtime in WebGL? No, you cannot and that will be really slow anyway (no simd, no multi-threading in WebGL).

    What's your use case?
     
  26. StCost

    StCost

    Joined:
    Mar 1, 2017
    Posts:
    30
    Hi, I got a problem with generating convex colliders. They are oversimplified for some reason. Even on High Resolution

    upload_2021-9-17_16-40-37.png

    If I'll use regular Mesh Collider component and make it convex - I get almost the same very bad collider.
    upload_2021-9-17_16-41-49.png
    BUT if in cooking options I'll disable anything (literally any option), it starts working good enough
    upload_2021-9-17_16-42-32.png upload_2021-9-17_16-42-44.png
    I think, there is similar problem with your generator and I can't get decent results. It got broken about couple weeks ago. Any ideas, what I did wrong?
     
  27. Plawius

    Plawius

    Joined:
    Feb 27, 2014
    Posts:
    44
    Could you please send your mesh to me, so I can take a look? contact@plawius.com
     
  28. StCost

    StCost

    Joined:
    Mar 1, 2017
    Posts:
    30
    EDIT: solved, read below
    This problem appears on literally every mesh I tried and had. Made by me, downloaded from somewhere or from package examples. Even models I used before issue appeared. So problem is not in the meshes
    I'm 100% sure I changed some settings in Unity and didn't noticed that on time. But I have no idea what could possibly cause that kind if issue

    Earlier everything was generating just fine. So probably your scripts are fine too

    I sent you a bench mesh just in case

    EDIT: so the issue was in the way, how I exported my .fbx model from Blender. In unity it appeared as in 100x scale. In export settings I checked "apply transform", and now it's 1x scale, model has the same size, but all colliders are generated perfectly now.


    Model on the left has "apply transform", it's 1x scale. Model on the right doesn't have that flag, it's 100x

    Issue was in my models
     
    Last edited: Sep 24, 2021
    Plawius likes this.
  29. NateFromHolos

    NateFromHolos

    Joined:
    Sep 27, 2021
    Posts:
    4
    Hi there!

    I am looking at using your con-convex mesh generator for a VR game where users can import meshes.

    My problem is that the runtime generator currently freezes the game, which can be uncomfortable in VR.

    Do you think there is an easy solution for this? If not, could I potentially pay you to help me solve it?

    I tried to email contact@plawius.com but it didnt go through. Can you email Nate@holos.io ?

    Thanks!
     
  30. Plawius

    Plawius

    Joined:
    Feb 27, 2014
    Posts:
    44
    Sure, let's talk about this via email.
     
  31. joao_unity290

    joao_unity290

    Joined:
    Nov 7, 2019
    Posts:
    1
    Hi

    I just got this but I get EntryPointNotFoundException: GetMeshEx on pretty much everything.
    Running on linux.

    Your email seems dead too.
    If possible contact me on joao@caint.io

    Thank you
     
  32. NateFromHolos

    NateFromHolos

    Joined:
    Sep 27, 2021
    Posts:
    4
    Hi Mr Iurri, I tried to respond to your nice email but it seems your website/domain is down. Please email Nate@holos.io from another address if possible. Thank you!
     
  33. Plawius

    Plawius

    Joined:
    Feb 27, 2014
    Posts:
    44
    Okay, I'm sorry for the email - domain problem, going to fix them soon!
    I wrote to both of you! (Linux updated should be on its way)
     
  34. NateFromHolos

    NateFromHolos

    Joined:
    Sep 27, 2021
    Posts:
    4
    Hi sir, I received your initial email, but I am still unable to respond to that address. Thanks in advance.
     
  35. Plawius

    Plawius

    Joined:
    Feb 27, 2014
    Posts:
    44
    Oh, I'm sorry! I also sent you Gmail email, maybe that went to the Spam folder?
    Anyway, contact@plawius.com is fixed, could you try again?
     
  36. NateFromHolos

    NateFromHolos

    Joined:
    Sep 27, 2021
    Posts:
    4
    Hi sir, I think I emailed you at both addresses. Did you get them? Thank you.
     
    jura_wd likes this.
  37. jura_wd

    jura_wd

    Joined:
    Jan 28, 2014
    Posts:
    32
    answered!
     
  38. Mr_Dss

    Mr_Dss

    Joined:
    Feb 3, 2016
    Posts:
    19
    Need support for Apple Silicone architecture.
     
  39. Wolfram

    Wolfram

    Joined:
    Feb 16, 2010
    Posts:
    261
    Hi Plawius!

    Unity currently has a severe bug when using MeshColliders, through all versions (2019.4-2022.2): https://issuetracker.unity3d.com/issues/meshcollilder-trigger-collision-detection-isnt-consistent

    Specifically, this bug occurs for us when checking OnTrigger-Collisions from a (deforming) SkinnedMeshRenderer (using SkinnedMeshRenderer.BakeMesh() to update the mesh each time the mesh changes, and then assigning it to a Mesh Collider) to any static MeshRenderer with a Mesh Collider, set to "Convex" and "Trigger".
    Collision detection works fine when using OnTrigger-BoxColliders instead of MeshColliders for the target object.

    From your description it seems you also create MeshColliders, and you also mentioned that you will add/have added for "OnTrigger" support?
    Will our required workflow (SkinnedMeshRenderer.BakeMesh, then query the OnTrigger of some target object, for which the colliders are auto-generated by your tool) run into the same bug, or will it create a reliable collision/trigger detection?

    I could send you a specific testcase, if you want to try it out.

    (Note this is has no realtime application requirements, so we don't need 30/60fps)

    Cheers!
    Wolfram
     
  40. staraban_unity

    staraban_unity

    Joined:
    Apr 12, 2022
    Posts:
    3
    Hi Plawius!

    We use your plug for a couple of months and get crashes on some 3d models while generating colliders. The crash is not throwing any exceptions but just crashes Unity.
    Here is the model that makes crash. Could you look into this issue? Thanks
    I also send you mail but not a get a any responses

    Best Regards
     

    Attached Files:

  41. SLN

    SLN

    Joined:
    Oct 26, 2016
    Posts:
    3
    Hello Plawius!

    I'm making a mobile game that generate mesh at runtime, the mesh has Convex Collider and Rigidbody.
    The problem I have is that I want the mesh to be non convex. I'm willing to pay for this service.

    I tried to contact you on contact@plawius.com but the mail didn't go through.
    Could you contact me on contact@slngames.com

    Thank you.
     
  42. HECer

    HECer

    Joined:
    Mar 17, 2013
    Posts:
    46
    Is there any chance for an Android and iOS support soon?