Jump to content

Converting Volume gradient to color


Recommended Posts

Hi!  This is my first post so I might screw up some terms etc.  I'm a Senior Technical Artist at Ubisoft Singapore, I know 3DS Max like it's an extra appendage, getting into Houdini at the moment and finding a few road blocks.

 

So my end game here is to render out slices of a volume cloud to reconstruct them in a shader (like an old school fur shader) but I want to render out the normals of the clouds into RGB and the density into Alpha of the textures.

 

I've managed to create the cloud volume I want with a Volume Vop, but I can't work out how to adjust each point's colour value inside a Volume Vop.  I understand the Principe of Attributes but I'm still working out exactly where and when to use them.  I needed to write my own Cloud generator since i needed looping (tileable) noise and also give it a gradient.

 

These are the two ways I can see to do this, but can't quite work each one out:

 

 

1. Use the Volume Analysis SOP to create volume Gradient data and then take slices of the new volume.  How do I map the Gradient data generated by Volume Analysis to something that can be rendered using a Volume Slice node?

 

2. I've found the Volume Gradient VOP, can I use this to generate Gradient data and assign it to an attribute for later rendering?

 

Thanks!

 

Geordie

Clouds2.hip

Edited by GeordieM
Link to comment
Share on other sites

Volumes don't have attributes as such, the voxel data is your attribute.

So you have the gradient, just pipe that into the colour of your shader, or a volumeVisualizationSop.

Grad.x.y.z = color.r.g.b etc... No difference, the data is the same, it already is colour, you just haven't told it that it is...

Link to comment
Share on other sites

Thanks for your reply Christian!

 

This is where I'm having trouble, where exactly do I access the colour?  Do i need to set the colour in the SOP first and then just sample colour in the shader?  Or do I sample the Gradient directly in the Shader?  So the Volume Analysis node has an output of 3 volume primitives which I assume are the 3 components of the gradient vector.  Do I need to convert that into an attribute?

 

Thanks!

 

Geordie

Link to comment
Share on other sites

You can consider it already an attribute. Attributes in the way you're thinking about them doesn't really exist.

So you have a density volume made up of voxels, eat voxel stores a float number, that's considered your attribute. So the field name is your attribute name and the voxel value is the attribute value...

In short, just stick the gradient name into the diffuse field of a volumevis node and play with the values to get an idea. Then the same thing with shaders once you've got it.

Link to comment
Share on other sites

Thanks again for your help!  I got it all working.  The key was thinking of volumes AS the data, not something you put data on.  I've still got some work to do on the final output colour values and the texture tiling but the mechanics are working.

 

I would attach a hip file if I could work out how to do it on a reply  <_<

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...