Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  In SolidifyOnContact exsample, Diffusion and Normal of solidified fluid become weird
#5
(04-08-2025, 03:11 AM)asimofu_ok Wrote: Sorry to bother you again.
Is there a way to apply the velocity field to a solidified liquid using a script?

Yes of course (you can do pretty much anything using a script) but it's not trivial.

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.

(04-08-2025, 03:11 AM)asimofu_ok Wrote: UV seems to be generated from FlowmapAdvect in the shader graph, but the velocity there does not seem to be related to the velocity field.

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,
Reply


Messages In This Thread
RE: In SolidifyOnContact exsample, Diffusion and Normal of solidified fluid become weird - by josemendez - 04-08-2025, 08:08 AM