22-10-2024, 08:04 PM
(This post was last modified: 22-10-2024, 08:17 PM by josemendez.)
(22-10-2024, 04:24 PM)aardworm Wrote: Thank you! I understand but my game will have sword mechanics and blood simulation like Ghost of Tsushima.
It seems Ghost was made with using fluid simulation, particle effects and blood decals. This (video) is what I'd like to achieve as as well. The blood system has decals and particle effects. I'm just wondering how I'd include the fluid simulation. Meaning, you'd probably have to move the fluid emitter to the location where the blood is needed. And if you're slicing two people at once, you 'd need to have multiple blood emitters in the right place.
Or how would you set up your project if you'd like to have liquid simulation in addition to particles and decals?
I’m sad to inform you that the author of that video has absolutely no idea what “fluid simulation” means :/.
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