-
|
|
|
So I'm sure you've all heard of what Nvidia and the like are doing with off loading physics work onto their video cards by using proprietary chips on their video card. This solution while very neat, and very fast relies on the fact that you have THEIR brand of card, otherwise it just goes to a similar software solution which might be slower than just using a framework build to run in software alone.
Collision detection is the process of finding pairs of objects that are seen by the physics system as colliding, and that their collision must be resolved. The resolution of said collisions is not a huge concern regarding processor power, it's the detection of collisions. Given that physics is the most processor intensive operation in your solutions, you can bet safely that the majority of that time spent in physics is spent in collision detection.
All collision detection can be expressed as a set of linear systems something that the video card's sub components are MADE to work with. If we were to make a shader language solution that would tackle the individual cases of collision detection (given body A and body B do they collide?) we could speed the process of any collision detection system greatly.
Currently I'm working on a general shader language solution replacing JigLib's collision detection code with a shader that does effectively the same work split up among the video card's sub components. The strength of this approach should yeild a better faster physics system that does not favor a specific brand of video card, in fact it MIGHT even be able to work on lower end laptop video accelerators. To help me on this I'm trying to restrict my development to a intel gma950 graphics chip set, the video chipset you'll find in most netbooks.
Right now I'm in the research stage, I'm looking at what others have tried and have found a wealth of general video hardware physics simulations, which makes me happy. If I can produce a component for JigLib that speeds up the collision detection, perhaps people developing for the Xbox 360 using XNA can get a similar boost in physics processing that the people who are licensed xbox developers have using the physX system.
Anyone have any input on this, any leads or articles they've found talking about more general approaches?
|
|
-
|
|
|
PhysX doesn't work on the X360 as the Graphics Chip in an X360 is an ATI, predecessor to the Radeon HD2xxx series(R600). PhysX only runs on NVidia chips and only on the 8 series and up and runs as a CUDA solution for the PhysX library.
You might want to start doing this in Direct X 11 as this particular API gives you a common interface for GPGPU programming known as the Compute Shader. Otherwise you are going to have to do a lot of render to texture and you might need multiple passes to do one thing if the card doesn't support writing to multiple render targets.
|
|
-
|
|
|
Perhaps I've been mislead or confused; I thought the point to PhysX was that the physics processing was done on the GPU, why is it that there are some in XNA community demanding access to it over open source alternatives? If it's all software based, what is the big deal?
Anyway, thanks for the insight, however does the xbox 360 run DirectX 11? I was under the impression it was a DirectX 10 system...
Currently, I'm thinking that I'll be coding this in shader model 4. The netbooks be damned, if I want to make this useful it wont work on anything less than shader model 3. I found some videos demonstrating GPU based physics, the majority of them are navier stokes liquid simulations, rigid body physics, or cloth. But rarely are they combined, and the rigid bodies are usually spheres or cubes, BUT completely GPU based.
I'm very tempted to attempt to recreate an open source physics engine's collision detection and resolution entirely on the GPU, it will still manage the bodies but the GPU will do the heavy lifting. After this is done, I may attempt to make a navier stokes liquid simulation like field to simulate air currents in a particle system, this could be used for smoke, dust, liquids etc.
I know I said earlier I'd be using JigLib but I've been looking and thinking about using Bullet, however the newest version of bullet for the Xbox was released ages ago, and was an alpha. If it was ever brought up to date with the main Bullet engine, and fully tested, it would make a great candidate. I wonder if anyone knows of a better open source physics library. Also can anyone find open source demonstrations of GPU based physics? Everyone I contact is either working for Nvidia or a similar suite now, or the demo was made in academia and they have not the rights to distribute source...
|
|
-
|
|
|
Ben Andersen:Perhaps I've been mislead or confused; I thought the point to PhysX was that the physics processing was done on the GPU, why is it that there are some in XNA community demanding access to it over open source alternatives? If it's all software based, what is the big deal?
Anyway, thanks for the insight, however does the xbox 360 run DirectX 11? I was under the impression it was a DirectX 10 system...
Currently, I'm thinking that I'll be coding this in shader model 4. The netbooks be damned, if I want to make this useful it wont work on anything less than shader model 3. I found some videos demonstrating GPU based physics, the majority of them are navier stokes liquid simulations, rigid body physics, or cloth. But rarely are they combined, and the rigid bodies are usually spheres or cubes, BUT completely GPU based.
I'm very tempted to attempt to recreate an open source physics engine's collision detection and resolution entirely on the GPU, it will still manage the bodies but the GPU will do the heavy lifting. After this is done, I may attempt to make a navier stokes liquid simulation like field to simulate air currents in a particle system, this could be used for smoke, dust, liquids etc.
I know I said earlier I'd be using JigLib but I've been looking and thinking about using Bullet, however the newest version of bullet for the Xbox was released ages ago, and was an alpha. If it was ever brought up to date with the main Bullet engine, and fully tested, it would make a great candidate. I wonder if anyone knows of a better open source physics library. Also can anyone find open source demonstrations of GPU based physics? Everyone I contact is either working for Nvidia or a similar suite now, or the demo was made in academia and they have not the rights to distribute source...
Dont misunderstand me PhysX can be hardware accelerated but it's also a software API to do physics with. Besides the PhysX SDK is downloadable form developer.nvidia.com
X360 only supports DX9 and some DX9extended functions (these are the predessor functions to DX10), the reason i am offering the DX11 option is because it will be easier to develop it in it, you can actually access the unified shaders as processes in it. DX10 will only give you an additional geometry shader and some more functions in the vertex and pixel shaders, i am not saying these are not usefull or even not enough i amust trying to point out that DX11 might be easier. Bare in mind though that DX11 requires at least vista and a DX11 capable gpu which have only just come on to the market.
We will have to wait another generation of console before we will see these features on those machines, however both the X360 and PS3 are multicore machines so most games nowadays use multithreaded physics engines anyway.
|
|
-
|
|
|
This is indeed sobering news, I had no idea that Xbox 360 didn't support Dx 10. And from what I've read the Xbox 360 DOES have a unified shader pipeline. However, because we are tied down to XNA which (I presume from our correspondences) is a abstraction layer on top of Dx 9 and not Dx 10, I cannot access the unified shader, as Dx 9 has no reference for that technology.
Of course the next question is then, how are people addressing the unified shader pipeline? Are the commercially licensed developers able to provide Dx 10 run time distributable with their game such that the their game can address the unified shader pipeline? Or am I mistaken that the 360 has a unified shader pipeline at all.
What shader model does the 360 support?
|
|
-
|
|
|
Well a unified shader pipeline is not one of the requirements for a DX10 card, there are other requirements that need to be fullfilled to be of a DX10 feature level. I never said the X360 didnt have a unified shader core. Yes XNA only supports DX9c features and will probably never (read untill we have a new console) support DX10 and up.
Unified shaders aren't accessible in DX10 either what a unified shader core means is that all shader processors can do the all jobs so every processor in those GPUs can run vertex, pixel, geometry and the DX11 level shaders on every stream processor. What this means is that instead of having 8 processors dedicated to vertex shading and 16 to pixel shaders you now have 24 processors that can run both the pixel and vertex shader. This means that the card can decide to use 16 processors to do the vertex shader and 8 to run the pixel shader and any combination in between. This choice happens at runtime and is done by the driver and the hardware who analyse the incoming commands and decide which needs more processing power. This is just an example btw.
X360 supports upto SM3.0
|
|
-
|
|
|
I suppose I may keep working on this for PC in Dx 10 or 11 until I get news of the next gen XBox, and I'll have to put the titles I wanted to make using this technology off even further than I already have.
Thanks for the education, and now to take on a simpler project. :)
|
|
-
|
|
|
I never said it couln't be done in SM3.0 its just harder as everything has to be done by a pixel shader. I have seen full energy minimization being run on GPUs with SM2.0
|
|
-
|
|
|
Yes, but I'll have to reduce my scope greatly.
I'll probably do something involving particles in a naiver stokes fluid conduit for impulse. have the ability to designate triangles made from connected particles, that can collide with other triangles, and particles. And that's probably being very optimistic.
|
|
|