13 ms·
PhysX SDK 4.0, an Open-Source Physics Engine
- electricslpnsld 8y agoRad, I'll have to dig into the source for this! Does PhysX mainly implement PBD like all the papers from Mueller they publish?
- bgorman 8y agoDoes this open the door for PhysX acceleration on AMD cards? Why would Nvidia do this from a business point of view?
- pitaj 8y agoMaybe it's just my perception, but fewer and fewer games these days seem to be using PhysX.
- aras_p 8y agoEverything that is made with Unity or UE4 uses PhysX. 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.
- pitaj 8y agoYeah the GPU-accelerated part is what I was referring to. Doesn't seem like it makes much of a difference these days.
- KaoruAoiShiho 8y agoI think you're really misunderstanding how this works. The CPU handles pretty much all game logic. It needs to know the position of each car, enemy, bullet, whatever, so it can decide how to respond to things, if a car hits a player it does damage. As a result it's impossible to hand off such calculations to the GPU, so all GPU accelerated physics do is trivial visual-only effects like cloth and water physics or pieces of paper blowing in the wind. Basically anyone expecting GPU accelerated physics that has logical relevance such as physics based destructible environments is expecting too much. In other words GPU accelerated game logic physics was never the promise of PhysX. PhysX focused on making physics really easy and great from a software standpoint, and that has been an outstanding success. 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.
- kevindqc 8y agoThat doesn't seem right? https://docs.nvidia.com/gameworks/content/gameworkslibrary/physx/guide/Manual/GPURigidBodies.html 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
- KaoruAoiShiho 8y agoThese are generally only used for the visual effects, you still need these features to make the visual effects look good.
- maccard 8y ago> 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.
- KaoruAoiShiho 8y agoThe physics of the visual effect.
- Danieru 8y agoGPU calculated physics works just fine when results are brought back to the Cpu. 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.
- Mirioron 8y agoThe biggest problem with GPU physics is that it's a very difficult problem to tackle and you'll run into compatibility issues between the hardware vendors. It'll work on Nvidia hardware and won't work on AMD or vice versa. 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.
- sebazzz 8y agoI am not familiar with PhysX - must you explicitly program with PhysX against the GPU?
- msbarnett 8y agoNo. Most games use it on the CPU, as the GPU accelerated implementation is currently only available on Nvidia cards
- nfg 8y ago> Everything that is made with Unity or UE4 uses PhysX That's not true - UE4 games can be (and are) built against other physics engines.
- twtw 8y agoRe: business point of view See the other link currently on the front page: https://blogs.nvidia.com/blog/2018/12/03/physx-high-fidelity-open-source/ https://blogs.nvidia.com/blog/2018/12/03/physx-high-fidelity.... Gives some ideas of the rationale.
- mtgx 8y agoBecause nobody used it. It's for the same reason Intel open sourced (or at least promised to, last I checked) Thunderbolt.
- ahupp 8y agoPhysX is used in both the Unity and Unreal engines, representing well over 50% of games made.
- Drybones 8y agoThis is not true at all
- ahupp 8y agoWhich part? If you're talking about units sold rather than games made, then sure, the most popular games are often on their own engines. But that's a different measure than "games made". "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 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-physics-in-unity-5/ 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-confusion-game-nisha-patel/ 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-raise-400-million-at-a-2-6-billion-valuation/ https://venturebeat.com/2017/05/25/why-unity-was-able-to-rai...
- Thaxll 8y agoMost of the time physic is not running on the GPU, it's a CPU thing.
- hackits 8y agoGot into some heated debates with people about physx where from a developer standpoint it was off-loading all calculations to the CPU with the present of a physx GPU. Typically in game engines you need to pause the world and look into the physx simulation to get the object's pos/vel/mass. This causes the physx engine to stop the world to finish it's calculations so crossing the PCI bus becomes more and more expensive. 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.
- maccard 8y ago> Typically in game engines you need to pause the world and look into the physx simulation to get the object's pos/vel/mass. This causes the physx engine to stop the world to finish it's calculations so crossing the PCI bus becomes more and more expensive. 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.
- sgillen 8y agoFrom a business point of view they can get developers/researchers working with PhysX early. Eventually these developers will convince their employer to shell out for other non free Nvidia products.
- xvilka 8y agoToo bad they will never open source their drivers or help nouveau instead. The only hope if they go bankrupt.
- malvosenior 8y agoThis is correct. What's the point of open sourcing this library when you can't even use their cards on the open source operating system. From what I understand, it wouldn't be that difficult for them to allow the community to develop a proper driver for their devices on Linux, they just don't want to. I think it's fair to point out the hypocrisy of this announcement.
- TomVDB 8y ago> What's the point of open sourcing this library when you can't even use their cards on the open source operating system. The point is that these two are completely orthogonal. It's like saying: what's the point of writing open source software for an x86 when the x86 RTL is closed source. With an open source PhysX library, you can make PhysX work in any environment.
- madrix999 8y ago> With an open source PhysX library, you can make PhysX work in any environment. Not if their drivers on other environments dont support it. Consoles are all AMD, and NVIDIA only has 3-4% more market share on PC, while intel has around 70% of the market share. That's a really low number of platforms for a proprietary piece of tech.
- shmerl 8y agoDoesn't it still depend on CUDA for hardware acceleration? For it to become truly open, it should be untied from CUDA first. So far it looks more like a way to advance CUDA usage even further, by giving a free higher level library that's locked into it.
- remind_me_again 8y agoDon't be naive.
- xvilka 8y agoSee also https://www.phoronix.com/scan.php?page=news_item&px=LPC2018-Video-Open-CUDA https://www.phoronix.com/scan.php?page=news_item&px=LPC2018-...
- shmerl 8y agoYep, that's nice. There should be more push to dislodge CUDA grip on the AI industry.
- maccard 8y ago> Doesn't it still depend on CUDA for hardware acceleration? Assuming by hardware you mean GPU acceleration, then yes. It's not really a push for Cuda usage, most games that use physx don't use the GPU acceleration (not everyone has PhysX cards, and those that do are usually busy using the GPU for rendering), so in practice for 99% of use cases, it is open.
- shmerl 8y agoModern cards commonly have rendering and compute pipelines available to be used in parallel. So in theory nothing stops games from using compute queues for physics.
- HelloNurse 8y agoThe issue is that CUDA, unlike OpenCL, is only available on Nvidia hardware.
- chombier 8y agoDoes anyone know about the new "Temporal" Gauss-Seidel solver in 4.0? I can't find any reference on it.
- nudgeee 8y agoVery cool. Anyone remember the PhysX PPU hardware? http://physxinfo.com/wiki/Ageia_PhysX_PPU http://physxinfo.com/wiki/Ageia_PhysX_PPU
- cr0sh 8y agoIt's too bad they didn't take off with gamers, but they were a rather niche product for even that market.
- jandrese 8y agoIn the end it made more sense to buy a beefier graphics card with that money and use some of it for the physics calculations instead.
- devman0 8y agoThis sort of the way the 3D accelerator card went as well. It just got merged in to the graphics card.
- WorldMaker 8y agoPlus, the graphics card seems on the verge of merging entirely back to the mainboard (again). Certainly nVidia (et al) are fighting that (inevitable?) future, but more systems are built with "integrated" graphics than not and fewer systems than ever are slotting a graphics card in an expansion spot. (An interesting under-explored repercussion of the crypto-mining GPU boom causing such a consumer shortage in graphics cards was how many consumers realized they didn't need one.)
- snuxoll 8y agoFor normal consumer use cases a discrete GPU has been "dead" for some time now, with both Intel and AMD offering CPU's with integrated graphics able to even handle some (very-)light gaming tasks. Discrete GPU's aren't going anywhere though, PC gaming has been going through a huge resurgence and their deployment in enterprise workloads is ever increasing. Warranty costs alone (you don't want to replace a 400+ mm2 GPU die when a motherboard capacitor dies or the CPU it's attached to fails) dictate that they remain add-in boards, then you have the upgradability argument.
- ratsimihah 8y agoBut does it support ray tracing at 4k 60 fps?
- aleden 8y ago# Disable implicit rules to speedup build .SUFFIXES: SUFFIXES := %.out: %.a: ... https://github.com/NVIDIAGameWorks/PhysX-3.4/blob/master/PhysX_3.4/Source/compiler/linux64/Makefile#L68 https://github.com/NVIDIAGameWorks/PhysX-3.4/blob/master/Phy... Does this actually work? If it has tangible benefits then perhaps the AOSP could do the same.
- stefan_ 8y agoAOSP doesn't use makefiles anymore.
- quotemstr 8y agoYes we do. We just compile them to ninja graphs and use those to do the actual builds. For the moment, the actual input descriptions can (but don't have to) come in makefile form.
- stefan_ 8y agoThe build uses ninja for a long time now, the "Makefiles" aren't used with make anymore and instead use kati and there is a treewide effort of converting any makefiles into Soong specs.
- quotemstr 8y agoYes, but makefiles still exist, and they still provide build configuration. That they're off to the side during most incremental builds is a separate matter.
- ploxiln 8y agoIt helps with debug-logging from make anyway (the -d flag), so you get just a few relevant lines of checked rules for each target, instead of a page of irrelevant stuff like "maybe in SCCS there's a .y file which can generate a .c file which can generate this file ... hmm no I guess not" ... for each target. Come to think of it, it reduces the number of stat() system calls quite significantly, that can make a difference in large builds.
- visualphoenix 8y agoOh man. On Army of Two we were running a fully deterministic simulation and we had to patch many part of PhysX to maintain determinism. In the end, we had to get a waiver from Sony to ship a binary-patched version PhysX libraries. Good times.
- warent 8y agoAll that hassle just for them to opensource it in the end. Yay bureaucracy! By the way good work on that game. I thoroughly enjoyed it when it came out.
- WrtCdEvrydy 8y agoOne of my favorite all time games.
- steve19 8y agoI am curious, Why did you need determinism?
- chmod775 8y agoWithout knowing the game: Some kind of replay/recap feature maybe or physics in cut scenes. When you replay a series of inputs, you want the accompanying physics to come out the same. Solvers that use randomness in your engine will either need to have their RNG seeded with the same value or have the rng removed. Another thing causing problems might be how your engine handles time or when it iterates over objects in a specific order relative to how they were added (might not have preserved that order in your snapshot). There's many things that can go wrong.
- WorldMaker 8y agoSometimes network code is easier with deterministic engines. Some engines simply replay the remote/network inputs as if they were local (with various strategies for handling the time sync/time delays), and rely on the property of determinism of their underlying simulations to avoid divergence in player world states. Knowing only how much Army of Two stressed its cooperative network play nature (including in its title), that's my best lay guess of the strong reason the game wanted deterministic simulations. The impression I got from dev team discussions/features on The Halo Channel/Master Chief Collection was that Halo was built that way: its network engine wanted rock solid deterministic physics, so all the replay/recap features added to later games were a "free" bonus they were able to build on top from that earlier netcode requirement.
- IChooseYou 8y agoAs far as I know, PhysX doesn't offer x64 libs unless you pay. I couldn't even find a torrent. But this was years ago so it could've changed.
- maccard 8y agoGiven that it's now open source, you can compile your own. They have provided x64 libs for at least the last few years though.
- jjuhl 8y agoHow does it compare to Bullet Physics?
- deleted 8y ago[deleted]
- Impossible 8y agoThere are a lot of comments about CUDA and GPU compatibility, etc. PhysX is mostly a CPU library, although there are systems that can run on the GPU, GPU physics are not widely used in shipping games. Both Unreal Engine and Unity use PhysX as their default physics engine. It runs on all platforms these engines support (Windows, Max, Linux, Android, iOS, Nintendo Switch, Xbox One, Playstation 4), Nvidia hardware is not required. The position based dynamics code is in a separate SDK called Nvidia Flex ( https://developer.nvidia.com/flex https://developer.nvidia.com/flex). Flex is closed source, runs on the GPU and is implemented in CUDA (Nvidia only).
- ygra 8y agoIs that at the game's discretion where to run the physics code or does that selection between GPU and CPU in the NVidia control panel actually work?
- deleted 8y ago[deleted]
- dlahoda 8y agoso oss what is useless in future because of inevitable volumetric future(flex)
- Impossible 8y agoIf you want OSS Position Based Dynamics code you can get Mueller's original C++ implementation here (https://github.com/InteractiveComputerGraphics/PositionBasedDynamics https://github.com/InteractiveComputerGraphics/PositionBased...). The GPU implementation is not open, but this code can be adapted to run on the GPU outside of Flex. Scrawk converted the code to C# in order to support Unity and implemented a Unity based version of the fluid dynamics code that runs on the GPU (using portable compute shaders instead of CUDA) as well. https://github.com/Scrawk/Position-Based-Dynamics https://github.com/Scrawk/Position-Based-Dynamics https://github.com/Scrawk/PBD-Fluid-in-Unity https://github.com/Scrawk/PBD-Fluid-in-Unity The only game that I'm aware of that uses position based dynamics on the GPU is Claybook (https://twvideo01.ubm-us.net/o1/vault/gdc2018/presentations/Aaltonen_Sebastian_GPU_Based_Clay.pdf https://twvideo01.ubm-us.net/o1/vault/gdc2018/presentations/...). Because PDB is basically an extension of Jakobsen style verlet physics (http://www.cs.cmu.edu/afs/cs/academic/class/15462-s13/www/lec_slides/Jakobsen.pdf http://www.cs.cmu.edu/afs/cs/academic/class/15462-s13/www/le...) which is used in a lot of games (Fantastic contraption, Gish, World of Goo, various Bridge builders, etc.) In all cases the developers are using custom physics code and not using a library. This is very different than rigid body dynamics where most shipping games use a licensed physics engine (Havok, PhysX, Bullet, ODE, etc.)
- Animats 8y agoNice, from a developer point of view. Havok was once the leader in this area, but they were refinanced in a down round, acquired by Intel, and then sold off to Microsoft. Now they don't seem to be very active. Their web site announces the new 2013 version. (I used to work on this stuff. I'm responsible for the ragdoll-falling-downstairs cliche, first shown in 1997.)
- shmerl 8y agoWhat about Bullet?
- irascible 8y agoAnd Ammo.js! There are literally dozens of us using it!
- nfg 8y agoFWIW Havok is very much still trading and active in the games space. I won’t say any more as the business side of things isn’t my forte. Unfortunate that the website gives that impression! Disclaimer: I work there.
- Animats 8y agoPutting the documentation back online would be a good start.
- Thaxll 8y agoHavok is still the leader/ best physic engine out there, the only reason why some studios don't use it is because it cost a lot of money.
- nkg 8y agoThat video... I see a huge potential for "Twitch plays Robotic arms" ! XD Someone, please do this.
- acoye 8y agoThis is a logical step to get physx used by AI researchers.