How to visualise VDB files properly

   Views 9826   Replies 28   Subscribers 2
User Avatar
Member
18 posts
Joined: July 2022
Offline
Hi,

I am a programmer and I need to validate some VDB file I created (I am not an artist and not really familiar with houdini)

I imported the VDB file and then used the VDB Visualize Tree node to see my voxels, but I would like to also be able to read the metadata of the grids and display each group into a different color. Is there a way to do this ?

Thanks
Vincent
Edited by guesdon.vincent - July 22, 2022 10:07:08
User Avatar
Member
18 posts
Joined: July 2022
Offline
I tried to set the Cd attribute on each group but "VDB Visualize Tree" seems to override or ignore it
User Avatar
Member
4808 posts
Joined: Feb. 2012
Offline
Hi,

If you open the geo spreadsheet (RMB on node -> Spreadsheet), you can view the intrinsic attributes that are available. Make sure to be in primitive mode and toggle the intrinsics that you want.

Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
User Avatar
Member
18 posts
Joined: July 2022
Offline
that's great, thanks, now I can read my metadata at least

Image Not Found



and to display my colors as voxels boxes ? I'd like to see each voxels boxes as the proper color (imagine a minecraft world exported into a VDB file and you want to display properly the color of each voxel, they are already grouped properly per material)

see here an example in the game and the VDB created from it (Frustrum extraction)

Image Not Found


at the moment my prototype just put a random color in the Cd attribute, but after that I can't display it in Houdini
Edited by guesdon.vincent - July 25, 2022 14:25:58
User Avatar
Member
18 posts
Joined: July 2022
Offline
still trying, cannot figure out why "VDB Visualise Tree" remove all my colors, I can see the colors are correct when looking at the cloud point but as soon as I try to display the voxels boxes houdini remove all the colors
User Avatar
Member
18 posts
Joined: July 2022
Offline
ok, I am done trying to make VDB visualize tree to work. Can somebody explain to me how to remake something equivalent using maybe box and copy to point ?

I tried to make one but it doesn't display anything
User Avatar
Member
18 posts
Joined: July 2022
Offline
this diagram reproduce exactly the same result as VDB visualize Tree but unfortunately the Cd attribute is lost in the process, is there a way to apply the Cd attribute to each boxes from the metsadata available for each group ?

Attachments:
2022-07-25_9-36-34.png (58.1 KB)

User Avatar
Member
18 posts
Joined: July 2022
Offline
closing this subject, going to work on other thing since this is completely blocked for now
Edited by guesdon.vincent - July 25, 2022 14:34:21
User Avatar
Member
18 posts
Joined: July 2022
Offline
Hi,

I had a little time today to come back to this.

So if I understand correctly my main issue is that the node PointFromVolume is loosing all the Cd attributes from my VDB primitives. So I have my colors fine when rendering the VDB node but after that everything become grey.

I tried to use the AttributeWrangle node to reapply my Cd attribute from my primitive to my points and the result is better (I can see my voxels having different colors) but not that great (clearly not the proper colors from the original VDB.

here the VEX expression I used in the Attribute Wrangle node

int prims[] = primfind(1, @P, @P);

v@Cd = set(0,0,0);
foreach ( int prim; prims )
{
vector ocd = prim(1, "Cd", prim);
v@Cd = ocd;
break;
}

and here my graph



Any idea if there is a better way of doing it ?
Edited by guesdon.vincent - Aug. 4, 2022 15:04:25

Attachments:
2022-08-04_15-02-23.png (30.6 KB)

User Avatar
Staff
420 posts
Joined: Feb. 2008
Offline
Isn't this working out of the box?

Attachments:
tempimg.jpg (460.4 KB)

User Avatar
Member
1828 posts
Joined: May 2006
Online
Not sure I understood your original question, but here's a sample showing how to vis various volume attributes with the vdb tree sop.

Attachments:
vdb_tree_viz.PNG (222.9 KB)
vdb_viz_cd_as_blocks.hip (301.3 KB)

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
Hi,

unfortunately it doesn't work, as soon as I try to render it the color is removed and everything become grey.

on my data I have 16 primitive each of it containing voxels, each primitive represents a specific color with the attribute Cd in the primitive attributes. (I don't have any texture for the moment)

when displaying the VDB only, I can see the color of the primitives are used for the color, but has soon as I try to get a voxel effect (displaying a 0.1 meter box on each point) all the colors are removed (I tried my own graph and VDB vizualize tree both do the same things, when you display the boxes the color are removed

the closest I got from a result was with the VEX expression trying to recover the Cd attribute of the primitive for each point using the attribute Wrangle node (but even this doesn't work very well)
Edited by guesdon.vincent - Aug. 5, 2022 09:50:53
User Avatar
Member
1828 posts
Joined: May 2006
Online
In my setup I found the colours went strange when I added extra volumes. To get around this I cast whatever attributes I needed using a wrangle to @Cd, and then on the vis tree node, forced it to only read the @Cd volume.
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
mestela
In my setup I found the colours went strange when I added extra volumes. To get around this I cast whatever attributes I needed using a wrangle to @Cd, and then on the vis tree node, forced it to only read the @Cd volume.

Sorry I don't understand how to do that, as I mentionned on the first message I am not an artist, I am only a programmer trying to vizualize that the things my code serialized with openvdb is correctly built

I opened houdini for the first time around two weeks ago and used it maybe 4-5 days in my life so I know almost nothing about it

and unfortunately , even so I would love to, I don't have the time to read / watch tutorial or do formation on it (I have my own work to do )

here three different view of my VDB, one is the original file (you can see the colors) second is VDB vizualize tree as points, third is by copying the box on each point

Image Not Found


Image Not Found


Image Not Found
Edited by guesdon.vincent - Aug. 9, 2022 10:30:12
User Avatar
Member
1828 posts
Joined: May 2006
Online
guesdon.vincent
Sorry I don't understand how to do that, as

Its in the example hip in my earlier post.
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
ok I'll look at it again to try to see why I couldn't make it works last friday but it seems to me that the output of VDB from polygon in your example is different from what I have.
Edited by guesdon.vincent - Aug. 8, 2022 09:03:00
User Avatar
Member
18 posts
Joined: July 2022
Offline
sorry but I tried again and still the same issue impossible to get the Cd attribute from my primitive to my points

maybe I am not describing it correctly, but I am not sure how to explain it, I have Cd color in my primitives attributes and these color are lost when using VDB vizualize Tree
Edited by guesdon.vincent - Aug. 8, 2022 09:58:07
User Avatar
Member
349 posts
Joined: Nov. 2013
Offline
Can you post a simple hip file with a reduced dataset? You'd probably get a fix from someone pretty quickly with an example file.
User Avatar
Member
18 posts
Joined: July 2022
Offline
antc
Can you post a simple hip file with a reduced dataset? You'd probably get a fix from someone pretty quickly with an example file.

I am thinking about it, I have to check what exactly I can share on a public forum. I might have to generate a fake VDB without specific data
Edited by guesdon.vincent - Aug. 8, 2022 12:19:40
User Avatar
Member
349 posts
Joined: Nov. 2013
Offline
In the meantime the only thing I can suggest is perhaps post what the info window looks like for your vdb geometry. You can get that by middle clicking on the node itself. It'll detail the available grids which might give a clue. If there's a vec3 grid present called Cd I'd expect matts example file to work but who knows.
  • Quick Links