How to Convert Points "Directly" to VDBs?

   2956   6   1
User Avatar
Member
132 posts
Joined: Aug. 2014
Offline
I have scientific data that was originally in VTK unstructured grid format.
https://vtk.org/doc/nightly/html/classvtkUnstructuredGrid.html [vtk.org]
https://vtk.org/ [vtk.org]

I figured out how to export to a Houdini point cloud with attributes using Paraview.
https://www.paraview.org/ [www.paraview.org]

I want to convert the points and their attributes into VDBs.
However, when I try to use VDBfromParticles:
https://www.sidefx.com/docs/houdini/nodes/sop/vdbfromparticles.html [www.sidefx.com]

...it introduces artifacts into the resulting VDBs.
This is because it is converting the points to VDB spheres, based on pscale, then combining them.
Which results in rounded artifacts at the boundaries.
The Half-Band Voxels default introduces another layer of artifacts surrounding the VDBs.

Please find attached a screen grab of a simplified example.
I am creating a grid of points, 1 unit apart.
A pscale attribute with a value of 1 for each point is added, and a density attribute of 0.05.
This is converted to VDBs with vdbfromparticles.
You can see the artifacts I'm referring to.

Is there a way to convert equally spaced points "directly" to VDBs?
i.e. a 1-to-1 correspondence of each point to a VDB voxel.
Each voxel is filled with the attritube(s) from the corresponding point.

i.e. I want "aliased" VDBs. Not anti-aliased VDBs.

Is there a way to do this? If not with Houdini nodes, then perhaps with python from within Houdini?

A tangentially related question is; what are VDB points and what are they used for?
This SOP converts a point cloud into VDB points.

https://www.sidefx.com/docs/houdini/nodes/sop/convertvdbpoints.html [www.sidefx.com]

But I can't find any examples or tutorials that explain what they can be used for.
Only this openVDB documentation:
https://www.openvdb.org/documentation/doxygen/points.html [www.openvdb.org]
Which is at a low engineering level, without digital artist-friendly examples.

Any assistance with the larger question ("aliased" VDBs from evenly spaced points) would be much appreciated.
Sincerely.
Edited by jlapre - July 18, 2022 00:24:48

Attachments:
Screen Shot 2022-07-17 at 9.06.53 PM.png (4.7 MB)

Jeroen
User Avatar
Member
2537 posts
Joined: June 2008
Offline
If you just want square voxels, copy a box to the points and use vdbfrompolygons instead of vdbfromparticles.

Attachments:
volume_attribute.gif (69.6 KB)

Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
8555 posts
Joined: July 2007
Offline
if your points are really spaced out evenly that they align with certain grid you can do one of following

- create a volume with size and resolution that exactly aligns with your points ad use Volume From Attribute to fill the voxels with desired values from points

or to be more efficient with huge volumes:

- create empty VDB volume with voxel size and alignment for one of your points and then use Volume Rasterize (or alo try Volume Rasterize Points/Particles)

- you could also try Volume Rasterize Attributes, but then you don't have a control over the voxel alignment so may not be a useful, however its a wrapper around Volume Rasterize Particles so you can break in and adjust if needed
Edited by tamte - July 18, 2022 11:21:14
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
7771 posts
Joined: Sept. 2011
Offline
tamte
- create empty VDB volume with voxel size and alignment for one of your points and then use Volume Rasterize (or alo try Volume Rasterize Points/Particles)

- you could also try Volume Rasterize Attributes, but then you don't have a control over the voxel alignment so may not be a useful, however its a wrapper around Volume Rasterize Particles so you can break in and adjust if needed

Volume rasterize particles has a point filter mode, which if the points are perfectly aligned to voxel centers should only sample the particle as the center of the voxel.
User Avatar
Member
132 posts
Joined: Aug. 2014
Offline
Thanks for all the suggestions.
I'm going to try tamte/jsmack's suggestions of empty VDB volume and Volume Rasterize points/Volume Rasterize particles.

Instancing boxes won't work as these are very large datasets.
Edited by jlapre - July 19, 2022 00:49:24
Jeroen
User Avatar
Member
132 posts
Joined: Aug. 2014
Offline
So far, I have found the VolumeRasterizeAttribe to be the most promising way to convert points to VDBs one-to-one.
Please find attached a simplified hip file.
I created a box with axis divisions of 4x4, and applied density and color ramps.
Could someone check to see if I'm doing this correctly, and how you would implement the other suggested methods.
Thanks

Attachments:
Screen Shot 2022-07-19 at 9.22.03 AM.png (1.3 MB)
Screen Shot 2022-07-19 at 9.22.09 AM.png (667.0 KB)
Screen Shot 2022-07-19 at 9.22.25 AM.png (2.5 MB)
PointsWithAtts_to_VDBs.004.hiplc (319.6 KB)

Jeroen
User Avatar
Member
132 posts
Joined: Aug. 2014
Offline
I tried using volumerasterizeattribe on a pointcloud derived from a VTK unstructured grid via Paraview.
Please refer to 2 test renders.
When the scale of the points are relatively small (x100) then the detail looks nice and continuous, but it's not the VDB resolution I want. So I tried scaling the source points up to x200. However, I'm now seeing the gaps between the points.
There is a happy medium somewhere in between, but it's not the high resolution VDB I want.
I have included a sample data subset point cloud, in case someone can show me how to get a one-point-per-voxel mapping without artifacts.

An alternative approach that was suggested was to convert the unstructured grid to Houdini's native tet mesh format, and then sample that directly rather than a point cloud proxy, using a VDB as just a dummy mask to call your VEX functions in a volume context.

Apparently I can use "xyzdist" and "primuv" VEX functions to sample tet meshes the same way you can sample any geometry with implicit UVs.

Can someone point me to an example of how to do this?
Thanks

Attachments:
VolumeRasterize_Scale100.png (1.5 MB)
VolumeRasterize_Scale200.png (985.4 KB)
subsetPointCloudFromVTKunstructuredGrid.bgeo.sc (1.8 MB)

Jeroen
  • Quick Links