Jump to content

VDB Fluid Meshing -> Smooth Workflow with VDB-Masks?


Scratch

Recommended Posts

Hey Folks!

 

I currently need to mesh a particle fluid sims using VDB (sim particles come from both, houdini and RealFlow as alembic with point attributes on them) but I ran into serveral issues. My current workflow is as follows:

 

fluid sim particles -> vdb from particle fluid -> vdb reshape (dialate, erode) if needed -> smooth vdb sdf -> attribute transfere v from particles to mesh -> convert vdb (to polygons) -> rop alembic output

 

So far so good. Technically, it works, but I constantly run into the problem that I either get a detailed mesh (with less or no smoothing), or a smooth mesh with far less details (they - especially fine droplets - all get smoothed away). Second option to get a smoother fluid body is to use a high influence scale witihn the vdb from particle fluid node, but that also connects droplets together which shouldnt interact (leaving me with spaghetti-like strings instead of fine independent droplets). I attached 2 Images to illustrate both cases. 

 

I read on the net (http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=31865 -> jeff's first post) and in the manual that you can mask your vdb smooth sdf node by annother vdb fog volume. It furthermore brought "mask VDB" volumes in the vdb from particles node to my attention, which somehow sounds suitable for what i'd like to do - but i dont know how to generate or use it at the moment. Extract from the Houdini Manual, vdb from particles node: "VDB Mask -> Create a mask field VDB. Generate an alpha mask that is very useful for subsequent constrained level set smoothing of the level set surface from the particles. This alpha mask is defined as the FOG volume derived from the CSG difference between a level set surface with a maximum radius of the particles and a level set surface with a minimum radius of the particles. This mask will guarentee that subsequent level set smoothing is constrained between the min/max surfaces thus avoiding the problem that surface details can be completely smoothed away."

 

Now my questions are:

Is it somehow possible to get a smooth fluid body AND preserve the fine detail / droplets?

Can someone explain to me what mask volumes are and how they work? (i read the manual, somehow figured they might be connected to my problem, but it does not make to much sense yet)

How do I use and generate mask volumes propperly to use it in conjunction with the vdb smooth sdf node? 

Can you guys maybe show me some workflow examples?

Furhtermore, is it somehow possible to create velocity streaks? Or take the velocity into account?

 

Thanks in advance for your help and time!

post-7428-0-82213200-1420815241_thumb.jp

post-7428-0-01929000-1420815249_thumb.jp

post-7428-0-70397200-1420815267_thumb.jp

Edited by Scratch
Link to comment
Share on other sites

One thing I recommend you to look at is to skin sim particles this way:  vdb from particle fluid or vdb from points -> vdb reshape (dialate) -> smooth vdbs -> vdb reshape (erode)

When you need to smooth the sdf result from apoint conversion, no matter if is with the new particle surface or the point one, always "dilate, smooth, erode", this way you can smooth out and preserve finer details without crunching out the drops and small details.

I always stay away from the new black box particle surface, I like more the initial conversion with vdb from points more, then I use all the vdb pipeline power.

Edited by Pazuzu
  • Like 5
Link to comment
Share on other sites

you can also merge lower res vdbs with higher rez ones pretty easily.  so you could do a high rez simple particle vdb with essentially discrete spheres that are then unioned with a more conventional eroded/smoothed surface vdb of lesser resolution.  you can also cull out points by attribute and do different vdb operations on your vdbs and merge them for more complex results.  i haven't done masking, but i'm guessing you can get the same results by doing multiple passes on different sets of points.

Link to comment
Share on other sites

HI Fathom,

 

When you combine the high res and low res vdbs, do you upres the low res large surface to become high res?  I have tried a few scenerios like this in the past and always felt it was fairly inefficient.  What do you think?  Do we need something like multi-res vdb, or are there ways to work with the current vdb toolset efficiently?

 

you can also merge lower res vdbs with higher rez ones pretty easily.  so you could do a high rez simple particle vdb with essentially discrete spheres that are then unioned with a more conventional eroded/smoothed surface vdb of lesser resolution.  you can also cull out points by attribute and do different vdb operations on your vdbs and merge them for more complex results.  i haven't done masking, but i'm guessing you can get the same results by doing multiple passes on different sets of points.

Link to comment
Share on other sites

Interesting! Thanks again for your support folks!

 

So by seperating the droplets from the fluid body (particles) i would get much more control, thats exactly what I need! Realflow for example offers a point attribute called "neighbours" which stores the number neighbour particles within a certain radius, thats perfect to isolate lonesome droplets (thresholding and grouping based on that attribute). If that attribute is not present one can certainly find other ways to group the particles, thats really a good idea! I'll try that out!

 

VDB-Combining:

I think I would upres would upres the lower vdb to the higher one, just for quality sake, but I guess thats to be tested and decided case-by-case. (speed vs. quality).

 

Still, I would be very interested to hear if someone knows something about that vdb mask volumes and how to use them. If Jeff "Oldschool" Wagner suggests to use it, it's usually something you want to know and do ;) Any ideas guys?

Link to comment
Share on other sites

HI Fathom,

 

When you combine the high res and low res vdbs, do you upres the low res large surface to become high res?  I have tried a few scenerios like this in the past and always felt it was fairly inefficient.  What do you think?  Do we need something like multi-res vdb, or are there ways to work with the current vdb toolset efficiently?

 

yeah, you rez up the lower rez vdb during the combine.  meshing might end up taking some time, but the goal isn't to make it fast, it's to make it look good.  higher rez vdbs can often capture too much detail so going low rez can give a more cohesive mesh for areas that don't need the fine detail.

Link to comment
Share on other sites

I agree. I often build me a switch between the Particles and the Volume to judge if I am somehow close to what the particles look like. Or you could group all the particles which are inside (or outside) your VDB sdf, and color them so you get visual feedback how close in terms of shape you are to your original sim.

 

The 2 volumes + merge approach and also the method to group certain particles (e.g. body, and droplets) to treat them seperately/differently works by the way. I managed to set it up, but I am still playing with it to get good results.

EDIT: I've dropped that approach again since it is giving me strange results,...the fluid droplets sticked out of the smoothed fluid body, producing little dents all over the place.

 

Dialate - Smooth - Erode is great! It helps to preserves the overall volume of the fluid much better (thin areas/sheats of liquid won't disappear that easy). Thats certainly something I will keep doing!

 

On the other hand..that mask stuff is still driving me crazy...I managed to use a normal fog VDB volume to mask off my smooth (everything inside the fog will not get blurred), and you also can blur the volume to get a somehow smooth falloff - thats a step forward - but i still haven't figured how that "VDB mask volume" thing is used. I'm missing something here,...it can't be that hard can it?!

 

EDIT2: I ended up using a fog volume of the fluid body to mask the smooth sdf node at the end Body gets smoothed out, while droplets remain in tact. That in combination with a pscale attribute for the droplet-scale (multiplier) tends to bring good results!

Edited by Scratch
Link to comment
Share on other sites

  • 1 month later...

Here is a screenshot of my setup trying to implement what is being discussed in this thread. I used the VDB From Particles node in Fog mode as the mask for the VDB Smooth SDF node. This does work but I would still like to know how to created the masks talked about and I still don't know how to leverage the pscale to scale the actual fog volume.

 

Any help would be appreciated. Can someone post a picture of the network or a HIP file with the setup working?

 

Thanks

post-12295-0-47654000-1424973022_thumb.p

Edited by Atom
Link to comment
Share on other sites

I think I am closing in on a possible solution. This image shows a network where standard particles are converted to fog. The fog is converted to a VDB and connected to the Optional VDB masking input of the VDB Smooth SDF node. Dilate and Erode are also in play as additional controls for shaping the final ConvertVDB to polygon.

 

The VDB From Standard Particles uses the pscale variable by default so no more wiring or coding is needed, according to the help.

 

I would still like a way to add a MINI/MAX or FIT function to the fog to make it more bright in the middle and perhaps a falloff towards the wispy droplets.

post-12295-0-54980500-1424987511_thumb.p

Edited by Atom
Link to comment
Share on other sites

I've put together a quick scene to illustrate the concept a bit better. From there you can go and refine stuff however you like using all the cool vdb-nodes houdini offers. Please excuse the miserable sim in there, it's just there...that there is actually something there ;)

 

Hope that helps! :)

Edited by Scratch
Link to comment
Share on other sites

Thanks for the reply and posting the HIP file.

 

I setup a couple of switches to compare my setup with yours. They are close in final output but there are subtle differences. Your setup uses Erode -> Smooth -> Dilate. My setup initially had Dilate -> Smooth -> Erode. But I put a switch on my setup to try out Erode -> Smooth -> Dilate as well.

 

Here are some test images.

post-12295-0-04227600-1425143089_thumb.p

post-12295-0-61806900-1425143099_thumb.p

r13_FLIP_smooth_compare_1a.hipnc

post-12295-0-52788700-1425143512_thumb.p

Edited by Atom
Link to comment
Share on other sites

I think you've mixed it up a bit...The volume (including the erode and smooth) you see on the right side of the node-tree is ONLY used to generate the mask (volume) for the smooth sdf node (check it, it goes into the smooth-SDF's mask input). I didnt do any operations on the real fluid meshing node (yet, you can of course. It is there where you want to use the dialate - smooth - erode workflow. But as far as the generation of the mask volume goes, it's the other way round: To preserve the droplets (not smoothing them), they have to be outside the mask volume (everything inside gets smoothed). So i generate a volume from the incoming particles, and then I erode it a bit so the droplets stick out of it. Afterwards, I use this volume to mask my smoothing for the mesh I generate with the "vdbfromparticlefluid1"-node.

 

Your method just generates the mask volume some other way...(compare what goes into the smooth SDF's second input in my vs. in your setup). As I see it from here, you include everything in your mask volume, not only the fluid "body".

 

To visualize the difference, put the reference flag (pink) to the alembic particles, and the display flag on the mask volume. You should see particles sticking out of the mask-volume on my setup.

 

Hope that clears things up, sorry for any confusion that I may have caused. Happy meshing! ;)

Edited by Scratch
Link to comment
Share on other sites

  • 4 months later...

I know I'm "Johnny-come-lately" to this, but I have to say, this is such a "simple" solution for keeping details in splashes, etc., using VDB mask(s), that it's genius - at least to me.   I am new to Houdini, when it comes to making strides into becoming more FX TD and problem solver.  I'm continually challenged to think outside the box for efficient, simple, and procedural solutions and I love it.   Thanks for this thread.    

 

My 2 cents. 

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

Thank you for all the tips guys

I was hitting a wall in making an object into vdb and making it with as smooth as possible.

The Dilate/smooth/erode is really working well

Edited by FR3D
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...