Skip to main content

v0.35.0 - Rapier vs Box2D vs Jolt vs Box3D

· 4 min read

Godot Rapier now runs on Rapier 0.35.

Both 2D and 3D builds now always have parallel SIMD solver and cross platform determinism enabled.

2D: Rapier vs Box2D

Rapier is the only engine that keeps every scene stable: Box2D collapses the pyramid and blows the joints apart, those are marked as unstable.

EngineVersionAddon
Rapier Rapier2Dv0.35godot-rapier2d
Box2D Box2Dv3.1godot-box2d-v3
EngineRapier
Rapier2D
Box2D
Box2D
pyramid16 ms
1.8 cores
17 ms
4.1 cores
unstable
smash8 ms
2.2 cores
9 ms
4.4 cores
pile7 ms
2.0 cores
6 ms
3.2 cores
queries5.5 ms
1.2 cores
3.9 ms
1.8 cores
joints6.4 ms
1.6 cores
3.8 ms
2.8 cores
unstable
BenchmarkConclusion
PyramidRapier hold the pyramid stable, 2.3x fewer cores. Box2D collapses, unstable
SmashRapier 1.13x faster, 2.0x fewer cores
Mixed shape pileBox2D 1.23x faster, Rapier 1.6x fewer cores
Query stormBox2D 1.42x faster, Rapier 1.5x fewer cores
Joint gridRapier holds the joints together; Box2D explodes, unstable

3D: Rapier vs Jolt vs Box3D

Rapier3D is fastest on three of five scenes and 4x ahead on queries; Jolt crashes the joint grid. Box3D is single threaded (issue on godot-box3d side).

EngineVersionAddon
Rapier Rapier3Dv0.35godot-rapier3d
Jolt Joltv5.5.0ships with Godot v4.7
Box3D Box3Dv0.1godot-box3d v0.2.3
Rapier
Rapier3D
Jolt
Jolt
Box3D
Box3D
queries5.6 ms
1.1 cores
22 ms
1.2 cores
6.3 ms
1.0 cores
pyramid19 ms
3.4 cores
24 ms
5.6 cores
25 ms
0.9 cores
pile10 ms
2.5 cores
11 ms
5.1 cores
14 ms
1.0 cores
joints11.4 ms
2.3 cores
unstable
never finishes
11.2 ms
1.0 cores
smash12 ms
2.9 cores
11 ms
5.0 cores
17 ms
1.0 cores
BenchmarkConclusion
Query stormRapier 4.0x faster than Jolt, on par with Box3D
PyramidRapier 1.22x faster than Jolt, 1.27x than Box3D
Mixed shape pileRapier 1.12x faster than Jolt, 1.37x than Box3D
Joint gridRapier and Box3D tie; Jolt unstable, never finishes
SmashJolt 1.05x faster, using 1.7x more cores

Building without experimental-threads

Official builds enable experimental-threads so the physics server can be driven from other threads. It costs 7-51% depending on the scene, so building from source without it is faster:

BenchmarkWithout threadsOfficial build
2D box pyramid16.4 ms18.2 ms11% faster
2D mixed pile6.9 ms8.0 ms17% faster
2D joint grid6.4 ms7.4 ms15% faster
3D box pyramid19.4 ms20.7 ms7% faster
3D smash12.0 ms18.1 ms51% faster
3D query storm5.6 ms8.0 ms43% faster

New features

  • Rope and fixed joints, in 2D and 3D. Godot has no equivalent of either. Reference.
  • Per-body solver iterations: stabilize one important body without paying for it globally. Reference.
  • Per-joint stiffness and toggling: joint_set_softness, joint_set_enabled for breakable constraints. Reference.
  • Joint warm starting: stiff joint assemblies converge much better, at no measurable cost.
  • New project settings for motion recovery, shape casting and query behaviour.

Full Changelog: https://github.com/appsinacup/godot-rapier-physics/blob/main/CHANGELOG.md