VDB Combine

The Ultimate Houdini node reference

Visit the Node Bible

To learn more, please log in or sign up for free to explore the Node Bible.
Write your awesome label here.

VDB Combine

Write your awesome label here.
Write your awesome label here.

The VDB Combine allows you to combine vdb fields.  This works on both fog and SDF volumes.

Drag to resize

Summary:

    The VDB Combine will combines both voxel values and fields in which those voxel values belong to.  In addition, you'll need to consider the resolution, background value, and orientation of both vdb fields.  In order for this to work properly, all those things need to match up.  (For more information about background values, please check out the VDB lesson in Houdini For the New Artist II).  Once the background value, orienation, and voxel size line up properly, then the operation can take place.  It's also important to mention that if you're trying to combine SDF volumes, then it's best to use an SDF operation.  Any operation that uses the word, "Activity" is referring to any voxel that is not the background value.  It's referring to the "activated" voxels.

Drag to resize

Main Parameters:


Group A:

--  Groups in the VDB Combine will trip you up if you're not careful.  What the groups do is tell the Collation and Operation parameters what they are allowed to work on.  If you do not specify a field in the group field, then it will pass through this node un-affected.  Groups will not affect the order in which fields are discovered by the VDB combine node.

Group B:


--  Same thing as what was mentioned above with "Group A" except now you're specifying groups for the second input.

Collation:

-- Unfortunately, there is no significant documentation for this parameter, and it can be critical to how this node works.  Based on many tests, this is my interpretation of these parameters.  The Collation will determine which voxels belong to each output vdb field.  By default, "Combine A/B Pairs" is selected.  

--  Combine A/B Pairs =  When the VDB Combine node goes to discover volumes in input A, it will take the first thing it finds and pair it with the first thing it finds in B.  The resulting field will then encompass the combination of the first fields it found.  Once it does that, then it looks for the second field on the A side and pairs that with the second B field it finds.  It continues pairing A and B fields like this until it can no longer do so.

--  Combine Each A with First B =  This will take all fields in input A and merge them with the first field found in input B.  NOTE:  Each time a field from A merges with B, it will create a duplicate of B's values!  You need to be careful about creating duplicate values when selecting this setting.
    Here's an example that will help you understand what this means.  Suppose you have two fields plugged into input A and they're named "foo-A" and "goober-A".  You also have two two fields going into input B, and they're named "density-B" and "fire-B". 
    Now look at the "Combine Each A with First B" parameter name.  "Combine each A" means... take "foo-A" along with "goober-A" and merge them with... "First B" (in other words, the first field you find with B).  In this case, the first field it finds with B is "density-B."  So the resulting volumes would be exported as.... "foo-A" + "density-B" along with "goober-A" + "density-B".  NOTE that the "density-B" fields will be exported twice as a result because there were multiple merge functions happening! 
    Okay, so what if you don't want it to go with "density-B"?  That's the first thing the Collation function found, but suppose you want "fire-B" instead.  That's when you might specify "@name="fire-B" in the Group B field above. That will switch out what is considered to be the "First B" that the Collation function finds.  In practice, I'm not sure which situations may require this, but I'm sure one day I might run into one.

--  Flatten All A =  This will ignore anything you plug into B.  If you have multiple fields plugged into A, then those fields get "flattened" into one field.  The resulting field name will be the first found field in A.  You cannot populate Group A with the desired output field name because it will always just go with the first field the VDB Resample discovers.

--  Flatten All B into First A =  This will take a look at every field that's plugged into B and merge it with the first A field it finds.  If you'd like to change the "First A" found, then type out the field you want B to merge with in the "Group A" parameter.

--  Flatten A Groups =  When specifying groups in the "Group A" parameter, you can flatten fields based on whatever is selected in that parameter.  In practice, I've found this to be buggy because you can't just select multiple groups with the dropdown arrow and have them flatten.  Instead, the only thing that I've gotten to work is by creating a group sop, and using a keyword lookup syntax like *grp* to select corresponding fields to flatten.  In other words, if you had three fields, one had a group sop called "grp001" another had "grp002" and another had "test," then only the groups with the keyword *grp* would be flattened.  

---------------------------------------------------------------
---------------------------------------------------------------


Operation:

--  These settings determine how the voxel values will be altered.  

--  Copy A =  Use A and ignore B

--  Copy B =  Use B and ignore A

--  Invert A =  Use a value of 0 - A.  That means positive values go negative and negative values go positive

--  Add =  Add the voxel values of A and B.

--  Subtract = Subtract the values of B from the values of A

--  Multiply = Multiply the values of A and B.

--  Divide =  Divide the values of A by B.

--  Maximum =  Look at the values in A and look at B.  Then choose the larger value between the two if they overlap.

--  Minimum =   Look at the values in A and look at B. Then choose the smaller value between the two if they overlap.

--  (1-A) * B  =  This is like a "soft cut-out" operation.  Typically, this gets used to clear out an area around characters in a dust simulation.  This typically gets used when working with fog volumes.

--  A + (1-A) * B =  This is similar to SDF Union except for fog volumes. It can also be viewed as a "soft union" or "merge" operation. Consider using this over the Maximum or Add operations for fog volumes.  If you'd like to see the difference between this and a maximum/add operation, then use a volume slice and examine the values.

--  SDF Union =  Generate the union of signed distance fields A and B.

--  SDF Intersection =  Generate the intersection of signed distance fields A and B.

--  SDF Difference =  Remove signed distance field B from signed distance field A.

--  Replace A with Active B =  Copy the active voxels of B into A.  Remember, the word "active" here means voxels that do not belong to the background value.

--  Activity Union =  Make voxels active which are active in both A or B.

--  Activity Intersection =  Each voxel’s active state is set to whether it is active in both A and B. This operation may deactivate voxels so it is recommended to enable pruning when using this.

--  Activity Difference =  Each voxel’s active state is set to on if is active in A but not B. Otherwise, the voxel is made inactive. It is recommended to enable pruning when using this.

A/B Multiplier:

--  This multiplies the values of all A voxels before the operation takes place.

Resample:

--  Above in the summary section, we mentioned that the size of both a and b voxels ought to be the same.  If they are not the same, then the VDB Combine will try to resample them so that they are.  These parameters are asking you how this operation takes place. 

--  Off =  Resampling does not occur.  This is not recommended if both girds do not have matching voxel sizes.

--  B to Match A =  The voxel resolution of B will get resampled to match the voxel size of A

--  A to Match B =  The voxel resolution of A will get resampled to match the voxel size of B

--  Higher-res to Match Lower-res =  The resample will make everything match the higher-res field

--  Lower-res to Match Higher-res =  Same thing, but other way around.

Interpolation:

--  When resampling voxels, it will use a filter to determine the resulting voxel values.  In practice, it's difficult to say which interpolation method works better.  If you're unhappy with how something is re-sampled, then try selecting either quadratic or nearest to see if it makes it better for you.

Deactivate Tolerance:

--  This parameter is designed to clean up the resulting vdb fields by removing active voxels if they get close enough to the background value.  The tolerance is asking you how close a voxel value needs to be to the background value in order to be de-activated.

Prune Tolerance:

--  According to the docs, "After building the VDB grid there may be undetected constant tiles. This tolerance is used to detect constant regions and collapse them. Such areas that are within the background value will also be marked inactive."  It's unclear what "constant tiles" are based off of this description, but I imagine the defaults ought to work fine in most situations.

Signed-Flood-Fill Output SDFs

--  According to the docs, "Tests areas of inactive background values to determine if they are inside or outside of an SDF, and hence whether they should have negative or positive sign."  In practice, I suppose this means that if you're combining SDFs and the background values are strange, then it might be worth seeing if this parameter improves the result.