Just one week after Box3D physics was released, the popular free & open source cross platform Jolt physics engine released Jolt Physics 5.6. This powerful physics engine is already being used by tons of open source game engines, including Godot and GDevelop as well as being used for commercial AAA titles such as Horizon Forbidden West, Death Stranding 2 and X4. The 5.6 release adds several new features, with the star of the show being the new hair simulation system.
Jolt Physics 5.6 features:
- Added interface to run compute shaders on the GPU with implementations for DX12, Vulkan and Metal. These interfaces can be disabled by setting
JPH_USE_DX12,JPH_USE_VK,JPH_USE_MTLandJPH_USE_CPU_COMPUTEtoOFF. To build on macOS, you’ll need to have dxc and spirv-cross installed. The easiest way to install them is by installing the Vulkan SDK. - Added a strand based hair simulation running on GPU
- System is based on Cosserad rods.
- Can use long range attachment constraints to limit the stretch of hairs.
- Supports simulation (guide) and render (follow) hairs.
- Hair vs hair collision is handled by accumulating the average velocity in a grid and using those velocities to drive hairs.
- Supports collision with the environment, although it only supports ConvexHull and CompoundShapes at the moment.
- The roots of the hairs can be skinned to the scalp mesh.
- Note that this is still work in progress, some things that still need to be done are listed in Hair.h.
- Implemented a new friction model. This friction model is cheaper to execute (15 % faster, 40% less memory for Pyramid test) and doesn’t favor the first contact manifold point. Instead of applying friction at every contact point, we now calculate the average contact point and apply friction there. Friction consists of 2 linear constraints and 1 angular constraint. The linear constraints use the
friction_coefficient * sum(contact_impulse)to determine the max linear friction impulse, the angular constraint usesfriction_coefficient * sum(distance_friction_point_to_contact_point * contact_impulse)to determine the max angular friction impulse. - Increased maximum value of
HeightFieldShape::mBitsPerSampleto 16 to be able to create height fields that more closely match the uncompressed height values. - Made tolerance that’s used in the internal edge removal algorithm configurable in
CollideShapeSettings::mInternalEdgeRemovalVertexToleranceSqandPhysicsSettings::mInternalEdgeRemovalVertexToleranceSq. - Added support for RISC-V RVV, the SIMD extension for RISC-V.
- Added
JPH_BUILD_SHARED_LIBScmake variable to determine whether to build static or shared libraries (it defaults toBUILD_SHARED_LIBS). This allows embedding Jolt as a static library within a shared library. - Simulation stats: Added tracking of collision steps. This way we can know by how many steps we need to divide the numbers to get averages per step.
- Added support for glTF
KHR_physics_rigid_bodiesconstraint motors. This addsESpringMode::MassNormalizedStiffnessAndDampingto be able to specify the spring parameters mass-normalized / in acceleration-mode. It also addsEMotorState::PositionAndVelocitywhich creates a force proportional tostiffness * (position_target - position_current) + damping * (velocity_target - velocity_current). - Added
Ragdoll::DriveToPoseUsingMotorsvariant that drives to a pose using both position and velocity. - Added
Body::ApplyBodyCreationSettingsandBody::ApplySoftBodyCreationSettingsto be able to update a body with creation settings after creation. - Added
ShapeCastSettings::mExtraConvexRadiuswhich inflates the query shape by an extra convex radius. - Up to 40% performance improvement (scene dependent) and up to 70% memory reduction (scene dependent).
Key Links
Jolt Physics GitHub Repository
Jolt Physics 5.6 Release Notes
You can learn more about Jolt Physics 5.6 and see the new hair simulation in action in the video below.
