How to visualise VDB files properly

   Views 9835   Replies 28   Subscribers 2
User Avatar
Member
18 posts
Joined: July 2022
Offline
So I have made a fake VDB file with 3 cubes of 100x100x100 voxels, cubes are each a different color (red, green and blue)

I join the VDB file and a screen shot for the metadata in the spreadsheet (you can see the Cd attribute in the primitives attributes)

(see FakeGeneration.zip at the bottom)



and then the color lost when trying to display the cubes (this is simply VDB visualize tree)

Edited by guesdon.vincent - Aug. 9, 2022 10:32:22

Attachments:
2022-08-09_10-21-47.png (436.8 KB)
2022-08-09_10-26-26.png (890.5 KB)
FakeGeneration.zip (13.8 KB)

User Avatar
Member
349 posts
Joined: Nov. 2013
Offline
Ah so your colors are constant per grid, I see now. I was assuming you actually had a vec3 grid with per voxel colors. So yeah, it looks like there's no way to have visualize tree bind per-grid colors however it's easy enough to reapply the colors to the points following the visualize tree node. Example hip attached.
Edited by antc - Aug. 9, 2022 12:04:02

Attachments:
vdbwithcolors.hipnc (94.6 KB)
screengrab.png (2.0 MB)

User Avatar
Member
18 posts
Joined: July 2022
Offline
I am not sure why, but it doesn't work for me, also the voxels are not the proper size and the density of points seems wrong too.

I didn't change anything, I just opened the file and gave the fakegeneration.vdb file in input

Edited by guesdon.vincent - Aug. 9, 2022 14:57:45

Attachments:
2022-08-09_14-55-39.png (627.1 KB)

User Avatar
Member
349 posts
Joined: Nov. 2013
Offline
Sorry minor error on my part I added points to active tiles by mistake. I've corrected that to active voxels and so the voxel size is correct now.

I'm not sure why the color isn't coming through. I'm guessing the Cd reattachment in attribwrangle1 isn't working. What version of houdini are you using?
Edited by antc - Aug. 9, 2022 18:06:43

Attachments:
vdbwithcolors.hipnc (94.6 KB)

User Avatar
Member
1828 posts
Joined: May 2006
Online
Nice solution antc!

I'd also point out that I've never seen vdb's used in this way. Not that I'm hugely experienced in the world of vdb apart from the few places I've worked, but that might explain why vdb vis tree isn't working as you expect. AFAIK its rare to set attributes at the prim level for vdb's.
http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
18 posts
Joined: July 2022
Offline
I am using Houdini FX 19.0

I organized my VDB this way cause I thought that would be more efficient in terme of data size to do that instead of duplicating my metadata per point since all my points share the same metadata on each primitive.

I still cannot see the colors, my cubes are red I might have to rethink the way my colors are setup, should I set the color attribute on each point instead of by primitive ? in C++ with openvdb I found how to setup metadata on grids but I didn't see how to setup metadata on each points
Edited by guesdon.vincent - Aug. 10, 2022 10:32:49
User Avatar
Member
18 posts
Joined: July 2022
Offline
I am trying to see if I can serialize my VDB file differently, but apparently using Vec3i for the voxel value couldn<t be read by VDB Visualize tree.

still searching.
User Avatar
Member
349 posts
Joined: Nov. 2013
Offline
Matt’s example file from a few posts back shows how to get colors when there’s a vec3 color grid
User Avatar
Member
18 posts
Joined: July 2022
Offline
Hello,

I manage to get my colors by actually putting the index of the primitive in the value of my voxel (not ideal but it worked) then with the attribute wrangle node I just did

v@Cd = prim(1, "Cd", i@vdb_int - 1);

that prevent me from putting another information in the value of the voxels but that will be enough for my needs for the moment

Thanks a lot to everyone for helping me.

Vincent
  • Quick Links