Jump to content
catchyid

How to convert VDB to Points? OR how to visualize VDB precisely?

Recommended Posts

catchyid    14

Hi,

I am rendering Lava FLIP simulation in an external renderer as VDB. I want to visualize the generated SDF VDB before sending it to the external renderer, meaning: I want to "see" the voxels with zero density that represent the surface, other negative voxels that represent the inside of the fluid and how thick they are (i.e. is it one layer below the surface or two layers, does it go all the way to the inner most of the fluid...), does it generate positive voxels and how many layers? 

I am not sure exactly how to do that? I looked into "Particle Fluid Surface" and it uses "VDB From Particle Fluid" node with "Half-Band Voxel" set to 3, so I am assuming that I have approximately 6 layers of SDF VDB. However, I could not find a way to visualize these layers easily?? ALL what I got is a something that looks like an ISO surface (plz, check attached image)

I am thinking, is there a way to convert each voxel to exactly one point such that it copies the "density" attribute in the voxel? I was able to do something similar by using "Attribute from Volume" node, but it's not accurate because this node requires points cloud to copy attributes to (so multiple points might exist in the same voxel or maybe too many voxels outside the VDB altogether). 

Thanks,

 

 

 

vdb_vis.png

using_attribute_from_volume.png

Share this post


Link to post
Share on other sites
edward    331

VDB Visualize Tree SOP or perhaps Volume Slice SOP depending on what you need.

  • Like 1

Share this post


Link to post
Share on other sites
catchyid    14

Thanks Edward...I've tried both, I don't understand how VDB Visualize Tree works (meaning, I don't understand its parameters, I think I need to understand VDB data structures in order to understand this node!), and Volume Slice SOP definitely helps... However, I was hoping to find a way to query VDB densities, for example : I want a way to query (either visually or in the spread sheet) all voxels with positive densities, negative densities, zero densities, etc...

I could not find a way to do that natively in VDB, so I thought about converting a VDB to points (i.e. sample VDB densities using points), however this is not easy because I want exactly one point per voxel if does exist (i.e. in VDB you might not have voxels since it's sparse) and I don't know how to match the number of the generated points to the number of existing voxels...

Anyways, I don't think there is a direct way to do that.... Once more, thanks for your help :)

 

Share this post


Link to post
Share on other sites
cudarsjanis    31

Volume slice, when you choose method - points, matches the voxel count. and you can check the density value in geometry spreadsheet.

If that is not good enough, you can do that in volume vop. Just add points where you have density. and color the points depending on your density values.

Well as for everything in Houdini, many ways how to achieve it.

 

  • Like 1

Share this post


Link to post
Share on other sites
catchyid    14

Thaaaaaaanks Janis :) I have tested volume slice and it does work exactly like you described. However, when it comes to Volume VOP, I am not sure exactly how to do this test : if density > 0 execute the addpoint command? plz, see attached image where you can see what I have done...

 

Once more thanks for your help :)

 

vop_question.png

vop_question.hip

Share this post


Link to post
Share on other sites
cudarsjanis    31

Unfortunately I can`t upload any photos or .hips at work.

But I`ll try to explain what worked for me.

If you are working with vdbs.

make vdb visualizetree sop. change parameters so you get just points representing the volume.

Than make point sop.

In first input plug in points in second plug in vdb volume.

Inside the vop make volume sample vex node. Connect filename to OpInput2. and pos to sample pos. this node will output density value for each point.

And from here you can do pretty much what ever you need. Bind export density value for each point of just make ramp and output that to Cd.

have fun

Cheers

 

  • Like 1

Share this post


Link to post
Share on other sites
derjcmp    22
19 hours ago, catchyid said:

Thaaaaaaanks Janis :) I have tested volume slice and it does work exactly like you described. However, when it comes to Volume VOP, I am not sure exactly how to do this test : if density > 0 execute the addpoint command? plz, see attached image where you can see what I have done...

 

after the compare you can add a twoWayswitchVOP :)

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×