Jump to content

How to create a VDB SDF volume?


magneto

Recommended Posts

Thanks Edward, that's a good point, I will test both versions then. Though when I did a quick compare yesterday, I found that it was easier for me to get good accuracy on distance using VDBs than standard volumes where I had to really increase the Max Axis parameter and the volume got much dense. Is this normal?

I will do a more detailed test and post my results :)

Link to comment
Share on other sites

Thanks Edward, yeah I am comparing those. I just did a test and you are right. They seem to give similar results. I just thought standard SDF volumes also had voxels outside the sphere within the bounding box of the sphere, while VDB SDFs didn't have any voxels for these areas. I set the exterior band voxels to 1 since it doesn't allow 0.

But now what I also found is standard SDFs are able to create a much smoother sphere from a primitive sphere, while VDB SDFs create a volume where the sides are angular, so the sphere volume is not very smooth using the same number of voxels.

It seems to automatically convert the geometry to triangles. Do you know what would be the best way to get a perfectly smooth sphere from VDBs? NURBS seem better than primitives but maybe there is a more direct way to do this? Of course creating a heavy geometry also takes time cooking wise, so it would be nice if VDBs could create a perfect sphere from a primitive sphere just like standard volumes, as much as the voxel resolution allows.

I assume standard volumes recognize these shapes and create a mathematical volume based on the shape rather than converting to triangles?

Edited by magneto
Link to comment
Share on other sites

Thanks Solitude. Do you know how to create a volume sphere using VOPs/VEX? I just tried but I see nothing in the viewport. Slicing the volume shows values fine though. I don't know if this is a display issue or I am doing it wrong?

I compared particle VDB to using metaballs on points and then VDB from Polygons, and VDB from Polygons was much faster. So the particle method is not as effective as I expected.

Link to comment
Share on other sites

VDB From Polygons will convert non-polygon geometry to polygons first, before generating the volume. The "angular" look you're seeing it probably due to a not high enough default LOD used when converting the primitive sphere to polygons. If you want a more "perfect" sphere, then create a polygon sphere, and up the resolution on it before feeding to VDB From Polygons.

Instead of VDB From Particles, there is Volume Rasterize Particles and Volume Rasterize Points.I haven't used these before though so YMMV.

All this talk about a sphere is kind of silly though because the most efficient way to deal with a sphere to treat it like a sphere instead of something else. :)

  • Like 1
Link to comment
Share on other sites

Thanks Edward. Can you also confirm that standard Houdini volumes know if you are for example using a primitive sphere, and therefore instead of rasterizing from polygonal geometry of a sphere, it creates the volume mathematically? Not sure if that makes sense.

Increasing the resolution works fine, but the problem is when I copy these higher-res spheres onto points, then it takes a lot of time just to copy and then convert to volumes.

I agree with you about treating spheres like spheres but I am trying to find an efficient way to check if points of a geometry are within the radius of other points, and if so how far to the closest point :)

That's why I wanted to use SDF volumes, because then I only have to loop through the points once to get the result, instead of once per point in your primary group of points.

Is this a good idea? If not, can you please tell me a more efficient way? :)

Link to comment
Share on other sites

Thanks Edward. Can you also confirm that standard Houdini volumes know if you are for example using a primitive sphere, and therefore instead of rasterizing from polygonal geometry of a sphere, it creates the volume mathematically? Not sure if that makes sense.

From what you see, I'd be almost certain of it.

I agree with you about treating spheres like spheres but I am trying to find an efficient way to check if points of a geometry are within the radius of other points, and if so how far to the closest point :)

Do you have varying radii? If not, you could consider generating a single VDB sphere and then using Volume Stamp.

Link to comment
Share on other sites

Thanks Edward, no the radius is fixed all for points. I only tried turning the copied geometry (spheres) into an SDF volume of both types (VDB and standard) and copying a single sphere SDF volume of both kinds onto the points using the Copy SOP. I also tried VDB from particles.

Is Volume Stamp more efficient than Copy SOP in terms of copying volumes? I will try this today :)

I think it would also make a good RFE to have the same code for VDBs to preserve quadric primitive shapes.

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