Jump to content

How to create a VDB SDF volume?


magneto

Recommended Posts

Thanks, that helped. Can I just drop in a VDB from Polygons instead of an old SDF volume? Because when I did that and saved the attribute values for each point of a geometry using this volume that represents another geometry, the attribute values are completely different. I am using Volume Sample in a VOPSOP and the old volumes give me the correct distance values from this volume to my geometry.

But the VDB SDF has different distance values. Is it a matter of playing with the VDB parameters?

Link to comment
Share on other sites

The VDB from Polygons is the right one to use to make an sdf. You should understand 2 things... 1 is that that vdb does not fill the volume the same way, since it uses sparse volumes you only get proper values within your set voxel bandwidth (increase bandwidths and/or fill interior depending on your needs). 2 is that the sdf values for vdb are flipped (negated).

  • Like 1
Link to comment
Share on other sites

Also guys I just tried the Fill Interior and it works great, and actually solves another problem for me :)

Because I don't know why this is happening. In both SDF volumes, I have a simple grid and a sphere and I am checking the value (Volume Sample) for the point at the exact center of the sphere volume and the IsoOffset's SDF gives me -0.86, while VDB gives me 0.99, which is close to what I expect.

I understand the sign difference but I mean the absolute value. Increasing the resolution of IsoOffset's SDF from 30 to 100 brings the value up to -0.95, which is not bad but I was hoping -1 or -0.99. VDB SDF only has 50K voxels, and yet gives more accurate values.

Does this have to do with volume resolution and VDB somehow interpolates the values better? Or are SDF volumes something VDBs are better at?

Thanks :)

Edited by magneto
Link to comment
Share on other sites

Ah... k. I was actually basing that statement off of the Fluid Source sop. It outputs collision volumes negated.... and I was trying to get a vdb collision working, but had to set the source volume's multipler to -1 in dops. Figured it would best up to work with just a default signed sdf.

Link to comment
Share on other sites

Ah... k. I was actually basing that statement off of the Fluid Source sop. It outputs collision volumes negated.... and I was trying to get a vdb collision working, but had to set the source volume's multipler to -1 in dops. Figured it would best up to work with just a default signed sdf.

This is because for obscure historical reasons, the collision field in Houdini fluids is indeed inverted from what you might normally think. Since FluidSource is directly manipulating the collision field, you have to invert the source volume before merging it into the collision field. But you have to do the same thing if the source volume is a regular, non-VDB SDF from the IsoOffset SOP, for example.

Edited by johner
Link to comment
Share on other sites

Do you guys know the best way to represent a sphere as an SDF volume? When I convert a primitive or polygonal sphere, it's not as smooth because of resolution. NURBS seem to give better result at low resolution but seems slower to convert to a volume.

Can I just populate some points as spherical SDF volumes? Using a spherical SDF VDB and then copying it onto points take 30 seconds and 5GB of memory. I was thinking of combining it as a single volume afterwards, but this is not effective anyway.

Instead of converting an actual geometry, is there a procedural way to create these shapes mathematically as volumes, SDF in my case?

Thanks :)

Link to comment
Share on other sites

Do you guys know the best way to represent a sphere as an SDF volume? When I convert a primitive or polygonal sphere, it's not as smooth because of resolution. NURBS seem to give better result at low resolution but seems slower to convert to a volume.

vdbfromparticles seems to be by far the most efficient to do this from my tests. just create a point in the centroid of your sphere, give it pscale to match the sphere's size and feed it into vdbfromparticles. It's very precise and fast as far as I can tell.

  • Like 1
Link to comment
Share on other sites

Thanks Edward, I think I do :) Because I am doing checks to see if points are inside the SDF volume. If the inside is not filled, then I am getting very faint colors that are normally supposed to be full values. So basically my assumption was that if the inside is not filled, then SDF values are not as accurate. But the difference is huge.

Though if the point of VBD SDF is to maintain a narrow band, why does VDB from Polygons have a feature called "Fill Interior"? :) Outside is another deal though. I only need to know if my points are inside.

Link to comment
Share on other sites

Thanks Edward, you explained it perfectly. Sorry I didn't say it but the colors I used were scaled based on distance, so I actually need the distance :)

Do you think in this case standard Houdini SDF is better?

Edited by magneto
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...