Search Forums

(Advanced Search)

Latest Threads
Fluid ignores colliders o...
Forum: Obi Fluid
Last Post: josemendez
Yesterday, 09:03 AM
» Replies: 2
» Views: 38
Particle attachments dont...
Forum: Obi Rope
Last Post: josemendez
13-02-2025, 03:09 PM
» Replies: 1
» Views: 102
Dynamic attachment to fix...
Forum: Obi Rope
Last Post: josemendez
12-02-2025, 02:52 PM
» Replies: 9
» Views: 339
Changing rope lenth creat...
Forum: Obi Rope
Last Post: josemendez
11-02-2025, 08:35 PM
» Replies: 3
» Views: 180
Preventing fabric from vi...
Forum: Obi Cloth
Last Post: josemendez
10-02-2025, 12:36 PM
» Replies: 1
» Views: 128
Trouble with Attachments
Forum: Obi Softbody
Last Post: beegon
07-02-2025, 08:29 PM
» Replies: 3
» Views: 229
Mesh creating
Forum: Obi Rope
Last Post: alicecatalano
07-02-2025, 11:28 AM
» Replies: 13
» Views: 22,503
Collider interactions
Forum: Obi Softbody
Last Post: josemendez
07-02-2025, 09:42 AM
» Replies: 1
» Views: 159
RuntimeRopeGenerator basi...
Forum: Obi Rope
Last Post: ayoci
04-02-2025, 04:30 PM
» Replies: 0
» Views: 1,545
static 2nd attachment cau...
Forum: Obi Rope
Last Post: josemendez
04-02-2025, 07:53 AM
» Replies: 1
» Views: 197

 
  Obi7Beta | Fluid can not work with paused game and UI
Posted by: spikebor - 06-05-2024, 06:12 PM - Forum: Obi Fluid - Replies (2)

Hi, happy to have my first bug report for Obi 7 Gran sonrisa . The problem:
In my UI code, when menu opened, game is paused by setting

Code:
                Time.timeScale = Mathf.Epsilon;

Game is paused, but my UI can still work, I can click button and that button clicked will do some action.
This UI document can work with any scene, but when I open a Fluid scene (sample: ComputeFluids), when play the game and open UI menu, I can move the focus, but cannot click any button. Essentially, the "consume click" event of the UI Document is somehow stopped working?

So, my conclusion is Compute Fluid has some bug with Time.timeScale = Mathf.Epsilon; that will mess up my UI. It is not frozen, just not consume clicks.

Also, I suggest for a feature to pause ObiSolver from updating. Currently I can only disable ObiSolver when I do not want it to update, but by doing so, for example the Fluid, it will disappear. If the Fluid stop updating but still render, it can be neat for a stop time gameplay feature.

Print this item

  Setting angular velocity of a kinematic body is not supported
Posted by: vrtraining - 06-05-2024, 02:38 PM - Forum: Obi Rope - Replies (1)

Im getting this error 

Code:
Setting linear velocity of a kinematic body is not supported.

If I manually set my Game Object Rigidbody to Kinematic during runtime, I keep getting this error. Its coming from ObiRigidBody.cs

Code:
private void UpdateKinematicVelocities(float stepTime)
        {
            // differentiate positions/orientations to get our own velocites for kinematic objects.
            // when calling Physics.Simulate, MovePosition/Rotation do not work correctly. Also useful for animations.
            if (unityRigidbody.isKinematic)
            {
                // differentiate positions to obtain linear velocity:
                unityRigidbody.velocity = (transform.position - prevPosition) / stepTime;

                // differentiate rotations to obtain angular velocity:
                Quaternion delta = transform.rotation * Quaternion.Inverse(prevRotation);
                unityRigidbody.angularVelocity = new Vector3(delta.x, delta.y, delta.z) * 2.0f / stepTime;
            }

            prevPosition = transform.position;
            prevRotation = transform.rotation;
        }


Any idea that I could suppress or get rid of this warning? Im using latest 6.5 version with Unity 2023.2.19f

Print this item

  Is there a way to query collisions with Obi Bone?
Posted by: spikebor - 06-05-2024, 12:00 PM - Forum: Obi Rope - Replies (5)

I want to detect collisions with this character (which has nothing on him other than Obi bone)
Can it be done, or he should have Collider? I think Obi Bone or not, it has particles under it as all Obi things, so I can query its collisions with my character (my character has Obi Collider)
I want to debug the impulse.

[Image: AfR6o6v.png]

The Golem can contact and push my character back, but this code (subscribed to character's solver.OnCollision event) returns no collisions.

Code:
        void Solver_OnCollision(object sender, ObiSolver.ObiCollisionEventArgs e)
        {
            foreach (Oni.Contact contact in e.contacts)
            {
                collisionsImpulse += contact.normalImpulse;
            }
        }

Even though I enable Collision and Particle Collision collision / Queries on my character.

Print this item

  Compatibility with magicacloth2
Posted by: etemaru - 04-05-2024, 12:16 PM - Forum: Obi Fluid - Replies (3)

An error occurs when magicacloth2 and obi fluid are used together, and the error continues even if magicacloth2 is removed.

What should I do?

Print this item

  Rope Jittering/ Stuttering
Posted by: Nixon - 03-05-2024, 12:46 PM - Forum: Obi Rope - Replies (3)

Good Day, 

thank you for your time! 
I am currently experiencing rope stuttering in my VR Game. I have made a small video demostration, where you can have a look at how it is experiecned:

https://drive.google.com/uc?id=171SoEWaf...t=download

Then after watching the video, heres some screenshots from the Components!

I have attatched two screenshots to this, one is the Solver Inspector + Hierarchy and one is one of the Ropes Inspector


Again, thank you so much in advance!
Best,
Nixon Sonrisa

Print this item

Exclamación Advection but for a mesh.
Posted by: spikebor - 03-05-2024, 09:28 AM - Forum: Obi Fluid - Replies (2)

I'm thinking about this idea for a while.
We got: 
-Obi Fluid which is limited in particle count, making something like a pool will be hard on the GPU.
-Obi fluid can advect things near it, like shuriken particles.

So why can't we apply the same advection idea, but instead of shurikens, we apply it to the nearby mesh vertex?

So the idea is we have a pool of Obi fluid particles, which having very large particle scale, and not rendered.
With this we can have any object that jump into the pool will be physics collide and have buoyancy force to pull it up but with low particle count.
And on top we have a plane mesh for the surface, which advected by the Obi Fluid. This way the mesh can have deformation, this mesh can be Fluxy mesh which have 2.5D sim on top to give us detailed waves simulation, while the Obi Fuild give it bigger wave advection.

Isn't this a best of both world? You can make a bridge asset that have 2 requirements that are Fluxy and Obi Fluid. If you can add underwater rendering for it, it will sell like hot cakes.

Print this item

Pregunta Tips for optimization using many characters with softbody?
Posted by: spikebor - 03-05-2024, 09:14 AM - Forum: Obi Softbody - Replies (2)

I've done all I can in the setting: enable Burst, solver set fixed sub step to 1 and all the constraint to 1, only update when looking at, generate low-res blueprint.

This is 8 Slime characters Result:

Fixed Update enabled: When look at: 250 fps, when look away: 320 fps.

Fixed Update disabled: 450 fps (I'm curious about this part, why is it greater than the look-away option while Simulate When Invisible is off? I expect it would be the same, is there still some calculation not eliminated here?)

250-320 fps is very good not gonna lie. I would not target greater than 60 fps though, just wanna ask to further optimize it because I want to have some spare fps for other Obi sim like cloth rope water etc.

One note: before going with this good range 250-320 fps, I'm at 60 fps just because the blueprint resolution kinda detailed. Just making it low-res get me to this point so I wanna point out this important info for anyone who happen to see this. Gran sonrisa

Print this item

  Obi Fluid 6 not render on Window build
Posted by: spikebor - 02-05-2024, 05:07 PM - Forum: Obi Fluid - Replies (3)

Hi, I have this bug when test build on PC Window the Obi Fluid
Obi Fluid 6.5.4, works well on Editor using the Obi/URP/Particles.shader, but not work on PC build (x64 window).
Unity URP 2022.3.16f1
Do I miss any setup step?

Log:

Code:
Particle rendering shader not suported.
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogWarning(Object)
Obi.ObiParticleRenderer:CreateMaterialIfNeeded()
Obi.ObiParticleRenderer:DrawParticles(ObiActor)
Obi.ObiActor:Interpolate()
Obi.ObiSolver:Interpolate(Single, Single)
Obi.ObiUpdater:Interpolate(Single, Single)
Obi.ObiFixedUpdater:Update()

--Stack Trace--
Obi Fluid Renderer not supported in this platform.
UnityEngine.Debug:LogWarning(Object)
Obi.ObiFluidRendererFeature:AddRenderPasses(ScriptableRenderer, RenderingData&)
UnityEngine.Rendering.RenderPipelineManager:DoRenderLoop_Internal(RenderPipelineAsset, IntPtr, Object)

Print this item

Pregunta I've made a bounce script, but don't know how to optimize
Posted by: spikebor - 01-05-2024, 12:35 PM - Forum: Obi Softbody - Replies (3)

Hi, the idea is simple, to improve the game feel when character make contact with the softbody.
I would like to have softbody handle OnContact by iterate the contacts and add the incoming contact impulse with a mult value,
so that we can have a squashed feel when character step on a slime.
When it works, it is very cool to look at Gran sonrisa !

But eventually it can be very easy to spiral into a dead performance degradation, since each time you got contact, you have to iterate the contacts, and then iterate the particles to detect which particle is near to add the bounce force.

For example: 10 contact, 1000 particles, that is 10000 iterations each time we got contact. Wow!
How can I optimize this?

Code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Obi;
using Unity.Mathematics;

namespace SPIKE.kIntegration
{
    //when got some contact, be squashed by that contact in normal direction
    [RequireComponent(typeof(ObiActor))]
    public class ObiBouncer : MonoBehaviour
    {
        [SerializeField] ObiSolver _solver;
        [SerializeField] float _propagate = 0.5f, _bounceForceMult = 10,_clampBounceForce=10;
        [SerializeField] bool _debug;

        ObiActor actor;

        void Awake()
        {
            actor = GetComponent<ObiActor>();
        }

        void OnEnable()
        {
            _solver.OnCollision += Solver_OnCollision;
        }

        void OnDisable()
        {
            _solver.OnCollision -= Solver_OnCollision;
        }

        void Solver_OnCollision(object sender, ObiSolver.ObiCollisionEventArgs e)
        {
            var world = ObiColliderWorld.GetInstance();

            // just iterate over all contacts in the current frame:
            foreach (Oni.Contact contact in e.contacts)
            {
                // if this one is an actual collision:
                if (contact.distance < 0.01)
                {
                    Vector3 contactOnCollider = contact.pointB;
                    contactOnCollider = _solver.transform.TransformPoint(contactOnCollider);
                    Vector3 contactNm = contact.normal;

#if UNITY_EDITOR
                    if (_debug)
                    {
                        Debug.DrawLine(contactOnCollider, contactOnCollider + contactNm, Color.yellow, 2f);
                    }
#endif
                    //iterate the particles
                    for (int i = 0; i < actor.solverIndices.Length; ++i)
                    {
                        int solverIndex = actor.solverIndices[i];
                        //add bounce force based on the propagate distance
                        if (Vector3.Distance(actor.GetParticlePosition(solverIndex), contactOnCollider)
                            < _propagate)
                        {
                            var squashForce = contact.normal * math.min( contact.normalImpulse * _bounceForceMult,_clampBounceForce);
                            actor.solver.velocities[solverIndex] += squashForce;
                        }
                    }                   
                }
            }
        }
    }
}

Print this item

  Error: Particle that does not exist in the actor
Posted by: Sky d - 01-05-2024, 10:30 AM - Forum: Obi Rope - Replies (1)

Hi.  

 I am getting an error saying that my particle attachment is not recognized.  Any advice appreciated please?

Quote:The particle group 'Receiver' references a particle that does not exist in the actor 'Obi Rope'.

UnityEngine.Debug:LogError (object)
Obi.ObiParticleAttachment:Bind () (at Assets/Obi/Scripts/Common/Utils/ObiParticleAttachment.cs:237)
Obi.ObiParticleAttachment:Actor_OnBlueprintLoaded (Obi.ObiActor,Obi.ObiActorBlueprint) (at Assets/Obi/Scripts/Common/Utils/ObiParticleAttachment.cs:198)
Obi.ObiParticleAttachment:OnEnable () (at Assets/Obi/Scripts/Common/Utils/ObiParticleAttachment.cs:172)
UnityEditor.EditorApplication:Internal_RestoreLastOpenedScenes ()

Thanks for your time.  Here's a screenshot.  In the image, I had clearly renamed my control points.  So I'm not sure how to fix.  At first, it was working fine, but then I switched to Dynamic because I wanted to have the pin constraint function active. That's when the error started to appear.
[Image: Obi-Error.png?rlkey=pia214odw0w66qvsjy2l...0ic2j&dl=1]

Print this item