with rigid bodies implemented using a similar method as the Bullet-Fluids v.2 library. I'm having some
crashes with compound-compound(rigid against rigid) after updating to a more recent version of Bullet3,
though.
Here is an earlier video:
http://www.youtube.com/watch?v=1HHJJLKkGUQ
I've also looked into Fluids v.3, and implemented a similar solver (b3FluidSphSolverOpenCL2 in the Bullet3 fork).
From what I can tell, the main difference between Fluids v.3 and b3FluidSphSolverOpenCL2 is that it:
- -Uses a variable sized explicit grid instead of a fixed size(64^3) grid
- -Does not use modulo to expand the grid into an infinite domain
- (not using modulo causes memory issues for very large scale simulations,
but using modulo would make some optimizations more difficult)
- (not using modulo causes memory issues for very large scale simulations,
- -Uses counting sort instead of radix sort
- (Fluids v.3 also sorts the particles in the counting sort kernel,
as opposed to sorting [grid cell index, particle index] pairs,
and then using that sorted array to rearrange the position, velocity, etc. arrays)
- (Fluids v.3 also sorts the particles in the counting sort kernel,
but is the 'Fluids-Zlib' license acceptable? It seems very similar to the MIT license.
There is also a more optimized solver(b3FluidSphSolverOpenCL) using a different grid algorithm.
Excluding things such as compiler optimizations(not implemented in Fluids v.3 itself, but due
to CUDA having closer access to the underlying GPU architecture) this solver should be very
competitive with Fluids v.3.
An example timing would be ~12ms for a fluid simulation of 131,072 particles at rest on a Radeon HD 5850.
This timing, which does not include rigid body interactions, may be decomposed as:
- ~8 ms for the SPH density, SPH force calculation, and position/velocity integration
- ~4 ms for the grid update
Additionally, even if an OpenCL port were to reduce the grid update to 0ms/frame and be equally fast on all other
steps, it would be at best ~1.5x faster.
Regarding fluid-rigid interactions, fluid particles are currently able to tunnel through rigid body trimeshs as the
OpenCL raycaster has yet to be optimized. I would like to implement such optimizations -- does testing each ray
against the GPU SAP broadphase sound like a reasonable optimization?