23-10-2024, 06:32 AM
(22-10-2024, 08:04 PM)josemendez Wrote: I’m sad to inform you that the author of that video has absolutely no idea what “fluid simulation” means :/.Thank you very very (!) much for the tips. I'll have a look into this and I'll consider your offer!
The video clearly shows a regular particle system + texture splatting, which is a technique related to decals: instead of using a set of pre-defined textures as your decals (which would result in the blood stains on the floor not lining up with the particles that generated them, and jarring reuse of the same textures time and time again) you set up an empty texture and “splat” (rasterize) each particle where it hits the texture. This way you obtain a decal that’s unique every time, and follows the particle splash pattern precisely.
However this technique involves no fluid simulation whatsoever. For something to be a “fluid simulation” it has to solve the Navier-Stokes equations in any of their many forms. The specific flavor of these equations solved and the approach used determine the kind of fluid simulator:
- cell based (aka Eulerian), such as level-set, lattice boltzmann, most SWE solvers, or stable fluids - used by Ghost of Tsushima for grass wind and blood advection on rivers.
- particle based (aka Lagrangian) such as SPH or PBF
- hybrid such as MPM or PIC/FLIP.
You can google these terms to get a lot of information on each method. Obi is a lagrangian solver, more specifically a PBF (position-based fluid) solver. You don’t need it at all to obtain the effect shown in the video, in fact it would only hinder you by consuming resources doing nothing of value for your use case. A fluid solver is only required when you need to simulate pressure, vortices, viscosity or surface tension effects, none of which have any noticeable effect in a blood splat on the floor (mainly because blood does not accumulate enough to slosh around or have any visible currents/vortices in it, it just lays there on the floor). If you were to simulate a relatively large volume of accumulated blood like a bucket or a pool, using fluid simulation would begin to be a reasonable idea.
You need a good decal/splat based solution, and maybe a GPU-based particle system like Unity’s VFX Graph. My advice would be to do a bit of research on the subject. If at any point you feel like getting a refund for Obi Fluid, just let me know.
Kind regards
Two questions though; what would be the "cleanest" way to have different liquids come out of multiple moving objects (so multiple emitters)? As the emitters have to be parented to the solver, I'd have to make the emitters be in the right location and orientation. So I'd make a script for the emitters to move to the right places?
And second question;
How do you trigger fluid emitting via script?