Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

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. Billie391

    Billie391

    Joined:
    Mar 16, 2019
    Posts:
    1
    Hi, Why can't I edit skin radius and all the other parameters about skin in Particle editor? I use Skinned Mesh Renderer and have activated the Obi Skin Constraints both in the object and the solver. Could you help me?
     
  2. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,645
    JUst want to drop by to say Thanks again for that tools. Even though I still barely touch it due to other R&D stuff!
     
    arkano22 likes this.
  3. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    615
    Make sure that the ObiCloth component is added to the same GameObject that contains the SkinnedMeshRenderer, and that the SkinnedMeshRenderer contains actual skinning data (Unity will generate it automatically for you when instancing any object with skeletal animation). Only then will the skin constraint per-particle parameters be editable in the particle editor.
     
  4. GWStudio

    GWStudio

    Joined:
    Sep 27, 2016
    Posts:
    100
    hi everyone i keep getting these errors :
    Can't remove ObiTearableCloth (Script) because ObiParticleRenderer (Script) depends on it
    Can't remove ObiDistanceConstraints (Script) because ObiTearableCloth (Script) depends on it
    Can't remove ObiBendingConstraints (Script) because ObiTearableCloth (Script) depends on it
    Can't remove ObiAerodynamicConstraints (Script) because ObiTearableCloth (Script) depends on it
    Can't remove ObiPinConstraints (Script) because ObiTearableCloth (Script) depends on it
    using unity 2018.3.11 with obi cloth 4.0.1 .... another Q how to make cloth not collide with specific collision layer or tag.
     
  5. jose_pedro_didimo

    jose_pedro_didimo

    Joined:
    May 2, 2018
    Posts:
    13
    Hi, I am facing weird issues when using a proxy to drive the simulation on a garment with pockets and belt loops.

    Could you provide guidelines to try to solve (prevent) these issues at modelling stage, and any other advice?
    The skin map editor is very simple and the tutorial hasn't helped much further.

    upload_2019-4-12_16-30-41.png
     
  6. jose_pedro_didimo

    jose_pedro_didimo

    Joined:
    May 2, 2018
    Posts:
    13
    Just leaving a note that we ended up developing our own proxy deformer to overcome this issue. You can consider this issue closed for us.
     
  7. devotid

    devotid

    Joined:
    Nov 14, 2011
    Posts:
    372
    Just bought the asset today after staring at it for a couple years.....lol. Finally needed to get tearable cloth back for a project that I am working on.

    Any advice on how to get a simple Cardboard/Paper target? The tearable cloth in the sample scene I cant seem to get it to act stiff like a piece of paper/cardboard target. it is too "thin" and "springy/flexible".

    Here is what I am trying to do. This is a video of a prototype I made many years ago...
    but I def want to make it a little stiffer and more cardboard like.

    I think I have made a way to determine if the player has shot out all of the red star.... but first I have to get the cloth working. :)

    Thanks for any advice anyone can help with.

    Kevin
     
    arkano22 likes this.
  8. devotid

    devotid

    Joined:
    Nov 14, 2011
    Posts:
    372
    I cant get any example to act like a generic piece of cardboard/paper. Why is everything set to max 1 and still "stretchy" and "bouncy" for the defaults? Adjusting the "Iterations" and "Relaxation" is like feeling around in the dark and is not at all intuitive. Is there somewhere with at least some starting points for different types of cloth, paper and textiles? Anything?

    And am I crazy or did I pay $47 bucks for an asset that was $19 a week ago? I had it in my shopping cart for a month and never bought it @ ~$19.00 (With Pro Discount). I came back to buy it a few days ago and it was $47 now?
     
  9. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    4,960
    It might have been in the May Madness sale.
     
    arkano22 likes this.
  10. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    615
    Yep. It was included the May Madness sale. The Asset Store simply gives developers the choice to opt in or out of a sale, if the developer chooses to participate they reduce the price during the sale and then automatically reset it to the original price after the sale ends. The normal price is 47$ and has been for quite a long time. I'm not a fan of randomly changing the price of an asset, in fact I try very hard to squeeze in new features for free.

    Regarding stretchiness and bounciness, this is something common to all iterative solvers in existence (which pretty much account for 100% of all game engines, including both Obi and Unity's physics engine). Low iteration counts abort simulation before it has converged to a solution, and this "error" shows up as stretchiness. Some other engines simply blow up or become a jitter fest at low iteration counts (ever tried to make a chain/rope using rigidbodies and joints with Unity's default physics settings?), but Obi keeps things nice. See: http://obi.virtualmethodstudio.com/tutorials/convergence.html
    http://obi.virtualmethodstudio.com/tutorials/obisolver.html

    Cranking up the amount of constraint iterations and/or substeps improves convergence speed, and the solver will be able to reach higher effective stiffness.

    I know Obi exposes very low-level parameters, and it assumes quite some previous experience with physics engines. It's the only way to give the user control over both performance and quality, so the result can be fine-tuned for each use case. Exposing "presets" for cloth types/textiles works for offline simulators where a slight performance hit is not the end of the world. But when your budget for simulation is maybe 3-4 ms/frame you need to know where each processing cycle is being spent and why.

    No one wants their artist to increase the stiffness of a cloth and suddenly get a massive fps drop, with no clue of what the engine is doing under the hood. So a "stiffness" parameters of 1 for all constraints tries to get things as stiff as possible, within the current iteration budget. More iterations will allow to reach better quality (i.e, less stretchy) simulations, at the cost of performance.

    In your specific case, setting substeps to 2 and/or increasing the bending constraint iterations to 6-8 might get you closer to your desired result. Both parameters can be found in the ObiSolver component.

    PD: quite some time ago I wrote an article about convergence and iterative solvers. Some of it made its way back into Obi's manual. You can find the original article here:
    http://blog.virtualmethodstudio.com/2017/11/physics-101-3-solvers/
     
    Last edited: Jun 4, 2019
    devotid likes this.
  11. devotid

    devotid

    Joined:
    Nov 14, 2011
    Posts:
    372
    Thank you for the explanation of the pricing.

    I have been using Unity hinges and the old cloth system for over 7 years in productions games and I thought this would behave like the old one and I simply found no way to get it to act like paper or any stiffness at all without cranking the damping. (and thats not very realistic cause it works so slowly).

    Its no big deal... I think I was I was expecting too much of the plugin. It simulates AMAZING Stretchy Cloth and thats how you advertise it. So I just assumed that I could make it act like stiff paper and then tear it.

    So I have abandoned using ObiCloth for now on this game and will just use it later in the game for something else. I have some cool fun ideas that come to mind. :cool:

    For the Machine gun Carnival Game I ended up using a raycasting/Quad decal system and then scan a Png screenshot of it and check for "red" pixels. Seemed to work fine as I am not Zoomed in as much as I thought I would be.

    Here is a little vid of the target system I used...
     
    Last edited: Jun 5, 2019
  12. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    615
    Hi!

    Afaik, Obi's underlying physics paradigm is exactly the same used by Unity's old cloth (position-based dynamics), only with more exposed controls. After all, it was initially created as a replacement for it. Increasing the amount of substeps (roughly equivalent to increasing solver frequency in the old cloth) allows stiffness to go pretty high... here's a video of something akin to a thin metal sheet in ObiCloth:



    Anyway your solution looks darn good, and is cheaper performance wise. So it was the right call imho.
     
    devotid likes this.
  13. devotid

    devotid

    Joined:
    Nov 14, 2011
    Posts:
    372
    Ok..... Now that is pretty close. Thank you very much for the reply. :)

    I have moved on to using Obi for some cool clothing and goodies for the main characters. This could get out of hand. lol

    Kevin
     
    IsDon likes this.
  14. Tomza

    Tomza

    Joined:
    Aug 27, 2013
    Posts:
    584
    Hello,

    We are considering to buy the Obi Cloth asset. Please tell me if I can import any cloth mesh and make it working with your asset. And can I resize the cloth at runtime and fit to the body mesh. It is important. In general, I'm interested in functionalities that can be done at runtime.
     
  15. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    615
    Hi,

    Only 2-manifold meshes are supported. Also, cloth cannot be scaled at runtime, in the sense of applying an affine transform (since deformable objects are not rigid, so rigidly transforming them does not make sense).
     
  16. rosor

    rosor

    Joined:
    Nov 15, 2009
    Posts:
    3,607
    Hi, Considering the purchase of OBI Fluid. However i have a few questions that I need to get answered before pressing the trigger.

    Can Obi Fluid interact with unity terrain or not? I tried looking on the forum but didn't see anything. There was an older review title saying "terrain not supported" so not sure what to understand.

    Thanks
     
  17. amoka

    amoka

    Joined:
    Dec 18, 2015
    Posts:
    55
    Hi, I am also reading about OBI Fluids before choosing a tool to buy.

    Is OBI Fluids deterministic in a way that the subsequent plays of the simulation will have the same fluid motions? I need this for an offline video renderer which requires to do a second run for saving alpha channels separately.
     
  18. freenomon

    freenomon

    Joined:
    Mar 21, 2019
    Posts:
    34
    Hello Arkano,

    My boss bought me Obi cloth and I finally got to try it out with some cloth and colliders. For the most part I really like it. I wish it could use a regular skinned mesh collider but I guess for performance that's impossible.

    Now, when I increase the particle numbers to 10,000 and use a heavier mesh, the fps drops quite a bit.

    Is there a cpu that you recommend that would increase it's performace? I currently use an i7 6580k with 6 cores.

    If I were to get a higher core CPU (12 or even the 32core Ryzen) will the performance increase a LOT more as to make my purchase of a new CPU worth the cost? Will it go from 10fps to 30-60fps?

    btw, I am using Unity and obi cloth to make 3d animations and not games, so I don't need real time. I just want faster performance.


    Any plans on making obi cloth GPU based? I've seen some incredibley fast GPU cloth..on regular body deformed collider


    thanks

    KC
     
  19. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    577
    @arkano22 Would you be able to add a feature for characters that allows the softbody physics to be determined by the character's default weight painting?
    What I hope to use it for:
    • See realism in each footstep like a shock wave ripple through muscle and Fatty tissue- more obvious on large characters.
    • Be able to put animated objects inside the character such as animated lungs, heart, veins,Muscles or even another creature or hand moving inside pushing out. If there is a threshold where the skin breaks from either inside or outside things like gunshot damage or a medical operation with a cavity added with organs etc would be pretty decent.
    I've made this request on the reallusion feedback tracker recently and talked with support and they seem to be very interested in developing this. People only have a limited number of votes they can use up so it's rare that people vote even if its ideal. https://www.reallusion.com/FeedBack...reas-are-to-determined-by-weight-map-painting

    Anyway if you can help out with this it could help create a solid pipeline for realism.
     
  20. arkano22

    arkano22

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

    You can already have parts of animated characters "wobble" based on vertex-painted values. Many games do this. You can achieve it with ObiCloth, and there's also less performance-heavy (also less detailed) alternatives in the store, like VertExmotion.

    The other ideas are good, if very technically challenging. For things like hands visibly pushing out from the inside of a character, you'd need both crazy high mesh resolution (higher than any current gen engine can reasonably support for a character) and extremely detailed collision detection/resolution. Obi, being a particle-based physics engine, uses particle-based contact resolution, which is nowhere near enough for this task. You'd need mesh-mesh continuous collision detection and patch-based contact resolution, both of which are very expensive in terms of performance.

    When talking about breaking the skin, that's also quite complex as it involves keeping track of and updating the mesh topology as it tears. New mesh data (uvs, normals, tangents, bone weights, etc) would have to be derived for newly created vertices which is not trivial at all, and again, pretty expensive. If you look at out Obi Cloth plugin, you'll see that tearable cloth is quite limited as it can only be torn at existing topology edges. This is to keep topological changes to a minimum, but results in artificial-looking edges unless you have crazy high mesh resolution.

    We'll eventually get there, but imho there's just not enough spare processing power in consumer-grade devices yet to justify having these things in a game.
     
    Last edited: Sep 13, 2019
    Ascensi likes this.
  21. anomas

    anomas

    Joined:
    Jul 3, 2016
    Posts:
    33
    Hi i have the old version of Obi Cloth(before it became a new asset and required a new purchase) and am considering buying the upgrade but i'd like to know if anyone had any experience with UMA2 and Obi Cloth. Does it work at all?
     
    Last edited: Sep 14, 2019
  22. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    577
    Thanks for the info! I think the holes could be done with a screen space effect but I've seen meshes rip like nothing at various points with the cloth physics without having to recreate new normals, or vertices, bone weights etc well yes new bone weights - another texture that acts as a mask to deform a particular area.
    This currently works in iClone's cloth physics but I can apply that to a character as well and it's skin can tear off and tear off in areas not pinned and looks real enough but yes the mesh density has to be thick.. tessellation works. In regards to hands moving inside, I'd only have hi res contact points or tessellation, not the whole model being made physically dense or if the model isn't going to be visible and stay in inside maybe just collision data. Anyway thanks for considering it.

    On a side note, here is an idea that you might like to adapt to your fluid system using screen space collision.
    Perhaps to increase density/performance even further some of the particles could potentially be screen space as well perhaps in the center.


    It doesn't seem like the developer has an plans to release it.
     
  23. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    939
    @arkano22

    Hey, so I'm creating a VR game in which the player can move cloth around, such as drapes and a tablecloth. What do you recommend as far as settings for a tablecloth, say I would like the player to be able to either reach their hand underneath to lift it up or possible pinch and grab to do see what's underneath?

    Thanks!
     
  24. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    615
    Well, you can simulate rips/tears in texture space, or screen space, but these aren't actual physical tears, so there's no need to involve the physics engine in that. If you want the actual geometry to be torn, you need to update its topology, no way around that.

    Also, screen space collisions for a fluid physics engine is not a good idea at all since you also need to consider offscreen contacts. Screen space is good enough for eye candy systems with lots of independent particles that only collide with the scenery, that's unfortunately not our case. We need to consider offscreen contacts, backfacing contacts, inter particle contacts, etc. (we do perform all fluid rendering in screen space, though).