Jump to content

Volume density based on point position and/or depth

Recommended Posts


I'm trying to figure out how to decrease a volume's density based on some value (say a point's position in space).

Say you have a sphere converted into a volume and a point at the center of that volume.

How do you go about calculating the volume's distance from that point and modifying the density based on that?

I would like the density to decrease the closer it is to the point.

I've tried volumesample(), volume gradient VOP node, and a few others...but I'm missing something.

Either VEX or VOP solution is fine.

Density decreases closer to the center...



Edited by TheDude123
Link to comment
Share on other sites

Thanks for the links. After some testing, they work, but the falloff created is not linear (for the shape I'm using).

I would like the density to be highest on the outside of the box shape and fade towards the "center". What I'm currently getting is: dense, less dense, than dense again (see image). RED text from 0-1 is what I would like.

See .hip file and image below.




Edited by TheDude123
Link to comment
Share on other sites

I noticed that increasing the resolution of the sphere seems to make the problem go away, but I'm not sure why that would make a difference

Edited by doc
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.

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...