Hi! Jose here, Obi’s author.
Obi uses XPBD. It’s just that Obi restricts itself to ellipsoidal particles, but nothing prevents it from using rigidbodies instead - in fact it already performs its own rigidbody simulation to interact with Unity rigidbodies.
I’ve also implemented AVBD (in a toy sandbox written in Processing) for testing purposes. (X)PBD and (A)VBD are close cousins: both are position based methods, and both can work on vertices/particles (mathematically they’re the exact same thing, a position in space) as well as rigidbodies (position + orientation, regardless of whether their collision geometry is determined by polygons, SDFs, or analytic shapes). I’ll call all of these these things “bodies” for simplicity.
Both methods work by adjusting body positions/orientations, instead of linear/angular velocities like traditional solvers. There’s quite a few differences between both, but one of the most significant ones is that (X)PBD is a dual method, while (A)VBD is a primal one. What does this mean? it has to do with the relationship between bodies and constraints (equations that relate bodies to each other). PBD does this:
for each constraint
for each body affected by the constraint
CalculateAndApplyCorrectionToBody();
While VBD does this:
for each body
for each constraint affecting the body
CalculateAndApplyCorrectionToBody();
(This is very dumbed down but will suffice). When you parallelize the outer loop of both methods, XPBD may have multiple constraints that affect the same body, resulting in race conditions. To avoid them, it’s necessary to either:
- Use atomics to apply corrections.
- Store corrections and only apply them once the loop is done (Jacobi style solver, not desirable because of slow convergence/stretching)
- Group constraints that do not share bodies so we can do all constraints in each group in parallel - but groups are processed sequentially, so the fewer groups we end up with the better. (Gauss-seidel style solver, using graph coloring)
Out of these, the third option is usually the best since it results in stiffer constraints and doesn’t require thread synchronization. AVBD however has it easier here, since each body calculates and applies its own corrections. So if we go for option #3 in AVBD, we don’t need to group constraints based on which bodies they share: instead we need to group bodies based on which constraints they share. And not because threads would step on each other’s toes - they wouldn’t-, but because we want bodies to use the most up-to-date neighbor data to speed up convergence. In graph theory, the former is called a dual graph, and the latter a primal graph. Coloring (grouping by adjacency) the primal graph results in fewer groups/colors than coloring its dual, so we get better parallelism.
However, this doesn’t apply in all cases. For instance, 1-dimensional objects like ropes yield linear primal graphs, which can be colored using only 2 colors just like their dual counterpart. 2D objects such as cloth tend to yield a small number of colors for both the primal and dual graphs. So in these cases, both methods perform similarly (if correctly implemented). Volumetric softbodies (tetrahedra-based ones) and large rigidbody simulations with lots of collisions tend to be where AVBD can reap most benefits, as they have the most edges in the primal graph.
So is VBD a breaktrough? Imho, time will tell. Compared to PBD, it has strengths (better high mass ratio resilience, better parallelism in some cases) and weaknesses (higher cost if poorly parallelized/not parallelized, more cumbersome to implement, fiddly parameters, when it breaks it breaks way worse). Overall both methods serve the exact same use cases, and both can simulate softbodies and rigidbodies. From a theoretical standpoint AVBD seems to be the better option. However, there’s a lot of literature on XPBD, it’s been implemented in lots of software (Houdini, RealFlow, Maya, etc) and battle tested to the point of becoming an industry standard, so we’ll have to wait for AVBD to reach a similar status.
However, AVBD seems to solve one of the biggest issue in softbody simulations, which is stretch of constraints on low iteration count.
AVBD exhibits less stretching in case of large mass ratios, but when object masses are similar convergence speed - and hence stretching - is comparable to XPBD. On the other hand, AVBD has convergence issues with large stiffness ratios: it’s a “pick your poison” situation. Would not be a stretch (pun intended) to think of them as both sides of the same coin.
You can improve AVBD’s convergence speed and resilience against large stiffness ratios using warmstarting (see the AVDB paper), and you can improve XPBD’s convergence speed and resilience against large mass ratios using substeps instead of iterations (the difference this makes is staggering!). As a side note, this is what the Temporal Gauss Seidel (TGS) solver in PhysX does: use substepping instead of iterations.