See the other link currently on the front page: https://blogs.nvidia.com/blog/2018/12/03/physx-high-fidelity.... Gives some ideas of the rationale.
Vast majority of the time, most game engine's to solve this problem just let non interactive objects (cloud's, waves, lighting) to be calculated by the phyx sub-system, and only poking it now and then to prevent the phyx hardware from swamping to the CPU.
PhysX keeps two copies of the simulation, you read from one while PhysX is updating the other, and then they swap the pointers. You don't cross the PCI bus to get every position/velocity, that info is transferred in bulk at every step.
That said, not that many games use the GPU-accelerated parts of it; for a lot of gameplay physics CPU code path of PhysX works just fine and does not have special hardware requirements.
The visual-only portion of GPU physics is not really that compelling which is why there isn't huge uptake. There would need to be a revolution in how games work on a fundamental level where basic game logic is calculated on the GPU to make true GPU physics happen. We might see that eventually but not anytime soon.
https://docs.nvidia.com/gameworks/content/gameworkslibrary/p...
Says: The GPU rigid body feature provides GPU-accelerated implementations of:
- Broad Phase
- Contact generation
- Shape and body management
- Constraint solver
These are absolutely not only used for the visual effects, they are the fundamentals of a physics engine.
Raycasting for game logic is cpu based as you mention because the game logic itself is on the cpu. Yet solvers and the true heavy lifting does work well on gpu.
Except, and this is the true reason we see little gpu physics, no one has spare gpu room. Thus cpu side physics wins for most games. Outside specific physics focused games giving up graphics for faster physics is not a profitable trade.
I say this as a gamedev myself who has several times made this exact decision.
Many games do have spare GPU room to spare, but since there are no good GPU-accelerated solutions for physics they don't have much of a choice.
This is a completely meaningless statement.
> you'll run into compatibility issues between the hardware vendors
Those compatibility issues already exist in the form of DX or OpenGL drivers, and most games have to face them. Writing a sim in OpenCL would work on both Nvidia and AMD, and even on Integrated GPUs.
> Many games do have spare GPU room to spare
Many smaller games mighy but most big games do not. And those games with GPU room to spare normally have CPU to spare.
>since there are no good GPU-accelerated solutions for physics
There is - PhysX.
How is "difficult to implement" a meaningless statement?
>Those compatibility issues already exist in the form of DX or OpenGL drivers, and most games have to face them. Writing a sim in OpenCL would work on both Nvidia and AMD, and even on Integrated GPUs.
With completely different performance characteristics and very difficult to diagnose bugs.
>Many smaller games mighy but most big games do not. And those games with GPU room to spare normally have CPU to spare.
Maybe if you're talking about mainstream AAA single player titles, but many multiplayer titles tend to have CPU limits instead.
>There is - PhysX.
Which only works on nvidia hardware and is thus a useless solution.
That's not true - UE4 games can be (and are) built against other physics engines.
"Unreal Engine 4 uses the PhysX 3.3 physics engine to drive its physical simulation calculations and perform all collision calculations. "
https://docs.unrealengine.com/en-us/Engine/Physics
"As announced at GDC’14, Unity 5.0 features an upgrade to PhysX 3.3. Let’s give it a closer look."
https://blogs.unity3d.com/2014/07/08/high-performance-physic...
Most of the stats I can find say unity is 50-60%, and UE is about 10%:
https://www.linkedin.com/pulse/unity-vs-unreal-engine-more-c...
"He said that Unity powers more than 50 percent of mobile games and about half of all PC games."
https://venturebeat.com/2017/05/25/why-unity-was-able-to-rai...