Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Triangle mesh with PxCookingParams::buildGPUData=false does not trigger simulation event callback #312

Open
colibrishin opened this issue Aug 31, 2024 · 0 comments

Comments

@colibrishin
Copy link

Library and Version

PhysX v5.4.1

Operating System

Windows 11 Enterprise

Steps to Trigger Behavior

  1. Cooking the PxTriangleMesh by setting the buildGPUData false, which is a default value.
  2. Create a PxShape, attach it to the PxRigidDynamic, and do a collision test.

Code Snippet to Reproduce Behavior

Initialization
https://github.com/colibrishin/DXRework/blob/fecb6020160269a1b90875ad667e2657742f2ce3/Engine/egPhysicsManager.cpp#L39-L84

Scene Initialization
https://github.com/colibrishin/DXRework/blob/fecb6020160269a1b90875ad667e2657742f2ce3/Engine/egScene.cpp#L69-L99

Mesh Initialization
https://github.com/colibrishin/DXRework/blob/fecb6020160269a1b90875ad667e2657742f2ce3/Engine/egMesh.cpp#L512-L545

Dynamic rigid-body initialization
https://github.com/colibrishin/DXRework/blob/fecb6020160269a1b90875ad667e2657742f2ce3/Engine/egBaseCollider.cpp#L587-L711

Callback implementation
https://github.com/colibrishin/DXRework/blob/fecb6020160269a1b90875ad667e2657742f2ce3/Engine/PhysXSimulationCallback.cpp#L53-L182

Please note that the simulation event callback is commented on in this revision.

Expected Behavior

If I have assumed correctly, even if the buildGPUData is disabled, the collision should be done in the CPU and the simulation event should be processed.

Triangle meshes require PxCookingParams::buildGPUData to be set to true to build data required to process the mesh on the GPU. If this flag is not set during cooking, the GPU data for the mesh will be absent and any contact generation involving this mesh will be processed on CPU.

Actual Behavior

Simulation Event callback is not triggered, however, the filter shader and callback work fine.

An actor pair seems to not be created while in contact manager creation, PxsContext.mSimStats.mGpuDynamicsFoundLostPairs value appeared to be increased while in the first contact and persisted, but the contact value such as mGpuDynamicsRigidContactCount and mNbNewTouches remains to be 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant