Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

PhysX 4.1 in Unity - experimental builds

Discussion in 'Physics Previews' started by yant, Feb 25, 2019.

  1. BeyondInfiniti

    BeyondInfiniti

    Joined:
    Jun 24, 2018
    Posts:
    15
    @yant Any news on Physics.IgnoreCollision getting fixed for 2019.3 using the Temporal Solver?

    EDIT: Disregard, I'm wrong.
     
    Last edited: Apr 16, 2020
  2. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    596
    Is it broken? Could you kindly refer me to the case#?
     
  3. BeyondInfiniti

    BeyondInfiniti

    Joined:
    Jun 24, 2018
    Posts:
    15
  4. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    596
    Do you happen to have a small repro? I don't recall any reports exactly like that. Will try as we speak.
     
  5. BeyondInfiniti

    BeyondInfiniti

    Joined:
    Jun 24, 2018
    Posts:
    15
    Unfortunately I don't have a smaller project for repro, but I do have the project up on collab if you want to try that.

    EDIT: Oh darn, i'm at my seat limit for the collab project.
     
  6. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    596
    I've just tried reproducing it and seems to work fine. There must be an additional factor here, not just IgnoreCollision being totally broken with TGS.

    Here is the project attached.
     

    Attached Files:

  7. BeyondInfiniti

    BeyondInfiniti

    Joined:
    Jun 24, 2018
    Posts:
    15
    I'll see if I can make a small repro project.
     
    yant likes this.
  8. BeyondInfiniti

    BeyondInfiniti

    Joined:
    Jun 24, 2018
    Posts:
    15
    Hmm, i'm stumped. It's actually not Physics.IgnoreCollision, sorry about wrongly accusing it! The joints seem to jitter violently in certain cases and I can't figure out why. If I disable my arm colliders it mitigates it a bit but not totally. If I enable prepocessing it also mitigates it a bit.

    The mass differences for the joints isn't very high (not more than 2x) so I don't think it can be that. Do you have any idea why the issue only crops up with TGS?

    Sorry again for jumping to conclusions.
     
  9. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    866
    I have same issues with Temporal Solver; when I start using it, whole Physics go crazy after a few seconds. I am using lots of Configurable Joints, which are often chained.
     
  10. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,507
    Maybe TGS is not an actual improvement for already working setups? I recall not finding any significant difference when I first tested it in an early experimental build.
     
  11. NHals

    NHals

    Joined:
    Dec 23, 2013
    Posts:
    10
    I reported case 1239507 on this, as the same issue with "[Physics.PhysX] BV4 midphase only supported on Intel platforms" happens on HoloLens 2 on Universal Windows Platform ARM64 target in 2019.3.10f1.
     
    Last edited: Apr 23, 2020
  12. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    596
    Right. So the full story here is that BHV4 was a nice thing to have so I made it available everywhere it could work (which was Intel platforms). However, turned out there were platforms where we couldn't disable it automatically - because we didn't have the right flags to differentiate where this particular asset is being built to.

    After plenty of discussions, Nvidia was kind enough to send us a patch for PhysX 5 that enabled BVH across all platforms, not just Intel. I had it back-ported to PhysX4 and the change is now available on trunk (2020.2). A back-port to 2020.1 is in the merge queue as we speak. I'm hoping to bring it back to 2019.3 too.

    Hope that explains what's going on on this end. Anthony.
     
    nooxouille likes this.
  13. NHals

    NHals

    Joined:
    Dec 23, 2013
    Posts:
    10
    Thank you for the explanation :)

    I would really appreciate this fix being implemented in 2019.3 (or 4 LTS).

    Is there any workarounds to disable it globally in a Unity project that we could use? (All prefabs and scenes with mesh colliders break and must be modified :|)
     
  14. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    596
    Unfortunately not. There's nothing to disable it globally. By the way, the fix is accepted for 2020.1.0b9. I'm opening a 2019.3 PR then.
     
    NHals likes this.
  15. breeannazirkle

    breeannazirkle

    Joined:
    Mar 6, 2020
    Posts:
    2
    I am wondering how to increase buffer size in Physx 4.1 unity package?
     
  16. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    596
    Could you please elaborate on what are you trying to achieve using what means? We don't have a package for PhysX 4.1, and even if we did, there's no buffer to increase manually anyways. Anthony.
     
  17. eron82

    eron82

    Joined:
    Mar 10, 2017
    Posts:
    83
    I have a simple scene with a ball with a random speed and a script with physicsSim.Simulate(Time.fixedDeltaTime) to know where the ball will bounce on the ground, then a new random speed is applied and new simulated bounce are calculated and so on. Randomly the simulated ball is stucked onto the ground at the first bounce, but the real ball bounces more the 2 times. This doesn't happen if the initial speed is not random but it's always the same. I noticed that if i change the default contact offset from 0.01 to 0.1 or another value the bug always happens. The simulated ball touches the ground the first time and it doesn't bounce. The real ball bounces normally.
     
  18. nih_

    nih_

    Joined:
    Aug 7, 2017
    Posts:
    8
    As the bugreport is closed I cannot track the progress of this fix into Unity 2019.3, do you have any updated ETA @yant ?

    -
    See the closed bug for Android where a lot of HL developers are giving feedback on the same issue, so the issue should be addressed: https://issuetracker.unity3d.com/is...-platforms-appears-when-exporting-for-android
     
  19. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    596
    This fix is still waiting for some release manager approval as we speak.... I'll be posting as soon as there is any movement. Thanks.
     
    nih_ likes this.
  20. michalekmarcin

    michalekmarcin

    Joined:
    Mar 28, 2019
    Posts:
    16
    Hi @yant, Unity 2019.4 (LTS) was released today, and PhysX BV4 bug is still there. Can you provide an approximate date when it will be ready for 2019.4.x? On Unity 2020.1.0b11 and 2020.1.0b10 everything works.
     
  21. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    596
    You're precisely correct, 2019 LTS was released without the fix for the bvh issue, unfortunately. The core problem behind it is that we had a number of infrastructure issues with building this fix for all of the platforms within 2019.3 environment. That was hopefully resolved yesterday, and the PR is now in again for another spin by the 2019.4 verification tooling. That's all I have for now.
     
    FracEdd, michalekmarcin and nih_ like this.
  22. michalekmarcin

    michalekmarcin

    Joined:
    Mar 28, 2019
    Posts:
    16
    Thank you for the quick reply.
     
  23. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    596
    Hi everyone,

    This is to let you know that the BVH fix has just been merged into 2019.4.1f1, finally. Essentially, it makes the fast midphase available on all our supported platforms. Maybe makes sense to deprecate this MeshCooking option in a future release then -- because if it's fast, with no problems, and works everywhere, why care for the slow option.

    Additionally, in the spirit of transparency, wanted to mention we have worked out a fix for https://issuetracker.unity3d.com/is...rrors-show-up-when-using-physics-dot-bakemesh

    That issue happened because Physics.BakeMesh() has this pattern where it creates a new PxCooking object, uses it to bake the mesh, and then destroys it. Turns out, creating/destroying PxCooking used reference counting that is not friends with threading as it is. We made a little patch to PhysX that uses atomics for ref counting and the crash is now gone. Just a tiny bit of extra testing and we're ready to roll it out (trunk, and down to 19.3).

    Thank you for your interest in physics and all the support testing and reporting breakages -- that helps a lot.

    Anthony
     
  24. John_Leorid

    John_Leorid

    Joined:
    Nov 5, 2012
    Posts:
    650
    Just wanted to say that it would be great for the next physX version to have more primitive shapes, such as Cylinder (same as capsule, just with flat ends) , Pyramid (4 vertices total) , TriangleWithHeight (6 vertices total) and a ConeCast / ConeCastAll / ConeCastNonAlloc method. Everyone needs this, absolutely everyone. Would be awesome if they were included some time in the future.

    Afaik primitive shapes are performant because the overlap/raycast check is hardcoded (e.g. sphere collider as distance check) - for the shapes mentioned above, there are mathematical "representations"/hit-tests ... I'd even try to write them myself if it would be possible to extend the given implementation.

    Reason why they are useful:
    Cylinders:
    pretty obvious - (explosive) barrels, water bottle, other dynamic cylindrical objects, which should "stand straight" without flipping over

    Pyramid:
    Projectiles, spears, tip of a sword, they are a great addition to compound colliders

    TriangleWithHeight:
    Connection between two perpendicular box colliders, ramps, perfect for compound colliders which represent a curved plane such as a pipe (hanging from a crane where you can walk through --> dynamic body with curved surface)

    All these are cases where convex mesh colliders are not suitable or just bad for performance.

    And ConeCast is useful in many cases, especially AI, light Cone, PlayerVisionCone or just to check if something is below a CircleSprite on the UI with a perspecivic camera.
     
    Last edited: Jun 13, 2020
  25. tjmaul

    tjmaul

    Joined:
    Aug 29, 2018
    Posts:
    467
    @Hannibal_Leo unfortunately there isn’t much that can be done from Unitys side. PhysX is developed by nvidia, Unity is providing access to physx through their API. Your request should be pointed at Nvidia (or Havok or Unity Physics).
     
  26. John_Leorid

    John_Leorid

    Joined:
    Nov 5, 2012
    Posts:
    650
    ECS Physics as well as Havoc actually offer a cylinder Shaped Collider but using ECS as solo programmer on an indie studio right now? ECS is in constant change and not finished - animation, sound, particles are missing.
    And by far too much work for one person.

    And I just searched on the NVidia website and someone asked them about Cylinders this year, end of jannuary .. they say "use convex colliders, they are fast enough" ... well .. I've had pretty bad results on my building destruction game with MeshColliders :S - once I switched to compund colliders, everything was running smoothly again so ..
    But I don't think they would change anything just for one user - if unity would ask them, I see a greater probability that the feature(s) could be implemented.
     
  27. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    596
    Speaking additional primitives -- the position of Nvidia is directly as it stands on the forums you mentioned. Their convex stuff has become quite good over the years actually -- with the move to PCM (=persistent contact manifold), and many fixes in EPA/GJK-related code blocks and convex-convex contact generation overall. I would love to see an example of a convex that is supposed to represent a primitive shape but then fails to do so.

    FWIW - Unity's built-in meshes include cylinder, but unfortunately no other stuff some people mention on the forums -- torus, pyramid, etc

    Anthony.