Alan-FGR / SharpPhysX

Modern C# bindings for NVIDIA PhysX SDK 4
https://alan-fgr.github.io/SharpPhysX/
MIT License
23 stars 4 forks source link

Any chance this binding will get updated to work with PhysX 5?? #2

Open CartBlanche opened 1 year ago

CartBlanche commented 1 year ago

As PhysX 5 was recently Open Sourced - https://github.com/NVIDIA-Omniverse/PhysX

Alan-FGR commented 1 year ago

Hello.

I've actually played with PhysX 5 this weekend and it's very cool although I must confess I'm disappointed that it's focused on Windows platform... while it shouldn't be too hard to port it to say macOS and consoles, mobile is certainly a mission and for game development that's not good news. On top of that, the GPU accelerated code was kept proprietary. That being said, PhysX 5 is definitely the best option depending on your requirements, although it's now a much more niche product, which is aligned with the scope of Nvidia's Omniverse.

To answer your question: there's a small chance I'll update this to PhysX 5 given my very limited time available for personal side projects these days. The much narrower scope of PhysX 5 and the availability of Bepu Physics 2 as a reasonable alternative for most use cases also diminished my incentives to work on this. PhysX 5 does provide value like articulations, PBD, a few extra joints, different solvers, Flex and Blast integration, as well as USD support and substantial development backed by a big company, so it would be useful to have C# bindings.

On a more general note, is there a specific reason you're interested in PhysX bindings for C# and not say Jolt or just using the "managed" Bepu 2?

I will keep this open for others and if I ever start working on an update I'll reply here.

CartBlanche commented 1 year ago

@Alan-FGR thanks for the detailed response. Greatly appreciated!

CartBlanche commented 1 year ago

To answer your question. I hadn't heard of Jolt until now and didn't know that managed Bepu existed. I had heard of Bepu in the past, but haven't kept up to date with what they'd been up to.

Alan-FGR commented 1 year ago

You're welcome 😊... Well, I would say check those out. Bepu 2 is incredibly fast on modern processors when compiled with recent RyuJIT versions. It scales impressively well to multiple processor cores and you won't be paying any interop overhead. Jolt is also pretty fast although in my tests I wasn't happy with some simulation quality but maybe I was just pushing it too far. Both (on CPU) are top-tier performance wise along with PhysX. Jolt has a detailed paper on performance comparing it with PhysX 4 (which isn't that far from PhysX 5 as PEEL shows). Bepu 2 contributors also did some less scientific benchmarks but all of these are definitely comparable in performance, in most typical real-world scenarios they will perform within a margin small enough that when not negligible is definitely not a decisive factor.