|
|
Manual fluid emission throw exception with Compute backend |
Posted by: turkugamelabdev - 25-01-2024, 12:37 PM - Forum: Obi Fluid
- Replies (1)
|
|
Hi,
I received the latest ObiFluid 7 beta on 24/1/2024. I want to manually emit particle by setting emitter.speed = 0 and then call emitter.EmitParticle() instead. However, the emitter.EmitParticle() on Compute backend caused this exception:
Code: ArgumentNullException: Value cannot be null.
Parameter name: buffer
UnityEngine.ComputeShader.SetBuffer (System.Int32 kernelIndex, System.Int32 nameID, UnityEngine.GraphicsBuffer buffer) (at <f7237cf7abef49bfbb552d7eb076e422>:0)
UnityEngine.ComputeShader.SetBuffer (System.Int32 kernelIndex, System.String name, UnityEngine.GraphicsBuffer buffer) (at <f7237cf7abef49bfbb552d7eb076e422>:0)
Obi.ComputeFluidMesherSystem.Render () (at Assets/Obi/Scripts/Common/Backends/Compute/Rendering/Fluid/ComputeFluidMesherSystem.cs:406)
Obi.ObiRenderSystemStack.Render () (at Assets/Obi/Scripts/Common/Solver/ObiRenderSystemStack.cs:41)
Obi.ObiSolver.Render (System.Single unsimulatedTime) (at Assets/Obi/Scripts/Common/Solver/ObiSolver.cs:1527)
Obi.ObiSolver.LateUpdate () (at Assets/Obi/Scripts/Common/Solver/ObiSolver.cs:970)
This does not happen on Burst backend.
Here is simple code to replicate the error:
Code: public class EmitManually : MonoBehaviour
{
[SerializeField] private ObiEmitter emitter;
[Range(1, 100)]
[SerializeField] private uint particlesPerEmission = 1;
private void Awake()
{
emitter.speed = 0;
emitter.minPoolSize = 0;
}
private void Update()
{
if (Input.GetKeyDown(KeyCode.Space))
{
for (uint i = 0; i < particlesPerEmission; i++)
emitter.EmitParticle(0);
}
}
}
|
|
|
How to teleport a rope |
Posted by: HPx___ - 23-01-2024, 06:37 PM - Forum: Obi Rope
- Replies (5)
|
|
Hi,
I would like to teleport a rope in Unity.
Teleport method move only one end of the rope.
How to move the whole rope in one time, without streching it ?
Thanks,
|
|
|
SpatialQuery with ComputeBackend in Obi Fluid 7 Beta |
Posted by: turkugamelabdev - 20-01-2024, 09:12 PM - Forum: Obi Fluid
- Replies (3)
|
|
Hi,
I was trying to do spatial querying in Obi Fluid 7. Based on the documentation, there are EnqueueSpatialQueries() method and solver.OnSpatialQueryResults event to get the result asynchronously from ComputeBackend. However, I could not find those in current beta package. I received ObiFluid_7.0b package on 9/1/2024. Is this package up-to-date with the documentation?
|
|
|
Issue with Softbody Simulation for Vascular Modeling |
Posted by: W_chack - 10-01-2024, 07:37 AM - Forum: Obi Softbody
- Replies (4)
|
|
Hi,
I am writing to ask for help.I'm currently working on simulating a vascular wall using a model of blood vessels with Blender's softbody physics. However, I'm facing some problem with the particle not conforming well to the vascular walls.
When generating the blueprint for the entire vascular model, the particles do not adhere properly to the vascular walls. Even when I import individual sections of the model into the softbody blueprint, the issue persists.
I tried dividing the model using Blender, and interestingly, using the bottom four vessels produces better-fitting particles. However, as I increase the length of the divided vessels, the simulation quality deteriorates(the number of particles reduced).
On further inspection, I noticed that when I isolate a portion of the top vessels and attempt to generate particles, they consistently fail to conform to the vascular walls.
I've attached images illustrating these issues.
[color=var(--tw-prose-bold)]My question is: How can I modify either the model or the settings during blueprint generation to address these issues? [/color]
Thanks in advice for any help.
|
|
|
OBI Performance degradation over time |
Posted by: michendo - 09-01-2024, 09:55 AM - Forum: General
- Replies (3)
|
|
Hi,
I have a collection of issues relating to performance degradation over time in the scene when using Obi Cloth on relatively complex 2-manifold meshes. I am creating a game where you inflate objects (such as life rafts, balls, Santas, snowmen, etc). The inflation mechanic works pretty well. However, on some meshes, there are odd performance issues. Apologies, this is going to be a couple of odd observations that may or may not be related.
I have noticed that as the scene is running, increasing calls are being made to ObiFixedUpdator.FixedUpdate/Substep. It increases from 5 (which is what I expect) and then after a minute can increase to 20 or 25 which is where the issues start. Even if there is no action in the game, this number starts increasing.
Some odd things I have noticed...
Once the issue starts, it persists even after I reload the same scene (like in a replay game). In fact, it can be even worse when I reload the scene. However, if I reload the scene quickly a few times, it seems to reset the calls back to a low number, and it behaves normally.
Even more oddly, if I destroy the object that has the obi solver and the obi actor, then wait a few seconds, reloading the scene will result in disastrous performance. Performance is good when I have destroyed the object before I reload the scene, but then the number of calls immediately goes to 30+ on the next scene when the OBI object returns. It's almost like there is a leak somewhere, and reloading the scene doesn't fix it (though reloading it frequently in quick succession does). Note, I destroy the object when the inflatable object has "exploded" due to over-inflation (my own mechanic). Is it wrong to destroy the OBI Solver and Actor?
The mesh with the problem has 2362 triangles and is the only OBI actor in the scene. I also have an OBI Collider, an OBI rigid body, and an Obi Particle attachment on it.
I have tried both Oni and Burst and the problem occurs with both, though I think Oni is a little better. With Burst, I have safety checks switched off of course.
Thanks in advance.
michael.
|
|
|
Copy ropes in play mode |
Posted by: Alexander34 - 08-01-2024, 03:53 PM - Forum: Obi Rope
- Replies (5)
|
|
Greetings. I have not found a normal and stable way to copy ropes. I need to have two ropes in the same solver, one of them is always on. When I turn off one and turn on the other, I need to copy the position and number of particles. Visually it should look like one rope is replaced by another, but remains in the same state as the previous one. I don't want to use the ObiParticleRenderer solution, I want to copy all positions of the previous rope to the one we are going to turn on. As far as I know, the positions are accessed via solver.positions, but if I understand correctly, these are the positions of both ropes being simulated.
Code: public void AttachRope()
{
_blueprint = ScriptableObject.CreateInstance<ObiRopeBlueprint>();
var fatherConnectionPoint = _playersContainer[PlayerCharacter.Father].ConnectionPoint;
var sonConnectionPoint = _playersContainer[PlayerCharacter.Son].ConnectionPoint;
Vector3 father = ObiRope.transform.InverseTransformPoint(fatherConnectionPoint.position);
Vector3 son = ObiRope.transform.InverseTransformPoint(sonConnectionPoint.position);
int allLayers = (1 << 16) - 1;
int excludeLayer15 = ~(1 << 15);
int finalMask = allLayers & excludeLayer15;
int filter = ObiUtils.MakeFilter(finalMask, 1);
_blueprint.path.Clear();
_blueprint.path.AddControlPoint(father, -father.normalized, father.normalized, Vector3.zero, 0.1f, 0.1f, 1, filter, Color.white, "start");
_blueprint.path.AddControlPoint(son, -son.normalized, son.normalized, Vector3.zero, 0.1f, 0.1f, 1, filter, Color.white, "end");
_blueprint.path.FlushEvents();
_blueprint.Generate();
ObiRope.ropeBlueprint = _blueprint;
var pinConstraints = ObiRope.GetConstraintsByType(Oni.ConstraintType.Pin) as ObiConstraints<ObiPinConstraintsBatch>;
pinConstraints.Clear();
var batch = new ObiPinConstraintsBatch();
batch.AddConstraint(ObiRope.solverIndices[0], _fatherConnectionPointObiCollider, Vector3.zero, Quaternion.identity, 0, 0, float.PositiveInfinity);
batch.AddConstraint(ObiRope.solverIndices[_blueprint.activeParticleCount - 1], _sonConnectionPointObiCollider, Vector3.zero, Quaternion.identity, 0, 0, float.PositiveInfinity);
batch.activeConstraintCount = 2;
pinConstraints.AddBatch(batch);
ObiRope.SetConstraintsDirty(Oni.ConstraintType.Pin);
}
Here's the code I use to create a rope between father and son in real time. It is created in a straight line from son to father. I also have a second rope with a different physical behavior that gravitates to points of interest in zero gravity. At some point I turn off the zero gravity thread and load other settings into solver, while turning on the second thread. I need in some cases for the thread with gravity to replicate the thread without gravity, but at the same time, sometimes I need it the way it already works.
|
|
|
Help: Making a cable with plug on each end? |
Posted by: qualar - 02-01-2024, 01:05 PM - Forum: Obi Rope
- Replies (3)
|
|
I am trying to make a cable with a plug on each end of the cable. I have attached the plugs to each end using an attachment. However, when i drag one of the plugs in the application rather than the plug at the other end been dragged along with the rope the rope just stretches and the plug at the end remains in the same place.
How can i get it so that when i pull plug at the start the plug at the end drags. I want the cable to remain a fixed length.
Thanks in advance.
|
|
|
|