Okay, let's break down the use of recent PhysX versions, especially focusing on features like fluids, in major game engines.
Understanding PhysX Versions & Features:
- PhysX 4.x: This series focused on performance improvements, stability, and features like GPU rigid body acceleration, improved character controllers, and joints. It still had remnants or integrations related to APEX features (like cloth and destruction) but was moving away from the full APEX suite.
- PhysX 5.x (PhysX 5.0, 5.1, 5.2, 5.3 etc.): This represents a significant overhaul. NVIDIA rebuilt the SDK from the ground up with a modular architecture. Key features introduced or significantly improved include:
- CPU & GPU Compute: More flexibility in computation.
- Rigid Body Dynamics: Core physics simulation.
- Particle Simulation (SPH): This is likely what you mean by "fluid." PhysX 5 includes solvers for particle-based simulation (Smoothed Particle Hydrodynamics).
- Cloth Simulation: Improved solvers.
- Destruction: A rewritten system.
- Geometry Queries: Raycasts, overlaps, etc.
Game Engine Integrations:
-
Unreal Engine:
- Unreal Engine 4: Used NVIDIA PhysX (versions likely around 3.x) extensively, particularly integrating APEX modules for Cloth and Destruction. However, it did not typically use PhysX for advanced fluid simulation; fluids were usually handled by custom particle systems or other middleware.
- Unreal Engine 5: UE5 removed the built-in integration of NVIDIA PhysX. It now defaults to its own proprietary physics system called Chaos Physics. Chaos handles rigid bodies, destruction, cloth, and vehicles. While Chaos is robust, it does not include built-in high-fidelity fluid simulation capabilities like PhysX 5's SPH.
- Using PhysX 5 in UE5: It is possible to integrate the PhysX 5 SDK manually into UE5 as a third-party plugin, but it's not a standard, out-of-the-box feature. This requires significant C++ integration work.
-
Unity:
- Unity has historically had a more flexible approach. While its default physics engine is often based on its own codebase or integrations with libraries like Bullet, it also provides official packages that leverage NVIDIA PhysX.
- Recent Unity Versions: Unity offers packages that integrate NVIDIA PhysX 4.15. These packages primarily focus on leveraging the GPU for faster rigid body simulations and potentially include GPU-accelerated cloth features derived from PhysX/APEX.
- Fluids in Unity's PhysX: The official Unity PhysX package is generally not focused on exposing the advanced fluid/particle simulation features of the underlying PhysX SDK. While PhysX 5 has these features, Unity's integration primarily targets rigid bodies and performance optimization. For fluid simulation in Unity, developers typically rely on custom particle systems (like VFX Graph or Shader Graph) or specialized assets/middleware.
Conclusion:
As of now (early 2024), there isn't a major, mainstream game engine that ships with PhysX 5 and its full feature set (including advanced fluid simulation) integrated out-of-the-box.
- Unreal Engine 5 uses Chaos Physics and requires manual integration for PhysX 5.
- Unity uses an official package integrating PhysX 4.15, primarily for GPU-accelerated rigid bodies, but not typically exposing advanced fluid simulation features.
If your primary requirement is using the latest PhysX SDK with features like SPH fluid simulation directly within an engine workflow, you would likely need to:
- Manually integrate the PhysX 5 SDK into an engine like Unreal Engine 5 or Unity.
- Consider engines or workflows specifically designed for physics-heavy tasks that might integrate tools like Houdini Engine (which has excellent fluid simulation) or use middleware physics solutions that explicitly support advanced fluid dynamics.