Search Unity

Assets Obi Particle Based Physics (Cloth, Rope, Fluid) thread

Discussion in 'Works In Progress' started by arkano22, Jun 30, 2015.

?

Performance vs compatibility

Poll closed Oct 9, 2015.
  1. I don't care about performance, keep my data intact please.

    0 vote(s)
    0.0%
  2. I don't care if I have to re-do some stuff, as long as it runs faster.

    14 vote(s)
    100.0%
  1. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    744
    Hi, I've bought obi cloth for a long time, just got the chance to test it and try to integrate it into my project.
    I'm using UMA character system, and I've found a post in this thread back in 2016 about UMA compatibilities.
    Here is my question: is UMA officially supported in current version or it requires ourselves to integrate it?
     
  2. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    615
    Hi,

    There's no official support for UMA as of now, you'll have to integrate it yourself.
     
  3. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    744
    Ok, any further suggestions for the integration apart from the post I've read?
    Or anything changed may make that approach unavailable?
    Thank you for your time :)
     
  4. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    336
    If you want/need bone deformation customization in UMA then it won't work with obi cloth. That's the problem I ran in to. Obi cloth (and unity/nvidia cloth ) assumes 1,1,1 scale of the bones affecting vertices. If not, the cloth simulation will be off. In UMA 3, we're planning to have the bones and vertices get baked back to 1,1,1 so then cloth simulations will work properly.
     
    neoshaman and hopeful like this.
  5. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    744
    Thank you for the info, I guess I'll wait for the new UMA version then :)
     
  6. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    823
    @arkano22
    I'm setuping a new project in 2018.2 (.10) and some #defines fail to apply upon import:
    (windows 64 editor, Windows x86_64 target platform in build settings)

    PlayerSettings Validation: Requested build target group (20) doesn't exist; #define symbols for scripting won't be added.
    PlayerSettings Validation: Requested build target group (17) doesn't exist; #define symbols for scripting won't be added.

    Does it have some repercussion which should I be aware of ?

    These two error messages are appearing in the console once in a while as well:
    one 'organizational' issue - sorry I refuse to register on a new support forum per each asset I own, so hopefully posting here a support question is a.ok

    Thanks!
     
  7. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    615
    Hi there,

    It's ok to post here, but the downside is I only check the Unity forums once in a while. The official forums are checked at least once everyday. (edit: however we do not answer support questions in Facebook, Youtube comments, or asset store reviews)

    The first two errors shouldn't be a problem. They refer to a sample script (which is not part of the core system, only used in one of the sample scenes). I will check it for compatibility with 2018 in the next release.

    The second pair of errors are a bug in Unity, fixed in 2018.3
    https://issuetracker.unity3d.com/is...be-checked-because-doesnt-exist-error-message
     
  8. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    823
    Thanks!
     
  9. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    823
    @arkano22 I would have a bug to be fixed for you -

    please move the
    Code (CSharp):
    1. int i = 0;
    counter in ObiParticleActorEditor.cs, Ln 340 inside the particle drawing cycle ( e.g. to line Ln 350 )

    I suppose you've never encountered it with small vertex count models ( the drawcallCount count never something else than 1 )
    I *think* this should fix it.
    Thanks !
     
  10. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    823
    I would also appreciate if you could look into saving times in the editor (which are getting ridiculous with few semi complex models)
    E.g. I have 9 models in prefab testing scene, all disabled game objects; (all with its own SkinnedMesh renderer, ObiCloth, each its own solver);
    One exceeding 25000 vertex count, the rest having in about 10000 vertices each
    When I press ctrl+s to save the scene it takes about 20 seconds for unity to come back - I wonder what's going on there since everything is already saved manually.
    There's nothing else of significance in the scene, i.e. if I remove the prefabs it saves instantly.
    As you can imagine it's easier to adjust things having them all in there instead of dragging and working with each individually. (That's on i7 3.4 GHz CPU, on SSD, W10 64bit)
     
  11. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    823
    The sync between computed data and unity game object references is not ideal either:
    E.g. if you copy the cloth component and 'paste component as new' on another game object it retains solver and topology references (which is fine), but dragging new solver, topology and having Initialize run doesn't completely wipe out old data - the mesh was deformed for me.
    I *think* unity restart might have solved this, but as you can imagine that's not an option - I had to setup each game object with new component individually.
    ^ the above is not critical issue, but please consider it (alongside previous post) as _very_ welcome quality of life improvements

    Thanks!
     
  12. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    615
    Unity re-serializes all objects and components in the scene when you save it. It does not (afaik) keep a per-object dirty flag, but flags the entire scene as dirty when anything in it changes, so it has to serialize everything each time you save.

    In the case of cloth instances, it has to serialize a lot of per-particle data (position, velocity, radius, skin backstop values, mass, etc) and per-constraint data (stiffness, particle index pairs, etc). For +115000 (!) particles in your scene, this can be quite a lot. My advice would be saving them as prefabs and instantiating them at runtime.

    Note that we cannot use particle instancing, as each object is susceptible of having its own per particle mass, radius, positions, velocities (due to per-object rest state support), etc. So no way of reducing the amount of serialized data without losing functionality.

    Anyway, such huge cloth meshes will probably bring performance to its knees. Consider using proxies. A 25000 vertex mesh should never be simulated directly unless you really need high resolution cloth (certainly not for a game, unless you're doing something else which does not need to run in realtime). A 2000 vertex mesh simulation can drive it just fine.
     
    Last edited: Oct 9, 2018
  13. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    823
    I have them as prefabs, I was talking about modifying the prefabs in the test scene

    Anyway in this case you might be correct since the dirtying any game object in any way triggers reserialization of the whole scene along all data
    As I mentioned the workaround is to modify each prefab/instance individually by single dragging it to the test scene

    No I won't, at least for now - each model resp. prefab individually works: as I mentioned in average it's 10k vertices/model (+ unoptimized, and only about half unfixed) which is more than acceptable at runtime
     
  14. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    823
    Another bug which triggers randomly for me is that occasionally after working with cloth components and entering Play mode, the mesh of the skinned mesh renderer shifts upwards - outside of the skinned mesh renderer bounds - the bounds are staying at correct place; I *think* the simulation is shifted too

    Re-Initialize seems to fix it ( time consuming as it might be with 10k vertices )
     
  15. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    823
    When having more than one cloth actor in the scene and editing particles on one it happened that the selection of particles carried over to when editing the next one
    - this one doesn't seem to trigger once there are already exiting previously created particles/fixes on the component (e.g. when editing prefab) - but I'm not sure

    Nothing which couldn't be undone by hitting clear selection first for sure - just had to be aware
     
  16. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    823
    That's probably it after working for about 2 days with it
    Other than that the simulation works great ! ʘ‿ʘ

    One must be just careful when tweaking/modifying the parameters afterwards -
     
  17. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    823
    One more thing:

    allow the package (or please verify that it is/not possible) to be moved freely anywhere in the project such as Plugins folder

    (which currently didn't work for me throwing various errors until I moved it back - restart might have helped or something, didn't research this further)
     
    Last edited: Oct 10, 2018
  18. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    823
    If user changes other - *non* obi* - component on go/prefab with obi* attached, the whole dirtied object is serialized
    - which lead to points re/serialization (which, as in the cases above prolongs saving times)

    Good practice in these cases is to keep data/points in a separate scriptable object in the project and updating them separately only per user direct obi change / indirect obi request when needed only

    This will complicate architecture for sure, but might lead to more comfortable workflow with obi* components
     
  19. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    577
    @arkano22 I'm getting a red flag with the latest download: Menu Component/Physics/Obi/Obi Particle Renderer can't be checked because doesn't exist
     
  20. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    615
    Ascensi likes this.
  21. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    615
    Hi all,

    I've been working hard without leaving my cave for a few months now. Obi 4.0 is almost ready, and with it, a lot of new stuff, improvements to classic stuff, and of course bug fixes. Only a few more weeks to go, during which testing will take place.

    4.0 will only work for Unity 2018.1 and up. Here's a sneak peek of what's new for ropes, fluids, and a 4.0 newcomer: Obi Softbody.

    Obi Rope

    A new kind of actor has been added to the pack: Obi Rod. Rods are similar to ropes, but have a few key differences:
    • They model shearing and torsion, coupled with bending. This allows them to simulate a lot of real world phenomena that ropes cannot.
    • Anisotropic bending/shearing/torsion stiffness, independent of timestep and iteration count (uses XPBD)
    • They remember their rest shape, and can be made rigid.
    • They are completely inextensible.
    So while ropes are merely a list of points chained together by distance constraints, rods use something called Cosserat rod theory to model a solid, elongated piece of matter.



    Pricing for new users will go up a little bit (around 5$ more), but if you already own ObiRope, updating is completely free.

    Obi Fluid
    • Faster core solver, specially in mobile devices (around x1.5).
    • Much faster particle advection (x2).
    • Better, unconditionally stable surface tension model.
    • No limitation in the amount of particle neighbors.
    • Per-particle properties: vorticity, viscosity, resolution...
    • Multirresolution fluids (ability to mix fluids sampled at different resolutions).
    • Property diffusion.


    Pricing stays the same, so you pay the same regardless of when you purchase Obi Fluid (before or after the update).

    Obi Softbody

    An entirely new Obi asset dedicated to simulate rigid and softbodies. Makes use of oriented particles to achieve unconditional shape matching stability, and outstanding speed. You can turn complete meshes into a softbody literally at the click of a button (even non-manifold meshes). Softbodies track their transform position and orientation, so for the most part you can treat them as a regular object. Softbody-fying works with any part of a skinned mesh too (beeeewbs :p).



    Price-wise, it will sit somewhere between Obi Cloth (45$) and Obi Fluid (60$).

    Hope you like it, find it useful and make awesome stuff with it!
     
    Last edited: Oct 31, 2018
  22. akuei2

    akuei2

    Joined:
    Oct 17, 2018
    Posts:
    69
    "Softbody-fying works with any part of a skinned mesh too (beeeewbs :p)."
    If I no wrong understanding, that's you mean "boin boin" for chest and hip physic .... ( Man Romance )
     
  23. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    615
    Yep. Loved your comment, by the way. :D
     
  24. IsDon

    IsDon

    Joined:
    Feb 27, 2015
    Posts:
    28
    Ok - just to confirm, you're adding softbody and rigid ropes, exactly what I haven't been able to find a good solution for?

    Color me excited, already own rope and cloth. I'll definitely look at softbody, but the Rigid Ropes (Rod) solution sounds perfect for a car antennae which I was struggling with this week. - I look forward to the 4.0 release.

    Don
    have a great day
     
  25. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    405
    Amazing stuff!
     
  26. darkgaze

    darkgaze

    Joined:
    Apr 3, 2017
    Posts:
    20
    Soft bodies would be a different asset. It's a world on its own...
     
  27. IsDon

    IsDon

    Joined:
    Feb 27, 2015
    Posts:
    28
    Pretty sure that the announcement of: "Obi SoftBody" will cover that part - I'm excited about both new features :)
     
  28. shedworksdigital

    shedworksdigital

    Joined:
    Nov 7, 2016
    Posts:
    40
    Hello! We have a lot of skinned mesh clothing in our game. We've been using unity's own cloth (which is horrible to set up and looks rubbish), and recently tried switching to obi cloth and were very impressed by the results! I'm just checking in to enquire about the status of the xbox one support? We would love to use obi in our game, but xbox support is critical for us.
     
  29. unity_Yc5fGs-ZLS-O4Q

    unity_Yc5fGs-ZLS-O4Q

    Joined:
    Nov 23, 2018
    Posts:
    3
    Hello,
    I am developing a ship bridge simulator of big ships (i.e. container carriers ), I would like to use your Obi Rope to model the anchor. Before to buy the package I would like to be sure that the rope will not stretch if I will move the ship using a force of 11*10^6 Newton.
    Thank you
     
    Last edited: Nov 23, 2018
  30. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    615
    Hi there (I already answered your PM, but I'm pasting the answer here if it helps anyone else)

    Obi is not designed (or meant) to be used in an industrial simulation environment. These simulations generally have much higher accuracy and stability requirements compared to game-grade simulators.

    This is specially true when dealing with huge mass ratios, or extremely large forces like in your case. These are very uncommon in games and to be solved in a physically accurate way they require a fundamentally different approach. (Read on iterative vs direct solvers if you want more technically oriented information).

    I'd recommend using an engineering grade simulator, like AgX, which includes a realtime direct solver:
    https://www.algoryx.se/products/agx-dynamics/
     
    IsDon likes this.
  31. INEFFABLEGAMESTUDIOS

    INEFFABLEGAMESTUDIOS

    Joined:
    Aug 25, 2015
    Posts:
    16

    How can we make Soft Bodies ?
     
  32. jmc-blueyeti

    jmc-blueyeti

    Joined:
    Dec 19, 2018
    Posts:
    2
    Hello,
    I need to simulate the inflate of a balloon with hot air or helium, and when it is inflated enough this balloon will lift an object (attached to the balloon with a rope). Is it possible to do that with obi physics?
    The hard part for me is to get the balloon raise when the volume grows. In the ClothSoftbody sample scene the overpressure parameter is great to simulate the inflation, but the balloon will not go up as its content is the same "gas" than the ambiant one; I cannot find a way to make the gas inside the balloon lighter than the outside. Another solution I imagine is to put a fluid emitter into the balloon with a buoyancy > 0 but I don't know if it will work and if I will have the same behaviour that with the overpressure parameter, and it could be bad for performances.
    Does someone have other ideas of how I can achieved that simulation?
    Thanks.
     
  33. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    615
    Do not try to simulate this at the "buoyancy due to density gradient between fluids" level, which is what it looks like you're aiming to do. This is *way* too detailed for a game.

    Instead, try to focus on what the effect of filling the balloon is: it lifts the balloon, and the object attached to it. As you put it:

    So you can simply apply an upwards external force to the ballon, and drive its magnitude using the overpressure value. The higher the pressure inside the balloon, the larger the force applied to it. This is easy, simple, fast and looks good.
     
  34. jmc-blueyeti

    jmc-blueyeti

    Joined:
    Dec 19, 2018
    Posts:
    2
    Thanks for your answer! it works well. I had another problem using several balloons, they tend to merge each other. I've solved it using forces on each balloon to make the balloons repulse each other.
     
  35. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    615
  36. electric_jesus

    electric_jesus

    Joined:
    Mar 8, 2015
    Posts:
    31
    This is great news! I've been waiting for a chance to try particle-based rods for a long time now! I'm really glad, that you keep improving this asset. Do you have plans to implement dynamic resizing feature for rods in the near future?
     
  37. Ibizanhound

    Ibizanhound

    Joined:
    Jun 20, 2014
    Posts:
    5
    Congratulations @arkano22 on the release of Obi 4.0 and for finally being able to leave your cave after so many months! hahaha
    Does the new softbody solution include internal pressure and maintaining an object's volume when it collides with another object?
    Here s an example of what I mean from another Unity softbody asset:
     
  38. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    939
    @arkano22

    Hi, is it possible to have cloth that tears on a skinned mesh? Say I have character wearing clothes, and someone shoots him. I'd like to be able to tear the cloth away.

    Thanks
     
  39. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    615
    Nope, not currently. Will take this as a feature request though.

    Note that tearable cloth is in general less efficient than non-tearable cloth. This is because in non-tearable cloth, we are able to sort and group constraints together in non-overlapping batches at initialization time, this allows us to update each batch in parallel (we internally refer to this as "cooked" cloth). However, since tearable cloth creates/removes constraints dinamically when torn, we cannot perform this precomputation and all constraints of a single cloth must be updated in a single thread (internally named "raw" cloth). Constraints for separate cloth objects are always updated in parallel, though.
     
    Last edited: Jan 30, 2019
  40. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    615
    Hi, and thanks for your words! It's good to feel the sun on my skin :D.

    Not yet, volume preservation is not currently done but we're working on it. We already have volume constraints for cloth, but these require the cloth mesh to be watertight. Since soft bodies impose no restrictions on the mesh (can have holes, be non-manifold, basically any triangle soup works), we want volume preservation to work with any mesh too.
     
    IsDon likes this.
  41. Ibizanhound

    Ibizanhound

    Joined:
    Jun 20, 2014
    Posts:
    5
    Oh that's great! At least it's in the to-do list! And I guess we can expect some detailed tutorials on the new softbody asset? I know it would convince me to buy it, so I guess the same goes for the others too ; )
     
  42. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    615
    Also working on that. We want to jump on the video tutorials wagon, even though it's a lot of editing work (specially when they become outdated and have to be re-done) but most people seem to prefer that instead of/in addition to written docs.

    There's WIP written docs for Obi softbodies here:
    http://obi.virtualmethodstudio.com/tutorials/softbodysetup.html
    http://obi.virtualmethodstudio.com/tutorials/charactersoftbody.html
    http://obi.virtualmethodstudio.com/tutorials/shapematchingconstraints.html
     
    Ibizanhound likes this.
  43. Ibizanhound

    Ibizanhound

    Joined:
    Jun 20, 2014
    Posts:
    5
    I know what you mean, but I am sure you already know that they attract a lot of attention. If you can afford hiring someone to produce video tutorials I think its going to be beneficial in the long run. Thank you for the links and congratulations once more for your awesome assets!
     
    arkano22 likes this.
  44. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    615
    A very early pic of procedural tree modeling using Obi particles. Branch physics are done using rod constraints, and are 100% simulated. Color-coded depending on their hierarchical level, not very pretty I know (yet).



    The idea is to generate trees/plants semi-procedurally, using collision detection and tropisms to guide procedural growing, then either simulate them in-game or bake a static mesh.

    In the pic, slight phototropism causes the tree to grow to the right, towards the sun.

    thoughts?
     
  45. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,099
    Love it. I was using Ivy Generator but the author killed it because of taxes. :(
    My architecture is procedurally generated, so a dynamic plant system that grows around scene colliders will always catch my attention…

    I am still saving up for Obi softbody. :cool:
     
    arkano22 likes this.
  46. haiduc

    haiduc

    Joined:
    Feb 4, 2015
    Posts:
    27
    Hello everyone!
    So i have this problem..
    I recently purchased Obi Cloth, and integrated it succesufully into my scene and onto my characters and its clothes.
    The problem occurs when i try to use it with a Kinect device. So i use my charater with clothes on as an overlay of what the kinect sees( meaning me).
    Here it the problem... the objects that have Obi Cloth attached to them, are getting all messed up, the meshes are turning into triangles (from quads), some joints are getting puffed out, like inflated..
    So...its there any know issue with this? and can there be a solving to it?
     
  47. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    615
    There's many possible causes for cloth behaving in strange ways. From mesh scaling issues, to collision with other objects, wrong parameter settings, etc. Without knowing more details about your setup, it is pretty much impossible to tell. Write to our support email and I'll take a look at your scene.

    Edit: you have to be extra careful with the order in which you update things when moving bones programmatically. If your Kinect scripts transform the bones after simulation has taken place, all sorts of strange things can happen. Try setting Obi's update order to LateUpdate, and set ObiSolver to update last in the "script execution order" window.
     
  48. haiduc

    haiduc

    Joined:
    Feb 4, 2015
    Posts:
    27
    Thank you!
    I will try this and will get back later with more updates.
     
  49. bgrz

    bgrz

    Joined:
    Mar 22, 2015
    Posts:
    43
    Saw an Obi Fluid update mentioning huge performance improvement and it caught my interest, so I made a comparison. Since I already wrote down the numbers (CPU ms) I figured why not post them here:

    Code (CSharp):
    1.  
    2. Scene      |  before                        |  after
    3. -----------+--------------------------------+---------------
    4. Faucet     |  13.3 in bowl -> 3.1 spilled   |  4.7 -> 2.2
    5. FluidMill  |  10.8 flowing -> 7.2 on floor  |  5.2 -> 4.6
    6. Smoke      |  2.5                           |  2
    7. Viscosity  |  8.8-10                        |  4-4.2
    8. Raclette   |  12 pouring -> 7.6 resting     |  4.8 -> 4.1
    9. Granular   |  3.9-4.2                       |  ~3.5
    10.  
    (I was only interested in 3D scenes)

    I didn't expect this much of a change, nice one!
     
    IsDon, arkano22, Nothke and 2 others like this.
  50. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    615
    And this all thanks to ditching microsoft's compiler and using LLVM :)
     
    hopeful likes this.