Jump to content

Culling SPH blobs with low particle density?


mightcouldb1

Recommended Posts

Haven't been on here in a while... The studio I am at finally got a license of Houdini, so hopefully no more "M" word. :)

I was doing some splashes with SPH and I noticed that SPH fluids tend to clump into small balls of particles that are a bit distracting when they are surfaced. They are blobs of 5-10 particles that I would like to remove but am not sure exactly how to. I can delete these by using manual methods, but I'd like to find a method that is fully procedural if possible.

I was thinking that I could group particles that have less than 10 particles in proximity of one another and then pass that result into a delete node. In theory I think that this is work but I am still relatively new to Houdini and require a bit of a hint. Can someone help me out with this?

Cheers

P.S. While I'm posting this I might as well ask: What Particle Fluid Surface settings do you guys typically use? (i.e. speed stretching, filtering, filter tightness)

Link to comment
Share on other sites

They way I always did it was to use a VOP SOP setup that handled the input geo as point cloud and allowed me to sample how far away the Nth particle was. If a point didn't have more than say 5 particles within a certain distance then I would delete it. It's not perfect but it definitely gets bunches of stray particles.

Attached is kind of a crappy example file as my low rez simulation doesn't really run into the problem but it does have a few strays that do get zapped. Since my example sucks I look at only the closest 2 (number of points -1) points and find which of them is the farthest. If that distance is > than some number I specify the point gets deleted. In a real sim you'd probably want the number of points higher and you'd have to figure out a good distance to start culling at.

sph_blob_culling.hipnc

Link to comment
Share on other sites

Hey thanks for the response! This is exactly what I was looking for. Everything makes perfect sense to me except for one thing.

In your expression op:`opinputpath("..", 0)`

I understand that opinputpath is telling it to grab the current connected node at index 0, but I am a little confused why you have to write "op:" before it.

I tried to find this in the Houdini docs, but anything with non-alphanumeric characters spits out an error. Where can I find stuff like this in the Houdini docs for future reference(is there an escape function for the help? e.g. "\:")?

Link to comment
Share on other sites

The op: syntax allows you to point to an operator when something is expecting a file. In this case the pcopen vop wants to load a .pc file from disk, but using the op: syntax we can get it to look at the geometry that's coming into the node instead. I think it's one of those little gems that is sadly not documented anywhere.

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...