04-08-2025, 11:38 AM
(04-08-2025, 08:08 AM)josemendez Wrote: Yes of course (you can do pretty much anything using a script) but it's not trivial.Thank you very much for your detailed explanation.
The velocity field is calculated in BurstFluidMesherSystem.cs, in the SampleSDF job. There, we iterate over each "chunk" (group of 64 voxels) in the mesh, and for each vertex in the chunk, we iterate over nearby particles and calculate a weighted average of their velocity.
The problem again is that granular particles don't define a density value and don't have any neighborhood over which we can define a finite-support kernel. So for granulars, we'd have to fall back to a different method of calculating velocity field data.
Yes, the velocity there is calculated from the velocity value stored in each mesh vertex. These per-vertex velocities are the velocity field.
If this is an important use case for you I can take a deeper look and try to devise a way to calculate an appropriate velocity field for granulars, even if it's not perfect.
kind regards,
I tried verifying the script for a while, but it seems very difficult to understand, so I think I'll give up for now.