Search Forums

(Advanced Search)

Latest Threads
Changing solver gravity v...
Forum: Obi Fluid
Last Post: T-1000
37 minutes ago
» Replies: 2
» Views: 15
Problems deleting obi col...
Forum: Obi Rope
Last Post: btduser
1 hour ago
» Replies: 6
» Views: 87
Need the positions to dri...
Forum: Obi Fluid
Last Post: spikebor
4 hours ago
» Replies: 0
» Views: 13
Frequent crash after assi...
Forum: Obi Fluid
Last Post: spikebor
5 hours ago
» Replies: 6
» Views: 175
When I use ObiBone with m...
Forum: Obi Rope
Last Post: josemendez
6 hours ago
» Replies: 1
» Views: 3
Usando ejemplo del Rollin...
Forum: Obi Fluid
Last Post: josemendez
Today, 07:48 AM
» Replies: 1
» Views: 37
Softbody for head Model s...
Forum: Obi Softbody
Last Post: josemendez
11-05-2024, 07:52 AM
» Replies: 1
» Views: 42
Bigger foam with Alpha di...
Forum: Obi Fluid
Last Post: spikebor
10-05-2024, 08:57 AM
» Replies: 12
» Views: 410
Changing the rope's posit...
Forum: Obi Rope
Last Post: Crystalius
09-05-2024, 08:54 AM
» Replies: 3
» Views: 106
RESET Obi Softbody
Forum: Obi Softbody
Last Post: spikebor
09-05-2024, 06:12 AM
» Replies: 11
» Views: 2,878

 
  Performance Spikes in Fixed Update and MeshSkinning
Posted by: jp715 - 19-11-2019, 10:21 PM - Forum: Obi Cloth - No Replies

Hi! Really enjoying using Obi Cloth so far, and I'm hoping to learn more about optimizing it to use in our game. It's a VR game, but right now I'm working on a scene where a character's clothes moves in response to wind. Right now, all I have in the scene is the character's shirt. I'm using a cloth proxy, where the source cloth uses a mesh of about 400 vertices and 200 clothing particles, and the target is a mesh of about 2300 vertices. The solver is only using distance, skin and aerodynamic constraints, with 1 iteration each for distance and skin constraints. Wind is being simulated with a spherical force zone that rotates around the player, with intensity and turbulence of 25.

On average, performance is pretty good, but there are a lot of irregular spikes when I profile it. On average obi will run about 1-2 ms per frame (if I add up ObiSolver.FixedUpdate(), ObiExternalForce.FixedUpdate() and ObiSolver.LateUpdate() ), but it'll randomly spike to anywhere between 5 and 20 ms.

I've seen other posts that recommend lowering the max timestep but that doesn't seem to help. I've lowered it down to 0.011 with a fixed timestep of 0.011 (set by SteamVR), and there are still spikes. Also things start to slow down and look weird, and other parts of the game depend on physics so I don't want to mess with global time settings too much.

Screenshot of a spike with maximum allowed timestep set to 0.011:
[attachment=471]

Another spike, while maximum allowed timestep is 0.02:
[attachment=476][attachment=475]

Similar spikes occur when I have the solver in after fixed update and late update mode.

After Fixed Update:
[attachment=474]

Late Update:
[attachment=472]

In addition, there seems to be quite a performance draw in general from MeshSkinning.Update(). When I disable the skinned mesh renderer, there is an almost identical performance cost from VSync, if that is relevant. If you have any suggestions for how to improve this or the spikes, that would be great!

Print this item

  Change UV anchor runtime
Posted by: TheMunk - 19-11-2019, 01:15 PM - Forum: Obi Rope - Replies (2)

Is this possible?

I want to fake a rope paying extending like a endless conveyor belt. 
Alternatively I would use two cursors to add in one end and delete in the other, but i guess it would have higher performance to not simulate particles at all and just change the uv anchor, however doing "renderer.uvAnchor = renderer.uvAnchor - speed * Time.deltaTime" does not work at runtime or in executeineditormode.


(19-11-2019, 01:15 PM)TheMunk Wrote: Is this possible?

I want to fake a rope paying extending like a endless conveyor belt. 
Alternatively I would use two cursors to add in one end and delete in the other, but i guess it would have higher performance to not simulate particles at all and just change the uv anchor, however doing "renderer.uvAnchor = renderer.uvAnchor - speed * Time.deltaTime" does not work at runtime or in executeineditormode.

Seems like calling UpdateRenderer() with null paramters works fine. Is this inteded?

EDIT: It doesn't work when building to Oculus quest. I can't figure out why...

Print this item

  Generating and using distance field at runtime
Posted by: fortinmike - 16-11-2019, 03:57 PM - Forum: Obi Fluid - No Replies

Hi there,

I'm using Obi Fluid in my game and so far it works very well! However, there is something very specific to my use case that I'm trying to accomplish without success so far.

I'm generating a mesh at runtime through a script. I've been able to make fluid collisions work with it by adding the ObiCollider to my mesh-containing GameObject at runtime, after the mesh is updated, like so:

Code:
void RecreateObiCollider()
   {
       Destroy(_plane.GetComponent<ObiCollider>());

       _plane.AddComponent<ObiCollider>();
       var collider = _plane.GetComponent<ObiCollider>();
       collider.CollisionMaterial = _collisionMaterial;
   }

However as my plane has many vertices, you can guess that performance is far from excellent with lots of particles.

I've investigated using a distance field to gain performance and I was able to make collisions work with a static mesh of the same plane and performance did increase substantially.

The issue I have is that I need to use a runtime generated mesh for collision detection; there is no way for me to know what the mesh will look like in advance to generate a distance field for it in the editor. Thus, I'm trying to generate and assign the distance field at runtime after generating my mesh. I haven't been able to get this working.

Here is the code I have so far. When that code runs, collisions work just fine until the distanceField.Generate() coroutine ends, after which the distance field is assigned. Then, collisions stop working completely and particles go right through my mesh. As far as the setup is concerned, it looks fine in the editor in play mode; the distance field is assigned and enabled, etc.

Code:
IEnumerator RecreateObiCollider()
   {
       Destroy(_plane.GetComponent<ObiCollider>());

       var distanceField = (ObiDistanceField)ScriptableObject.CreateInstance("ObiDistanceField");
       distanceField.InputMesh = _mesh;
       yield return StartCoroutine(distanceField.Generate());

       var collider = _plane.AddComponent<ObiCollider>();
       collider.CollisionMaterial = _collisionMaterial;
       collider.distanceField = distanceField;
       collider.UseDistanceFields = true;
   }

Any help would be appreciated!

Print this item

  Particles and fluid not rendering in running game
Posted by: Protemus - 16-11-2019, 05:05 AM - Forum: Obi Fluid - Replies (5)

I can't seem to figure out how to get the fluid displaying in the game when I run it.  If  run the game, I can switch to the "Scene" tab and if I turn on "Edit Particles" in the emitter I can see that my particles are indeed there and running, they just aren't getting rendered.

I have added an Obi Emitter, an Obi Emitter Shape Disk and an Obi Particle Renderer all to an empty game object. (I attached the settings screenshot here), but it just doesn't seem to render in my game when it is running.  And idea what I could be doing wrong here?

Thanks,
Sean

Print this item

  Avoid softbody getting stuck in the wall
Posted by: manurocker95 - 14-11-2019, 10:18 AM - Forum: Obi Softbody - Replies (2)

When dragging with the particle dragger, the objects get stuck in the wall. I increased the solver collision evaluations to 10 but it still happens. Any clue?

Print this item

  Scripting Particles not working and cube passing through
Posted by: manurocker95 - 14-11-2019, 10:15 AM - Forum: Obi Softbody - No Replies

Hi! Just made the scripts from http://obi.virtualmethodstudio.com/tutor...icles.html with the exact same code (adding the solver variable) to a simple scene and it just do nothing. But nothing at all. In addition, I made a simple cube, added the softbody component and it passes through the floor. Can someone try to help me? 

Video of what happens: https://gofile.io/?c=EgFZja



Btw, a discord for support instead of this forum, would be nice.

Print this item

  Obi + Havok
Posted by: Barliesque - 13-11-2019, 07:44 PM - Forum: General - Replies (5)

Will the Obi physics engine eventually be able to interact with Unity's support for Havok?  The reliability and performance of Havok over Unity's built-in physics is *very* compelling.

Print this item

  Handle creation under the same parent object?
Posted by: Bill Sansky - 13-11-2019, 03:10 PM - Forum: General - Replies (1)

Hi!

I have a small suggestion for the handle creation (but I guess this may be irrelevant due to Obi 1.5 coming):
Could we have the handles be created under the same parent object as the parent of the obi actor in Unity's Hierarchy?
The reason I am asking is that when you are in prefab edition mode, currently you cannot create handles as they are added to the scene of the prefab so they won't be saved in the prefab.

If the handle would be added under the same parent, it would directly be in the prefab.

Thanks!

Edit: I fixed it on my side by adding " c.transform.SetParent(actor.transform.parent);" in the ObiParticleActorEditor class after line 1130, but I suppose this fix could be interesting for users in general since the nested prefabs are starting to be more in use.

Print this item

  How to use one softbody with separated skinned meshes
Posted by: manurocker95 - 13-11-2019, 01:48 PM - Forum: Obi Softbody - Replies (6)

Hi! My objects have separated skinned meshes instead of just one. How do I use one softbody for all the softbody skinners? Do I have to bake the mesh before using it?

Print this item

  Obi does not handle the new Scene loading in 2019.3
Posted by: Bill Sansky - 12-11-2019, 11:09 PM - Forum: General - Replies (2)

Hi,

In case you guys are not aware of this, Obi does not handle well the new "Enter Play Mode without domain / scene reload" thing from Unity 2019.3 beta
Some obi colliders are skipped and sometimes the pins behave in an unstable way.

It seems to be caused by some static variables not being properly re-initialized

I tried to fix it by clearing the collider dictionary with a static method with the [RuntimeInitializeOnLoadMethod] attribute, but it's not working perfectly even with that.

Is there any other static referencing involved?

Thanks!

Print this item