Bug / Crash Lag issues when pouring a viscous fluid on a torus model - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Fluid (https://obi.virtualmethodstudio.com/forum/forum-3.html) +--- Thread: Bug / Crash Lag issues when pouring a viscous fluid on a torus model (/thread-1611.html) |
Lag issues when pouring a viscous fluid on a torus model - AnshuJalan - 08-01-2020 Issue: My game is working fine when I am pouring the viscous fluid on the default 3D objects in Unity engine, but when I am using a torus (the default doughnut-shaped 3D object provided by Blender) I am having a serious lag issue. I just started using Obi fluid and I am unable to understand why this is happening. P.S: I am using the default sample scene for viscous fluids provided by Obi. The settings of the Obi components in the case of a torus and the other objects are exactly the same. I am experiencing the lag both in the editor as well as the build. Default Shape and Torus comparison video: Is this a bug, and is there any solution to this? RE: Lag issues when pouring a viscous fluid on a torus model - josemendez - 08-01-2020 (08-01-2020, 03:47 PM)AnshuJalan Wrote: Issue: My game is working fine when I am pouring the viscous fluid on the default 3D objects in Unity engine, but when I am using a torus (the default doughnut-shaped 3D object provided by Blender) I am having a serious lag issue. I just started using Obi fluid and I am unable to understand why this is happening. Hi, This is not a bug, or a issue in Obi. MeshColliders are extremely costly compared to primitive colliders -boxes, spheres, etc- and should be avoided when possible. Not just in Obi, in Unity too, and pretty much any physics engine. Each fluid particle must be tested for collisions against multiple triangles of the MeshCollider. The denser the mesh, the costlier collision detection becomes. Compared this a sphere or a box, where each particle can be tested only once (since they're simple shapes, there's an analytical expression for them). Either reduce the amount of triangles in your torus, or (the preferred approach) use a distance field: http://obi.virtualmethodstudio.com/tutorials/distancefields.html RE: Lag issues when pouring a viscous fluid on a torus model - AnshuJalan - 08-01-2020 (08-01-2020, 03:57 PM)josemendez Wrote: Hi, Thank you! The distance field approach got it working. |