(08-05-2024, 07:43 AM)josemendez Wrote: Those in your gif are not foam cards/particles (or at least, not just particles), that's crossfaded texture coordinate advection.
This is a technique that advects two sets of texture coordinates using fluid velocity, crossfading between them and periodically resetting them to avoid too much stretching. We have this in FluXY, maybe this is what you meant in your other post about advecting mesh vertices?
For heightmap-based fluids this is very easy to do, since UV coords can be just top-down projected. For arbitrary 3D meshes however one must device a way to procedurally generate base texture coordinates for the mesh - triplanar mapping would be the basic way to approach this.
Obi does not support this yet, but likely will in the future: all that's needed to be able to do this in a shader is for the fluid mesh to contain velocity information in its vertices, which is very simple to do (at the cost of increased surface chunk memory usage).
Compared to particle based foam, this is quite limited though since it confines foam to the surface: foam can't be underwater, and can't splash out of the water. The good news is that both methods can be combined.
Tried using it, but the workflow for reading/writing data to/from compute shaders is honestly not very good. Coupled with the fact that we also needed support for CPU simulation for Burst and precise control over how velocity-based billboard stretching is done (in VFX graph it results in weird distortion when the velocity vector faces the camera forward vector, which breaks the illusion of foam splashing around) we decided it would be easier and faster to roll our own GPU/CPU particle system and include it with the asset.
Hi, that's not what you think. The technique you used and same as that Catlike Coding's blog post result in an unpleasing periodically resetting effect in the foam life duration, while the gif I show you does not have that.
Those actually are splash cards, same as advected particle, but bigger, and have orientation follow the movement.
You can take a read on this blog
Working with Niagara Fluids to Create Water Simulations (80.lv)
Haft way through the blog, they reveal the splash card representation
Water surface + caustic
Water surface+caustic+splash cards
splash cards visualized.
If you can do this, the advected particles number can be reduced by a lot since their size can be very big, like that 3rd gif.