create VDB that matches topology/resolution of existing VDB

   3821   2   0
User Avatar
Member
92 posts
Joined: 8月 2010
Offline
I received a question I though others might be interested in: “How do I create a new VDB that matches the topology and resolution of an existing VDB grid”?

It's not straightforward to do this today, but it is possible (we have plans to make this easier in the future). I often find myself needing this in order to build topology for volume wrangles (which only iterate over existing active voxels).

In any case, check out the attached HIP. Create an empty grid via VDB create and specify the name/type/etc. Connect this grid and your reference grid to a VDB combine. The operation “activity union” matches the topology of the empty grid A to the existing grid B.

If you want to match the resolution, choose resample “A to match B”, which uses the voxel size of the existing grid B.

If instead, you want the topology of B, but at a different resolution, you would set this to “B to match A” and then set the voxel size in the VDB create.

You now have active topology to iterate over in a wrangle, etc.

I hope that helps!
-jeff

Attachments:
match_vdb_topology.hip (84.5 KB)
match_vdb_topology.jpg (142.5 KB)

User Avatar
Member
4523 posts
Joined: 2月 2012
Offline
Thanks a lot Jeff, we needed this so many times, I created an RFE for it. I made my own Volume Create SOP where doing this for standard Houdini volumes using Python was super fast, but the VDB method was taking a long time to achieve this.

I will update to use your method for the VDB branch.

Looking forward to the new node you are planning. Hope SESI adds this to H16 in time, because it's a massive helper.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
User Avatar
Member
76 posts
Joined: 9月 2011
Online
Isn't this what vdbactivate is for?

Using it with the value box turned off and in reference mode with activate using vdb's enabled, I was able to get it to produce the same results and slightly faster. If you want the new grid to inherit the transforms/cell size of the reference, you can plug the input of the empty_v_grid node into an output of the reference vdb.

I've tried to attach my findings

off topic:
It would be very useful if we could get some of the newer vdb nodes in houdini like advecting scalar fields or removing divergence from vector fields.

Attachments:
match_vdb_topology_vdbactivate.hip (86.8 KB)

  • Quick Links