Installing and enabling PhysX in CRYENGINE
Follow the below mentioned steps to install and enable PhysX in CRYENGINE:
- Install NVIDIA's PhysX SDK 3.3 (this is not shipped with CRYENGINE, but available for free from Nvidia).
- Compile the CRYENGINE with PhysX enabled (supported in CMake and WAF). This will create the PhysX interface in CryPhysX.dll.
- Add the following variables to CRYENGINE's system.cfg file, this allows the CRYENGINE to load Nvidia's PhysX instead of the native CryPhysics and disable the other unimplemented features:
p_physics_library = "CryPhysX"
e_OnDemandPhysics = 0
e_onDemandMaxSize = 999999
p_draw_helpers_num = 0
Comment and examples
|g_MaxSimpleCollisions||Used to cap the amount of rigidbody collision events per frame.|
Works only when g_DisableCollisionDaamage is active (otherwise game-important collisions might be missed).
This CVar is useful for profiling, since otherwise the costs of collision event processing can overwhelm the cost of the simulation, especially since it happens synchronously in the main thread.
|p_draw_helpers||Supports limited subset of CryPhysics helpers.|
Any non-0 enables PhysX helpers:
|p_draw_helpers_num||Specifies bitwise, numerical version of p_draw_helpers (see above).|
|p_physics_library||Sets the physics.dll in system.cfg.||"CryPhysX" for PhysX, "CryPhysics" for CryPhysics.|
Nvidia's PhysX does not support dynamic concave objects (in contrast to CryPhysics). The existing concave proxies (for example, vehicles) are not added to the physics world. Therefore, the proxies must be adapted to convex to behave correctly.
The PhysX-interface is a beta feature at the moment. Currently, not all features of the CryPhysics are supported in the moment. There are few limitations which are outlined below:
- only 4-wheeled vehicles supported.
- very basic living entity (but since this is normally changed by game-code anyway, this is not a major limitation).
- no ray-intersection with water surfaces.
- no breakability systems.
- no water/air areas.
- rope simulation is very basic.
- occlusion of explosions.
- character cloth (but you might check out VCloth 2.0, the cloth simulation feature of CryEngine, which is addressing this feature explicitly).
As this is a Beta Feature, it is still in development and we would love to hear what you think about it. Please provide us with any feedback you have through the CRYENGINE Community forum!