Converting fluid into ice mesh - 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: Converting fluid into ice mesh (/thread-2443.html) |
Converting fluid into ice mesh - LaurieCheers - 24-08-2020 Hi. After my fluid simulation has settled, I want to freeze it. The scene will potentially contain a lot of ice at any given time, but a limited amount of flowing liquid, so for efficiency I'm guessing the best thing to do is to create a mesh from the fluid surface at the moment it freezes. So my idea is to grab all the particle positions, write them to a grid and run a Marching Cubes algorithm; does that seem feasible? Am I reinventing the wheel in making a feature Obi already has? And is there anything I need to know about how to interpret the Obi parameters, in order to for the ice mesh to look as similar as possible to the original fluid? (e.g. I'm unsure how to simulate Thickness Cutoff...) RE: Converting fluid into ice mesh - josemendez - 25-08-2020 (24-08-2020, 07:36 PM)LaurieCheers Wrote: Hi. After my fluid simulation has settled, I want to freeze it. The scene will potentially contain a lot of ice at any given time, but a limited amount of flowing liquid, so for efficiency I'm guessing the best thing to do is to create a mesh from the fluid surface at the moment it freezes. Hi there! Obi does not provide a way to freeze fluid, but your idea is not far from what you'd need to do. You could generate a mesh from the particles (using marching cubes, surface nets, or any other similar isosurface extraction method), get rid of the particles entirely, and use the resulting mesh to generate a MeshCollider, add a rigidbody and you'd be done. Obi does include a voxelizer that, while intended for mesh voxelization, you could use as a starting point to voxelize particles. From there to surface nets is just a few steps. You can find it at Obi/Scripts/Common/DataStructures/Voxelization/MeshVoxelizer.cs Some of the fluid renderer parameters are quite specific to screen space ellipsoid splatting, which is the technique used to render fluid. Thickness Cutoff could be considered a isosurface offset value. Other parameters (Smoothness) are not quite that straightforward to reinterpret. RE: Converting fluid into ice mesh - john-alienx - 09-02-2022 (25-08-2020, 08:00 AM)josemendez Wrote: Hi there! Can I find some help anywhere with some details on the process towards doing this? It seems quite advanced and I would like to know if there is any info you have that might help me get going. Thank you! RE: Converting fluid into ice mesh - josemendez - 10-02-2022 (09-02-2022, 03:04 PM)john-alienx Wrote: Can I find some help anywhere with some details on the process towards doing this? It's quite advanced if you haven't dealt with meshing algorithms before, but don't be intimidated. Look for surface nets online, there's lots of resources: https://cerbion.net/blog/understanding-surface-nets/ https://github.com/Q-Minh/naive-surface-nets https://www.youtube.com/watch?v=fnw9aiKN0iQ The basic idea is to start from a voxel representation of the fluid, build a "blocky" mesh from that, and smooth it out. |