I’m reaching out with regards to a problem we are having with Omni + PhysX: so the gist of our issue is, we have a task in Isaac Sim that needs all four of the below to be true:
-
We want to simulate a fluid particle system (iiuc using a point instancer)
-
We want to be running physics fabric enabled (it’s a very complex scene that is very slow otherwise)
-
We want to be able to see the particle system in the renders
-
We want to be able to programmatically access its particles’ positions (to be able to check for task completion) - I assume that if 3 works we can just get this data from Fabric.
The problem we’re seeing is that with Fabric enabled, the particles don’t seem to be moving at all in the render, and there doesn’t appear to be a good way to get the particle positions, velocities, etc. through a Tensor API view either. We’ve found an easy way to reproduce this using the demo at Window > Simulation > Physics > DemoScenes > Particles > Particle Postprocessing. If you enable Fabric in this demo, you’ll notice the particles don’t seem to be moving at all. We can tell that the particles do get simulator in PhysX because they will cause nearby rigid bodies to move, but they remain stationary on the rendering. Tl;dr: the particle positions do not seem to be getting updated into Fabric.
Here are some things we have tried:
-
Enable updateParticlesToUsd so that maybe only particles will get updated to Usd at some acceptable cost: this flag seems to not do anything, and the updateToUsd flag will do it but it will mean all the rigid bodies get updated too
-
Try to manually read the particle poses from PhysX through a tensor API and update the USD ourselves: there is a Particle Cloth view that can read cloth particle poses as well as a Particle System view that can read some other metadata for point instancer systems but we can’t find anything that can read particle poses
-
Try to write a C++ extension to do it ourselves: there’s a post here that uses omni::physx::IPhysX to access the PxScene but the header files for this are not publicly available currently
Do you think there is any way this could work, perhaps through one of the above options?
Many thanks in advance.
Hi,
there is no simple solution for you problem unfortunately. Current omni.hydra implementation does not have an interop that would allow point instancer changes through Fabric.
Hence if omni.physx.fabric is enabled, non-point instancer updates are done. Therefore you dont see the particles to get updated. But since omni.physx.fabric overrides completely the outputs, the USD part is omitted.
We are aware of this limitation and working on a solution, but that will be available in next major update, several months from now.
As you said this is indeed a problem of rendering, simulation should work fine. However having a working solution might be really a problem at this point.
So you need the rendering to work always? One could for example save the particles simulation in a time sampled data and just play animation for those in a final render if that would be an option.
Sorry about this, regards,
Ales
Hi Ales,
Thank you so much for getting back to us! I appreciate you taking taking the time to walk us through the issue.
Regarding your question, we do indeed need rendering to always work.
Given the current limitations, I’m wondering if there might be any way to access the particle poses directly? Are there any APIs or methods we could use to retrieve the particle data from PhysX, even if it’s not being updated in Fabric? We’d be open to exploring lower-level solutions or workarounds.
Thanks again, and looking forward to hearing back from you.
Best,
Hang
I did talked to the feature owner and currently there is no other way then to access the buffers that how the output was setup for the particle system. That output is to internal structures in omni.physx, those are not exposed. While even with PhysX SDK access its not possible to get to those buffers eventually. I am afraid the only solution is to use USD updates till we have full support for Fabric, which might take still few months. This is really unfortunate, sorry about this.
Regards,
Ales
Thank you for your detailed explanation, Ales. We truly appreciate you taking the time to investigate this issue and get back to us.
As a somewhat related question, are you guys planning to release the C++ headers for omni::physx::IPhysx
anytime soon, as described here? https://forums.developer.nvidia.com/t/how-to-do-physx-c-raycast-in-usdphysicsscene/238665/6 It does seem like it’s just the one header file needed to be able to access particle info stored internally, since all the PhysX headers are already available online?
Thanks again!
Best regards,
Hang
Yes, we would love to release samples showing how to use omni.physx interfaces, however this never got priority. Its been on my team TODO for quite some time. I do hope we will release those next year.
But for this particular case it wont help you, even if you access the PhysX SDK data you cant get to the particle positions, the particle system is setup to output those buffers into omni.physx internal structures and there is currently no way how to access those buffers after creation through PhysX SDK API. Basically the data that you need are inside omni.physx and right now they are not exposed.
Let me see if we could still manage to get some kind of force_update function that would push the point instancer data into USD as a temp workaround. This function could be available in next Isaac release in few weeks.
Hi Ales,
Huge thanks again for getting back to us. Having a force_update function for the point instancer sounds really good and we would really appreciate having that!!!
We look forward to any updates on this feature. Please let us know if there’s any additional information we can provide to help.
Best,
Hang
Hi Ales,
Hope all is well!
Just wanted to follow up on our discussion from October about the force_update function for point instancer data. Any updates you can share on this? Also curious if you know when the next Isaac release might be coming.
Thanks!
Hang
Hi Hang,
yes, for the upcoming IsaacSim release I did changed how the write to USD settings work, so as long as updateParticlesToUSD is enabled (true by default) the point instancer based particles will update properly.
I expect that next IsaacSim release will happen in January and should include this.
Sorry for the inconveniences.
Regards,
Ales