2 - What is Physics? | A word about performance
What is Physics?
Dictionary -- Phys¡Eics -- the science that deals with matter, energy, motion, and force.
So how does do physics calculations (which you hated so much in college) relate to gaming, you ask? Physics is all about how objects in your game move and react. Typically the GPU renders that gaming experience of yours, and in the past all physics were processed by the CPU (which needed to be limited as it eats up a lot of CPU cycles). In it's current design you need to understand, PhysX will not render graphics, it a the step lower in the pipeline. The complex motion of objects, elementary particles, fluids etc is based on a complex set of variables like gravity, density, wind and so on; general relativity.
That part is computed and defines the actual movement of an object, cloth, fluid or whatever floats your boat.
So then, up-to this point software physics already has been utilized in games. Ageia actually had a software based API available as well, that used the CPU. Havok is another good example of a Physics engine that uses the CPU.
So then; common physics computations are handled by the CPU, your processor, which is already loaded with the ever increasing demands of today's advanced games including game logic and AI. In short Physics calculations are responsible for more dynamic eye candy on that screen of yours, yet can now be computed on the GPU. And that has many advantages as we can't only do more complex calculations, the GPU is much faster doing it, and last but not least .. it saves CPU cycles (but eats GPU cycles).
PhysX processing is solely used to delivering physical gaming environments. Some of the features it's capable of doing are:
- Explosions that cause dust and collateral debris
- Characters with complex, jointed geometries for more life-like motion and interaction
- Spectacular new weapons with incredible effects
- Cloth that drapes and tears the way you would expect it to
- Dense smoke & fog that billow around objects in motion
All that stuff can now be calculated over the GPU and is done much faster on it than a CPU. Take for example GRAW 2 -- the game is all about realism, and the developers knew very well that if they integrated hefty physics that the level of realism would be compromised. So although you can clearly see noticeable differences between the game with and without physics acceleration, the difference is extremely small. If you shoot at bricks you'll see some more debris, explosions seem to be a little more intense but noting a dual-core CPU couldn't take care off.
Notice that debris in the explosion, normally it would be missing. That's based on Physics calculations through PhysX over the GPU.
The Big Enigma - Performance
You'll notice that several articles available on the web with regards to NVIDIA PhysX are extremely focused on that fact that PhysX supposedly should increase the overall framerate. I'm afraid that is a very poor point of view for an article as physics was never intended to make your games run faster. under a very stringent set of circumstances it can help you on your framerate though.
Here's my take, in some situations PhysX can help you increase the overall framerate, but here's the enigma: generally seen PhysX will lower your framerate. Let's fire off some of my ideas on that:
If PhysX calculations are done over the GPU with an old (CPU bound) game, with a dedicated GPU you will offload the CPU and create more momentum for the CPU and then the framerate can be higher.
If PhysX calculations where done over the GPU with an new more modern (GPU bound) game, it's likely for you to have a lower framerate, as your GPU will have to render more objects with for example particle rich explosions while the CPU load isn't lowered whatsoever.
See, the only thing PhysX does is calculate that movement or transformation of a set of vertices of an object - set of particles - water - smoke - whatever. If you shoot a gun at a barrel and it explodes into a thousand pieces. These pieces will mean, more tiny objects (vertices) to fill/texture/shade and render.
Initially this is why I did not like the first implementation of GeForce PhysX, I do not want my GPU to render PhysX AND rendering the game as it'll eat away a lot of computational power from that GPU, and thus overall performance. Since a GPU is way more than a CPU, that is definitely somewthing to think about.
But that has now changed ... let's move into the next chapter where I'll explain.