![]() |
Help In SolidifyOnContact exsample, Diffusion and Normal of solidified fluid become weird - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Fluid (https://obi.virtualmethodstudio.com/forum/forum-3.html) +--- Thread: Help In SolidifyOnContact exsample, Diffusion and Normal of solidified fluid become weird (/thread-4527.html) |
In SolidifyOnContact exsample, Diffusion and Normal of solidified fluid become weird - asimofu_ok - 01-08-2025 Excuse me again. In the SolidifyOnContact example, when I used a fluid with Diffusion and Normal textures, the result was as follows. Liquid is correct diffusion and normal. [attachment=2423] Solid is weird diffusion and normal texture. [attachment=2424] Inspector used for ObiFluidSurfaceMesher [attachment=2425] It seems that something is wrong because the invMass of the solidified particles becomes 0, but I couldn't figure it out even after looking at the shader graph. RE: In SolidifyOnContact exsample, Diffusion and Normal of solidified fluid become weird - josemendez - 01-08-2025 (01-08-2025, 12:30 PM)asimofu_ok Wrote: Excuse me again. Hi, Diffuse and normal textures are advected trough the fluid's velocity field. Granulars (which is what fluid particles become upon impact with a surface and solidify) don't define a velocity field so they don't support diffuse/normal textures. We may extend the method in the future to generate a velocity field for granulars. (01-08-2025, 12:30 PM)asimofu_ok Wrote: It seems that something is wrong because the invMass of the solidified particles becomes 0, but I couldn't figure it out even after looking at the shader graph. This is intentional. As explained in the manual, setting the inverseMass of a particle to zero disables dynamics simulation for it and allows to override its position manually. This is what the sample scene does to "solidify" particles: turn them into granular particles with infinite mass (invMass = 0) and then set their position manually to follow the transform of the object they hit. See Obi/Samples/Fluid/SampleResources/Scripts/SolidifyOnContact.cs script for more details. kind regards RE: In SolidifyOnContact exsample, Diffusion and Normal of solidified fluid become weird - asimofu_ok - 01-08-2025 (01-08-2025, 02:09 PM)josemendez Wrote: Hi,I see, thank you. RE: In SolidifyOnContact exsample, Diffusion and Normal of solidified fluid become weird - asimofu_ok - 04-08-2025 Sorry to bother you again. Is there a way to apply the velocity field to a solidified liquid using a script? Due to my lack of knowledge about bursts, I was unable to determine what causes the velocity field. 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. RE: In SolidifyOnContact exsample, Diffusion and Normal of solidified fluid become weird - josemendez - 04-08-2025 (04-08-2025, 03:11 AM)asimofu_ok Wrote: Sorry to bother you again. 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, RE: In SolidifyOnContact exsample, Diffusion and Normal of solidified fluid become weird - asimofu_ok - 04-08-2025 (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. I tried verifying the script for a while, but it seems very difficult to understand, so I think I'll give up for now. |