Set voxel color in volume wrangle

   8541   2   0
User Avatar
Member
4 posts
Joined: 7月 2017
Offline
I have a connected the following nodes:
volume > volumewrangle > convertvolume > color
So I'm running a VEX snippet in the wrangle that defines the density for each voxel. Everything works fine there. What I want to do now, is also setting the color for each voxel on the same condition that is used for determining the density in the VEX snippet or at least store the RGB values somewhere, so that I can use them after converting it to polygons.

I've tried kinda the same (but modified for 2D) VEX snippet on a pointwrangle and it works out just fine with the color. There I've connected: grid > pointwrangle > color
Of course I don't need to change density here, only the color that is applied on the points. It also makes sense that it works here, because I can see all attributes listed in the Geometry spreadsheet for every point, while looking at the spreadsheet for the volumewrangle I only see 1 attribute density or 3 density values if I change the volume rank from scalar to vector, but just not the whole range for every individual voxel.

I've also tried to create an additional attribute between volume and volumewrangle and then just store the values in it for later use, but I somehow cannot access my own created attribute in the snippet with @. Maybe that is not possible.

Is there a way to color voxels in a volume with a volumewrangle?

Thanks!
User Avatar
Member
101 posts
Joined: 2月 2015
Offline
Hi,
you need to create a vector volume along side you density volume.
That's the trick with volumes, you don't add attributes to them, they kind of are the attributes themselves.
After setting the color values , you can visualize them with a volumevisualization sop.

Attachments:
volume_color_test.hiplc (99.8 KB)

https://vimeo.com/user43710534 [vimeo.com]
User Avatar
Member
4 posts
Joined: 7月 2017
Offline
gui2one
Hi,
you need to create a vector volume along side you density volume.
That's the trick with volumes, you don't add attributes to them, they kind of are the attributes themselves.
After setting the color values , you can visualize them with a volumevisualization sop.

Thank you, this helps me a lot already!

Now, how can I change those colors with a volume wrangle. My problem now is when I set a volume wrangle node before the volume vop, all changes on the values for density/color that had been done using the wrangle are gone. So I'm setting density values of 1 or 0 with the help of my VEX snippet in the volume wrangle and all works fine, but after connecting to the volume vop all values are set to 1 again. Even though the density is connected to the output density, so it should be the same I thought.

Also afterwards I would want to convert it either to a VDB or a polygonal surface and keep the colors for each point on the surface. Is that even possible? What I'm basically trying to do is to have the setup from the Entagma Mandelbulb Tutorial https://vimeo.com/176911687 [vimeo.com] and color the object within the VEX snippet in the wrangle.
  • Quick Links