6 ms·
out of curiosity, when and/or how often do these high-performance math libraries get folded into game physics engines? Like would Blaze offer any sort of advant
by Solvency 2y ago
out of curiosity, when and/or how often do these high-performance math libraries get folded into game physics engines? Like would Blaze offer any sort of advantage if you were to develop a new 3d soft/hard body physics engine?
- cyber_kinetist 2y agoFor typical game physics engines... not that much. Math libraries like Eigen or Blaze use lots of template metaprogramming techniques under the hood that can help when you're doing large batched matrix multiplications (since it can remove temporary allocations at compile-time and can also fuse operations efficiently, as well as applying various SIMD optimizations), but it doesn't really help when you need lots of small operations (with mat3 / mat4 / vec3 / quat / etc.). Typically game physics engines tend to use iterative algorithms for their solvers (Gauss-Seidel, PBD, etc...) instead of batched "matrix"-oriented ones, so you'll get less benefits out of Eigen / Blaze compared to what you typically see in deep learning / scientific computing workloads. The codebases I've seen in many game physics engines seem to all roll their own minimal math libraries for these stuff, or even just use SIMD (SSE / AVX) intrinsics directly. Examples: PhysX (https://github.com/NVIDIA-Omniverse/PhysX https://github.com/NVIDIA-Omniverse/PhysX), Box2D (https://github.com/erincatto/box2d https://github.com/erincatto/box2d), Bullet (https://github.com/bulletphysics/bullet3 https://github.com/bulletphysics/bullet3)...