Game Development Community

Bullet and PhysX

by raa brubb · in Torque 3D Professional · 02/24/2014 (9:03 pm) · 9 replies

Hey all,

I have recently seen a great deal of development in PhysX 3.3 (may be wrong). I would as a developer like to use Bullet 3 (in beta and useable) and PhysX 3.3. Using Bullet 3 would enable OpenCL to speed up simulations. Anyways, can we actually use PhysX and Bullet together and take advantage of both's features. In other words, use Bullet for physics and all and PhysX for particles (or whatever you want to use it for). Anyways, can we? Or is it completely incompatible?

#1
02/24/2014 (9:53 pm)
Bullet 3 just needs a plugin created for it. In all honesty i don't know if bullet even using opencl is going to be any more efficient than physx 3.3? I guess benchmarking would be required for that and even than im guessing your mileage may vary from gpu to gpu. Anyway a bullet 3 plugin would be another welcome addition to T3D. The reason so many updates on the physx 3 plugin is because its new ;-)
#2
02/24/2014 (10:53 pm)
Oh yeah i forgot to add, mixing and matching would be possible but i think the overhead of updating two physics engine would perhaps out weigh any benefit you may (or may not) get from the opencl enabled bullet 3 library. Further testing would definitely need to be done.
#3
02/25/2014 (12:06 pm)
Really, a plugin would be needed? Most of Bullet 3's files are the same name and code (with some changes). Wouldn't it be the same as adding Bullet 2 with the ability to start and stop and speed up simulation?
#4
02/25/2014 (7:58 pm)
Just adapt the existing bullet plugin to handle bullet 3.0 than
#5
02/26/2014 (9:49 am)
"from gpu to gpu"
I don't know about PhysX, but OpenCL can target non-gpu computing resources like the CPU with the right drivers. So OpenCL potentially has more computing resources than PhysX available. This would be one avenue where one could utilize more cores on a CPU without resorting to multi-threading. In practice I am not sure this really makes it any better though.
#6
02/26/2014 (12:05 pm)
Well, with the current way physics works only one plugin really takes the reigns. So, you'd need to create a two plugin physics system with the ability to choose features from each. It's doable, but as Timmy said you're going to run into issues maintaining two accurate "physics worlds" as I call them. Bullet reports back that a box moves, now you have to update the game world AND update PhysX on the stuff bullet did. It gets messy.

Anecdote regarding performance: I don't even have an NVidia card and I still use PhysX. It's CPU simulations are very fast, usage is very simple and well documented and it just looks great. It's multi-threaded and takes advantage of multi-core processors. I'm sure Bullet does the same, but every benchmark I've seen shows PhysX out perform Bullet on CPU simulations.

Minor-rant while we're on the subject: The whole CUDA vs OpenCL thing is stupid. NVidia needs to wake up and dump the propriety API. They already have a section of their site dedicated to OpenCL so I wish they would hurry up and add OpenCL support to PhysX. They should just make PhysX use CUDA when it's available and fall back on OpenCL otherwise.
#7
02/28/2014 (12:47 am)
"from gpu to gpu" comment was more aimed at various performance differences from gpu to gpu. A mid-low range gpu is going to be getting taxed pretty hard in torque (depending on settings) so there may not be much left in the gpu's "tank" so to speak and if that's the case, i guess you are at mercy of the opencl drivers if it decides to offload any work to the cpu? Honestly i haven't used opencl enough to comment on it.

It will be interesting how far nvidia go with physx 3 and cuda, for now only cloth & particle support but the cpu dispatcher is very efficient and works very well with torque since it is stuck on one cpu & you can allocate the rest to physx very easily (you just feed physx a thread count and it does it's thing). I guess the big thing nvidia have achieved by making the rigid body stuff all cpu based is consistent performance.
#8
03/04/2014 (8:00 pm)
I agree with Andrew about the NVIDIA porting PhysX to OpenCL. To be honest, I would totally use PhysX if they allowed OpenCL to be an alternative for PhysX to run. It's a little hard to believe that PhysX beat Bullet, but if it did I'm not surprised. PhysX is "good" in a way that it runs some physics, but too much is he CPU's downfall. Thats why I'm more excited about Bullet more then anything else.

I think it will come to a point where the open source physics projects will beat PhysX because it will run out of new features. Bullet will eventually have enough that developers will just use it. If NVIDIA didn't staple PhysX to CUDA for GPU acceleration, I would use it. Period.
#9
03/04/2014 (10:16 pm)
Honestly don't believe the many internet based physx myths. Test physx for yourself and you will realise how false all those myths truly are ;-)