TheDude123 Posted May 20, 2022 Share Posted May 20, 2022 (edited) Hi, 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... Thanks! Edited May 20, 2022 by TheDude123 Quote Link to comment Share on other sites More sharing options...
Librarian Posted May 20, 2022 Share Posted May 20, 2022 link linkk maybe it helps Quote Link to comment Share on other sites More sharing options...
TheDude123 Posted May 20, 2022 Author Share Posted May 20, 2022 (edited) 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. Thanks. density_box_fade.hiplc Edited May 20, 2022 by TheDude123 Quote Link to comment Share on other sites More sharing options...
Atom Posted May 20, 2022 Share Posted May 20, 2022 Maybe check out the volumefeather node..? 2 Quote Link to comment Share on other sites More sharing options...
doc Posted May 21, 2022 Share Posted May 21, 2022 Very close to getting it working, but in my test I'm getting a weird wedge of high density. Maybe somebody smarter can tell me what I missed? volume_fall_off_test_v1.hip 1 Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted May 21, 2022 Share Posted May 21, 2022 You could remap a signed-distance field. f@density = fit(f@density, 0.0, -0.2, 0.0, 1.0); f@density = chramp('density', f@density); volume_fall_off_test_km.hipnc Quote Link to comment Share on other sites More sharing options...
Librarian Posted May 21, 2022 Share Posted May 21, 2022 (edited) @doc hm exact what i need ...but how to solve that wedge hm ..endless sacred patterns Thanx Edited May 21, 2022 by Librarian Quote Link to comment Share on other sites More sharing options...
doc Posted May 21, 2022 Share Posted May 21, 2022 (edited) 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 May 21, 2022 by doc Quote Link to comment Share on other sites More sharing options...
Aizatulin Posted May 22, 2022 Share Posted May 22, 2022 Hi doc, in your wrangle write test >= 0, because 0 is also a valid primitive number. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.