anderslanglands Posted August 8, 2015 Share Posted August 8, 2015 I'm pretty new to Houdini so please forgive me if there's an obvious solution here. I have a pyro sim (basically just the fireball preset) which I've converted to VDB for rendering. I want to do displacement at render time based on the gradient of the density field to get a sort of normal. To do this I'll need the gradient, then I'll need to expand it into a "shell" around the densities in order that empty voxels can find their way down to density values. How would I go about setting this up (in simple terms please!)? Also it would be nice to be able to find the "valleys" in the sim so I don't displace as much in those areas. Intuitively, I want an "ambient occlusion" value in the cache in order to be able to mask those areas from displacement at render time. Any idea how I'd go about that? Thanks for any pointers! Quote Link to comment Share on other sites More sharing options...
anderslanglands Posted August 8, 2015 Author Share Posted August 8, 2015 OK so I've figured out I can use the VDB Analysis node to generate the gradient from the density primitive, but this replaces my existing density primitive. I want to keep the original density field and add a new primitive called density_gradient. How can I achieve that? I've tried the Volume Merge node but that doesn't seem to do anything Quote Link to comment Share on other sites More sharing options...
fathom Posted August 8, 2015 Share Posted August 8, 2015 you can compute your volume gradient at render time. use an inline vex function and do: $vec = gradient($density); ($vec is your output vector in your inline function, and plug your density into the input) in terms of limiting the scope of your displacement, you can generate a volume in sops to handle that as a multiplier. to get additional fields to mantra, you just merge them in as additional primitives. mantra uses the field names (when they exist) to help it bind to shader parms. so your field called "density" is the thing that feeds the "density" parm in your shader. if you create a new field called "dispMag" (as a float field) you could create a shader parameter called "dispMag" and it'd pick up that field from mantra at render time. Quote Link to comment Share on other sites More sharing options...
anderslanglands Posted August 8, 2015 Author Share Posted August 8, 2015 Thanks! I'm rendering in Arnold so I don't have access to the gradient function (or anything else) in VEX unfortunately. How do I go about merging in additional fields as you mention? I tried the Volume Merge node but it doesn't seem to work. Quote Link to comment Share on other sites More sharing options...
bandini Posted August 8, 2015 Share Posted August 8, 2015 Just use standard merge node, not volume merge node. You can use a primitive sop to control which volume primitives display, so you don't see the gradient field on top of your density field. Quote Link to comment Share on other sites More sharing options...
anderslanglands Posted August 10, 2015 Author Share Posted August 10, 2015 Thanks for your help Adam. Standard Merge node works, and I deleted the duplicate channels with Delete. Quote Link to comment Share on other sites More sharing options...
bandini Posted August 10, 2015 Share Posted August 10, 2015 Hey Anders, I forgot to mention, for the other thing you want, to measure the valleys and peaks, I think you want to use a vdb analysis node to measure the curvature of your density field. Not sure if it is exactly what you are looking for, but should be close. 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.