Search Unity

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

Discussion in 'Tools 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. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,929
    Hi there,

    Please write to our support email (support(at)virtualmethodstudio.com) or forums. Thanks!
     
  2. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Hi!
    I'm using the 6.2 version and testing out surface collisions. First of all, do I understand it right, that even with surface collisions enabled, I still have to add a native unity collider component + obi collider component to the object that I want my cloth to collide with?

    And more importantly, why, if I move the cloth and bash it against an object, it collides well even at high speed, but when I do the opposite (move the object against the cloth) it goes through the cloth even at very low movement speed and causes big stutters and fps drops?
     
  3. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,929
    Yes, surface collisions simply extend the collidable surface of cloth/ropes from individual particles to the whole surface. You still need colliders for it to collide against. See:
    http://obi.virtualmethodstudio.com/manual/6.2/surfacecollisions.html

    It shouldn't. There's no difference whatsoever in moving the cloth against a collider or a collider against the cloth. Please write to our support email/forums and provide some more info (a video of the issue, details about your setup) so that I can offer proper help.
     
  4. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Thanks!
    I've sent video to support@virtualmethodstudio.com

    Btw, the same behaviour can be observed in your example scene "ClothStaticMeshCollider". If you drag a cloth around the scene it will collide with the body mesh, but if you will move the body mesh it will almost always go through the clothes.
     
    Last edited: Aug 4, 2021
  5. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,929
    Oh ok, I see what you mean. This is just plain old tunneling:

    The mesh in that particular sample scene is a MeshCollider, and MeshColliders are hollow by definition (since they are just a collection of individual triangles, they do not define a “volume”). This means that once a object gets "inside" the mesh, it cannot be projected outside since the engine does not know what's inside or outside of a MeshCollider. It just knows about its surface. Since triangles are infinitely thin and particles very small and fast, this problem is exacerbated.

    Not only that, but you’re probably moving the mesh around by setting its transform position directly (using Unity’s gizmos). This basically teleports the mesh around from frame to frame, ignoring CCD checks. Since the engine cannot predict where you're going to move the transform next, it cannot perform accurate collision detection along the way.

    The reason why moving the cloth against the collider works, is because particles in the cloth move as a result of a physics simulation (unlike setting the transform of a collider), they have a velocity, and CCD (continuous collision detection) is used.

    Note both issues apply to Obi as well as regular Unity physics. At its core, it applies to literally all existing physics engines. Solutions:

    - Use primitive colliders (boxes, spheres, capsules, etc) or at the very least, colliders that define a volume. For Unity rigidbodies this means using convex mesh colliders, and for Obi it means using distance fields (http://obi.virtualmethodstudio.com/manual/6.2/distancefields.html) which are both faster and cheaper than MeshColliders. MeshColliders are the most expensive type of collider by a large margin and should be avoided if at all possible.

    - Move objects around using forces or rigidbody.MovePosition. This imparts a velocity vector to objects, which allows CCD to do its work.

    Again, the common name for this issue you're experiencing is tunneling. Here’s a video I did on this subject:
     
    Last edited: Aug 4, 2021
  6. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Thanks! I was indeed moving my meshes using the editor gizmo. Although, I can't find the Obi Kinematics Velocities component you've mentioned in the end of the video.
     
  7. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,929
    Since 6.0 this component is integrated with ObiRigidbody, if you move a kinematic rigidbody a velocity value will be calculated. Note this is just a workaround, ideally you should use forces to move stuff (rigidbodies, actors) around if you intend collisions and other constraints to work properly.
     
  8. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Thanks! This helped.

    A couple more questions:
    If I create a curtain and use particle attachment to "close" it, I get this shape:
    upload_2021-8-6_0-24-45.png

    However, if I set Max Compression to ~ 0.5 in the distance constraints, I get the nicely folded curtain (the right one in the screenshot below). Though, I can use it only when it's closed because the open curtain (the left one in the screenshot below) with the same compression looks ugly. Is there any other way to achieve such folds without using the max compression setting? Or can I change its value in runtime via script when the curtain is being closed/opened?

    upload_2021-8-6_0-27-52.png

    And also, I've noticed strange update behaviour. When I move the clothes, its vertices move a bit...sporadically. And they freeze a bit abruptly. Semetimes it may look like unity itself froze, but it's just the simulation decided that it's time to finish. And it always feels like some vertcies could use a few more simulation iterations, because they freeze in such positions that wouldn't be realistically possible because of the gravity and momentum. I can't say that they freeze in mid-air, no, the simulation do looks kinda-sorta finished at the right moment, but there's always the feeling that it needs a bit more movement to get in the right place. If you don't understand what I'm talking about I can try to capture it on a video. Here are gifs:


     
    Last edited: Aug 5, 2021
  9. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,929
    You might want to try and increase bend constraint's "max bending", or "bend compliance". These directly control how the cloth bends and folds. See:
    http://obi.virtualmethodstudio.com/manual/6.2/bendingconstraints.html

    Distance constraint's "max compression" allows particles in the cloth to get closer to each other. This does affect folds but only as a side effect.

    You can change *anything* via script. :). Do:

    Code (CSharp):
    1. cloth.maxCompression = 0.5f;
    See the API docs for details.


    Your solver's sleep threshold is simply too high. Set it to a lower value. See:
    http://obi.virtualmethodstudio.com/manual/6.2/obisolver.html

     
  10. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Thanks! Unfortunately, any value of bend constraint's doesn't really affect the folding in comparison to a completely disabled bend constraint's. Moreover, bend constraint's + self-collision in such case cuts fps in half, when the curtain is folded. Bend constraint's + self-collision + surface collisions and I go from 150 fps to 20 fps.
    I noticed that using surface collision + self collision generally results in "the more folds you create the less fps you get". Is there a way to use surface collision for other objects and disable it for self collision?

    Also, is it possible to adjust cloth to a certain position via simulation and somehow store the result (not modifying the initial mesh), so during the next runtime the simulation starts from this state?
    For example I want to pin the curtain in the middle like this
    so when the player first encounters it, it will be in this state. But then it can be unfolded to its initial state (just hanging plain peace of fabric).
     
    Last edited: Aug 14, 2021
  11. mindCreatesMeaning

    mindCreatesMeaning

    Joined:
    Jan 14, 2021
    Posts:
    36
    Question About Obi Cloth Initialization (Obi Cloth Behavior on First Play)

    Whenever I first Press Play in a scene containing Obi Cloth Flags blowing in the wind - the flags go crazy at first and then slowly settle down to use the wind force I set in the Inspector.

    1.) Is this normal?
    2.) If not normal, what could possibly be causing such a behavior?
     
  12. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,929
    Nope. Never had any user report something similar to what you describe.

    Without any details regarding your setup, it's hard to tell. Simply adding a cloth and a force zone does not result in this behavior. You can see this in the "Wind" sample scene, there's two cloth flags and two wind sources but (at least for me) it works fine.

    Please write to support(at)virtualmethodstudio.com providing more details about your scene: what kind of cloth it is (regular, skinned or tearable), what simulation backend you're using, Unity and Obi versions you're using, etc.
     
  13. mindCreatesMeaning

    mindCreatesMeaning

    Joined:
    Jan 14, 2021
    Posts:
    36
    Thank you for your sanity-checking reply. I will build a sample project and send to official support.
     
  14. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    Hello is Your system working ok with Unity LOD group?
     
  15. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,929
    Hi,

    Obi is a physics engine, if you add/remove particles from the simulation based on LOD the results will change (think about adding/removing rigidbodies from a scene based on LOD, doesnt really make sense). So no, LOD is not supported, sorry! :/
     
  16. Hi @arkano22 !
    First, thanks for these assets, they are really work of art. Love them all (and have them all).
    Now, the annoying question: Obi Fluid and HDRP? Is it something you are still planning or completely dropped the ball on it?
     
  17. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,929
    Hi Lurking Ninja!

    Thanks for your kind words.

    For now I just dropped the ball on "proper" HDRP integration. There's been several attempts and spent an entire year on this, but came to the conclusion that is just not doable as things are now. ShaderGraph is not nearly flexible enough to do it, and hand writing a non-trivial HDRP shader with lighting integration is simply unfeasible.

    So the next thing I'm trying is a poor-man's version: grab the data of one directional light, and do my own basic phong shading on it in screen space. This is less than ideal but at least will allow something to be rendered when using HDRP.
     
  18. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,929
    Hi there,

    Currently working on Obi 6.4, I'm focusing on small, quality of life improvements for editor tools and looking for feedback. Most of these changes/new features are driven by user suggestions, so chances are there's still someone out there who would like to see some specific tool improved or new tools added in upcoming versions.

    Here's the relevant post in the Obi forums:
    http://obi.virtualmethodstudio.com/forum/thread-3297-post-11740.html#pid11740

    let me know your thoughts!
     
  19. sezerBunyamin

    sezerBunyamin

    Joined:
    Jan 23, 2018
    Posts:
    8
    Hi, I have a promlem.

    When I use obi mesh renderer, if I cut the rope, obi mesh renderer does not work on the cutted part.

    If I use chain renderer it's fine, but I want the mesh to bend. Therefore chain renderer is not suitable.

    Screenshot_4.jpg
     
  20. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,929
    Quoting the Manu
    Hi! Just quoting the manual here:

    http://obi.virtualmethodstudio.com/manual/6.3/roperenderingmodes.html

     
  21. manurocker95

    manurocker95

    Joined:
    Jun 14, 2016
    Posts:
    210
    I know how hard the rematching shapes is, but as I saw someone that got, tons of years ago, cutting uFlex softbodies (which is similar to Obi's volume shape matching)... did anyone get any approach to cut through obi softbodies?

    I got "plane based cuts" working by disabling the solver update -> cut the mesh with mesh slicer-> recreate the softbody for the new generated parts, but I would like to get something like:



    I checked tetrahedralizing meshes with ftetwild + gmsh + vtk as the obi author said, but the process is WAY worse than you even might think and it's windows only, as there's no cross-platform softbody solution excepting Obi.

    Any idea regarding obi softbodies for cutting?
     
  22. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,697

    Hi, Is the forum down?

    Thanks
     
  23. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,929
    Hi!

    Not that I can tell, I’m able to access it just fine and our hosting provider reports no recent downtime.

    try to access it again, let me know if you still can’t get to it.

    cheers,
     
  24. sickbattery

    sickbattery

    Joined:
    Jul 13, 2014
    Posts:
    20
    It's down for me. Tried a website called downforeveryoneorjustme ....and it says your site is down. I'm having trouble with skinned meshes and it doesn't help that your documentation is online only -_- ...
     
  25. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,929
    Hi!

    Seems up for me, here’s the link to softbody skinning in the docs:
    http://obi.virtualmethodstudio.com/manual/6.3/softbodyskinner.html

    Could have been a momentary hitch in our hosting provider. FYI, you can download the documentation in pdf format using a variety of tools. I’ve done this in the past with Unity’s own docs to read them when I don’t have internet access.

    let me know if I can be of further help.
     
  26. AlonMixed

    AlonMixed

    Joined:
    Dec 10, 2017
    Posts:
    23
    It is down, been down for awhile. It gets up sometime, but goes down again. Tried using VPN from different countries and using Tor, too.
     
    Last edited: Nov 1, 2023
  27. manurocker95

    manurocker95

    Joined:
    Jun 14, 2016
    Posts:
    210
    It's always been up. It's just not secure due to the lack of SSL certificates

    upload_2023-11-3_18-55-21.png
     
    arkano22 likes this.
  28. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,490
    Hi there, question if ok, when will you plan to update the fluxy asset, I see this version on youtube
    but will we ever get it? Please can we get that, I'd love to get the sallow water sim part (hopefully for BIRP not URP etc)! :)
     
  29. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,929
    Hi,

    It’s still under development, will be released during the first quarter of 2024, not possible to give an exact date yet.

    Physics will work for all render pipelines, as usual. Most of the sample scenes will use shaders authored for URP, though it should be simple to convert them to BIRP (most of the time, just a matter of adding “built-in” as a compilation target in the shader)

    Kind regards,
     
    khos likes this.
  30. AlonMixed

    AlonMixed

    Joined:
    Dec 10, 2017
    Posts:
    23
    No, it doesn't, after accepting connection without ssl it just shows "site not found".
     
  31. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,929
    That's very strange. I use both the manual and the forums multiple times a day without issue (new posts keep being added to the forum by other users), hosting provider reports no downtime in the past few weeks. Checking site status with several webpages/utils shows it's up:

     
  32. AlonMixed

    AlonMixed

    Joined:
    Dec 10, 2017
    Posts:
    23
    upload_2023-11-7_20-28-56.png
     
  33. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,929
    Last edited: Nov 7, 2023
  34. manurocker95

    manurocker95

    Joined:
    Jun 14, 2016
    Posts:
    210
    Looks like you have some kind of weird setup. It always worked for me...
     
  35. AlonMixed

    AlonMixed

    Joined:
    Dec 10, 2017
    Posts:
    23
    The first one works, the second one doesn't the same as the documentation.

    Tried VPN from different countries, I am connecting from Russia. Nothing helps. It did work for some time, but then stopped again, haven't been able to open the site for more than two weeks now.
     
  36. AlonMixed

    AlonMixed

    Joined:
    Dec 10, 2017
    Posts:
    23
    I'm not the only one with this problem and I don't have any weird setup, whatever that means.
     
  37. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,929
    Domain and physical hosting are the exact same for both urls, only difference is that the second one is a subdomain. If you can access the first one but not the second, it is definitely a problem on your end. Maybe a dns/caching issue?

    obi.virtualmethodstudio.com just points to:
    http://www.virtualmethodstudio.com/obi/

    same for the manual:
    http://www.virtualmethodstudio.com/obi/manual/6.3/

    Can you access either one?

    Just tried using a VPN to connect from Russia, still works fine for me.

    If the issue persists and you still can’t access the website, let me know and I’ll send you the manual in pdf format so you can consult it in the meantime. Our support email is also available for support requests in case you can’t use the forums either.

    kind regards
     
    Last edited: Nov 14, 2023
  38. nehvaleem

    nehvaleem

    Joined:
    Dec 13, 2012
    Posts:
    437
    Maybe the issue is related to the ssl certificate which seems to be invalid for the subdomain?
     
  39. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,929
    Apparently not, the user said:
    Anyway, afaik regular (ie, not wildcard) SSL certificates work for a specific domain / subdomain. Currently, only the domain is protected using SSL, but that shouldn't intermittently prevent a specific user from accessing the subdomain?
     
    AlonMixed likes this.
  40. AlonMixed

    AlonMixed

    Joined:
    Dec 10, 2017
    Posts:
    23
    I managed to connect using Tor, so no need, thanks for the help
     
    arkano22 likes this.
  41. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,929
    We have added a wildcard SSL certificate that extends to all subdomains of www.virtualmethodstudio.com, in case the lack of SSL certificate for the subdomain had anything to do with the issue as Nehvaleem suggested.

    Let me know if I can do anything else to help!
     
    Last edited: Nov 23, 2023
  42. AlonMixed

    AlonMixed

    Joined:
    Dec 10, 2017
    Posts:
    23
    Now it works!
     
  43. Jack_Martison

    Jack_Martison

    Joined:
    Jun 24, 2018
    Posts:
    143
    Any news regarding Obi 7.0?
     
  44. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,929
    It's been in beta since May. You can request access to the beta by writing to obi+beta@virtualmethodstudio.com, stating your invoice number.

    During the first couple months of beta testing, quite a few bugs and usability quirks were reported that eventually led us back to the drawing board to redesign some aspects of it. The beta was updated a couple months ago with quite a few changes and so far things are going smooth, we're going to give it some more time for reports to come in (probably around one more month) while we keep doing internal stress tests and refining documentation before launch.

    Here's what's new:
    http://obi.virtualmethodstudio.com/manual/7.0/whatsnew.html
     
  45. Jack_Martison

    Jack_Martison

    Joined:
    Jun 24, 2018
    Posts:
    143
    Oh wow, so this is confirmed that Fluids going to support HDRP? Since it was our main drawback
     
  46. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,929
    Yes, they do support HDRP. Fluid rendering is done by generating a mesh, so you can use regular materials on it. The only limitation is that the vertex shader must decompress vertex data, since we store normals using octahedral projection. This is easily done using Shadergraph and a node that does this for you is included with the asset.
     
    Jack_Martison likes this.
  47. yzd999922

    yzd999922

    Joined:
    Feb 26, 2024
    Posts:
    3
    Hello, I am using the latest obi, but I encountered a problem. When there are multiple OBI Rope in my project, it will be difficult to run webGL when publishing. Why? Please help me, thank you
     
  48. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,929
    Hi,

    Unity's Burst compiler does not support WebGL. As a result, any Burst/Jobs code run on WebGL will use a single thread, using no vectorization.

    This is mentioned in the asset's description, its manual, faq, and Burst's manual as well:

     
  49. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,929
    No, not unless Unity decides to add WebGL support to the Burst compiler. Unfortunately it's not in our hands to do anything about it.
     
  50. yzd999922

    yzd999922

    Joined:
    Feb 26, 2024
    Posts:
    3
    ok thank you great author