Obi Official Forum

Full Version: Is it possible to use the fluid renderer without the fluid physics?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is it possible to either use the fluid renderer on a unity particle system, or to input the position, velocity, or acceleration of the particles based on a script? 
More specific, my usecase is that I have a burst/jobs implementation of boids that I want to make look "liquidy", and is considering Obi as a solution.
(31-03-2022, 12:40 PM)ITR13 Wrote: [ -> ]Is it possible to either use the fluid renderer on a unity particle system, or to input the position, velocity, or acceleration of the particles based on a script? 
More specific, my usecase is that I have a burst/jobs implementation of boids that I want to make look "liquidy", and is considering Obi as a solution.

Hi!

The fluid renderer can only render fluid particles (you can't render arbitrary meshes), but you can drive fluid particles yourself, and you can deactivate any part of the simulation you're not using.

In Obi you can read/write any particle property (positions/velocities, as well as any other property) at runtime:
http://obi.virtualmethodstudio.com/manua...icles.html

Particle data is laid out in a SoA way (one array per property) and they can be mapped to NativeArrays for easy access from jobs.

You can also globally enable/disable any constraints you're not using (density, collisions, etc):
http://obi.virtualmethodstudio.com/manua...olver.html

So in your case, easiest approach would be to disable all constraints in a solver, emit particles programmatically and drive their data yourself using custom Burst-ed jobs. Full source code is included in case you'd need to tweak internals.

kind regards,
(31-03-2022, 12:59 PM)josemendez Wrote: [ -> ]Hi!

The fluid renderer can only render fluid particles (you can't render arbitrary meshes), but you can drive fluid particles yourself, and you can deactivate any part of the simulation you're not using.

In Obi you can read/write any particle property (positions/velocities, as well as any other property) at runtime:
http://obi.virtualmethodstudio.com/manua...icles.html

Particle data is laid out in a SoA way (one array per property) and they can be mapped to NativeArrays for easy access from jobs.

You can also globally enable/disable any constraints you're not using (density, collisions, etc):
http://obi.virtualmethodstudio.com/manua...olver.html

So in your case, easiest approach would be to disable all constraints in a solver, emit particles programmatically and drive their data yourself using custom Burst-ed jobs. Full source code is included in case you'd need to tweak internals.

kind regards,

Thanks!