Fluid boundary collision bug?


As you can see from the diagram, the boundary collision is wrong, why is that? Is the SDF boundary mesh inaccurate with the actual 3D mesh? Is it a bug with the SDF generator or a bug with the fluid renderer?

cc @Evgeni_Popov (please be patient, our forum master is on well deserved vacation)

Because of Fix obj loader and exporter to support handedness correctly by bghgary Ā· Pull Request #14884 Ā· BabylonJS/Babylon.js Ā· GitHub, there was a breaking change introduced in the way .obj files are loaded, which makes this demo fail.

A simple fix is to set scene.useRightHandedSystem = true:

A more complicated fix would be to change how the SDF generator loads .obj files…

[EDIT] I’ve updated the doc page:

2 Likes

SDF is a pre-computed generated 3D texture, and can the 3D texture be moved and updated in a 3D scene? Can I see how to update the 3D texture calculation?

We don’t use a 3D texture because we do everything (fluid simulation + SDF calculation) on the GPU (hence why it’s slow).

The parsing of SDF data is done in _ParseSDFData (the SDF files are in FluidRendering/src/assets/sdf at main Ā· Popov72/FluidRendering Ā· GitHub), which fills a SDFArray, which is then used in SDMesh to calculate the distance to the mesh.

Thanks for the answer, can you take a screenshot and tell me which file the GPU SDF calculation collision detection code is in? I didn’t find it

We don’t do anything on the GPU, everything is done on CPU side. The SDF calculation for SDF meshes is done in SDFHelper.SDMesh. The collision handling code is in FluidSimulationDemoBase._checkCollisions.