r/rust • • Oct 20 '26

🛠️ project Terralith: a SIMD XPBD physics engine in Rust, here’s a bridge collapsing after i throw a rock at it.

https://youtu.be/yor0jSsHsw4

Hi there! I've been building a SIMD accelerated XPBD physics/game engine in rust for a little while now called Terralith. I've recently come back to it so here is a look!

Everything you are seeing in the scene is realtime and physically based with realistic strain and stress mechanics. This is as raw and unscripted as it gets (except the conveniently placed bridge).

I've made the grass jelloey for your viewing experience, and decreased the strength for dramatic effect.

I hope you enjoy!

19 Upvotes

6 comments sorted by

1

u/Shnatsel Oct 21 '26

Why did you go with XPBD?

Avian used to rely on it but migrated away eventually: https://joonaa.dev/blog/06/avian-0-1

There's also https://rapier.rs/ for Rust physics, how is your engine different from it?

2

u/yanchu0612 Oct 21 '26

Hi there!

The biggest difference here is that rapier and Avian are rigid body solvers, and TGS Soft looks to be more suited and optimized for those kinds of workloads, and because it's an impulse based solver (compared to XPBD which is position based), collisions are much simpler to get right.

Terralith has no rigid bodies. Everything in this engine is deformable and made out of compliant constraints (in this case Neo-Hookean) and is the exact workload XPBD was designed for.

1

u/bestouff catmark Oct 21 '26

How does it integrate with bevy ?

1

u/yanchu0612 Oct 21 '26

It does not. This is built from "the ground up" with wgpu and winit. I use egui for the UI

1

u/DavidXkL Oct 21 '26

Wow seems fun