VDB SDF Volume Visualise Mask

   1075   4   2
User Avatar
Member
7 posts
Joined: Jan. 2019
Offline
Hi guys,

I'm looking to do a lot of masking on some SDFs. I was curious about whether I could get the mask to be visualized in a nice obvious red colour similar to a mask on a heightfield.

I've attached a hip file where I make a mask field using the dot product of a 'surface_gradient' field and an arbitrary target vector.
I merge it with the original 'surface' sdf and later use it for displacement.
Just before this, I try to visualize it in red in a way that mimics the Volume Visualization Node in the Heightfield SOP. But it doesn't seem to work...

What am I doing wrong here? Surely this isn't a functionality limited exclusively to heightfields?

Many thanks,
A
Edited by adamwlou - Aug. 5, 2024 12:18:49

Attachments:
Screenshot 2024-08-05 171054.png (1.8 MB)
sdf_mask_v002.hiplc (278.6 KB)

User Avatar
Member
247 posts
Joined: May 2017
Offline
Hi, if you intend only to colorize the volume mask, you could try set density and diffuse field both to mask. Or use a detail geo wrangle after the merge set this detail attribute
v@volvis_ambientexposed = set(1, 0, 0);
for volume color. You can check all detail attributes for volume shading in the geo spreadsheet of the volume visualization node.

If you like to have it same as the heightfield, then you have to convert the final sdf to the surface geometry and then transfer the volume mask (some attribute) to the surface - so the sdf itself cant show color, at least I dont know how. And the heightfield representation is actually geometry, not sdf. But I dont know how it is handled.
User Avatar
Member
247 posts
Joined: May 2017
Offline
Here is an example hip:
Image Not Found

Attachments:
sdf_mask_v002-volume_viz.hiplc (289.2 KB)

User Avatar
Member
7 posts
Joined: Jan. 2019
Offline
Got it - thanks for your response. I hadn't even noticed that the HeightField was being displayed as geometry. I suppose that's how I got so confused.

I think I'll move forward with your heightfield-like vis technique.

Thank you!
User Avatar
Member
247 posts
Joined: May 2017
Offline
adamwlou
I hadn't even noticed that the HeightField was being displayed as geometry. I suppose that's how I got so confused.
Yes and it seems to be packed geometry, but if you try to set the display attribute for wireframe (@gl_wireframe = 1) it disapears this not true for packed geo. So I think it is handled internally somehow.
  • Quick Links