Doum Posted September 2, 2015 Share Posted September 2, 2015 hello, I'm sure it have been talk several time, but I'm not able to find the thread where it is mention. I'm trying to displace volume at rendertime using a volume gradient already created in sop. I've create the setup in a volume Vop and it works, but I have some problem to get my volume gradient in shop. the SOP setup work like this, I add to P my gradient using a volume sample vector from file and plug this result in a volume sample to displace my density. Now in Shop, I get P with a global variable - transform P from camera to world and use the volumesample vector from file ( like in SOP), my volume is cached on disk, I add it to P not transform. And output this new P. It displace my volume, but not in the right direction Here is the vop net I'm trying to recreate in Shop. Someone can give me some hint how to get my gradient to work properly in Shop? Thanks Quote Link to comment Share on other sites More sharing options...
fathom Posted September 2, 2015 Share Posted September 2, 2015 you need to use inline code, i believe. http://www.sidefx.com/docs/houdini14.0/vex/functions/gradient pass it your density and it'll give you the gradient. Quote Link to comment Share on other sites More sharing options...
Doum Posted September 2, 2015 Author Share Posted September 2, 2015 Thanks fathom, I read your reply in this post. I tried it and it didn't works, probably my fault. to create my gradient in sop the volume needs to be an sdf and the density field is a fog volume, that why I though it wasn't working in shop... Quote Link to comment Share on other sites More sharing options...
jkunz07 Posted September 2, 2015 Share Posted September 2, 2015 If you post your file I'm sure it will be much easier to help. Quote Link to comment Share on other sites More sharing options...
Doum Posted September 3, 2015 Author Share Posted September 3, 2015 yep I will try, but my scn file is at work, i I will try to post it tomorrow, I hope it is possible to send file from our network Thanks guys! Quote Link to comment Share on other sites More sharing options...
SSFX Posted September 3, 2015 Share Posted September 3, 2015 Hi Doum! If you are doing stuff in sop you might consider computing your gradient field at sop level, so it can be passed to shop later. I had the same offset you're having trying to use the displace node, don't really know where that offset come from. It doesn't seems to be spaces related. With volume I tend to use the pyroDisplace node that works fairly well for this kind of task. You can wire in your gradient field and something to drive the amount of displacement and your're good to go. Here's a working file so it's a little clearer. Alex volumeDisplaceAlongGradient_v001.hipnc 1 Quote Link to comment Share on other sites More sharing options...
Doum Posted September 3, 2015 Author Share Posted September 3, 2015 Hey alex, Thanks for sharing , I also tried the pyro displace, here my scn file with the pyro displace and the volume vop displace using a gradient create with an SDF. Alex make me realize that maybe the problem come from the fill interior check box when I create the SDF volume_displace_SOP_vs_SHOP.hipnc.tar.gz Quote Link to comment Share on other sites More sharing options...
fathom Posted September 3, 2015 Share Posted September 3, 2015 Thanks fathom, I read your reply in this post. I tried it and it didn't works, probably my fault. to create my gradient in sop the volume needs to be an sdf and the density field is a fog volume, that why I though it wasn't working in shop... density should be fine. this is not the same as a sop gradient calculation. try that simple shader in the gradient docs. Quote Link to comment Share on other sites More sharing options...
jkunz07 Posted September 3, 2015 Share Posted September 3, 2015 Here is a version similar to the sop setup you posted a screenshot of. You'll have to write the density to disk, but the gradient can be calculated at rendertime. volumeDisplaceSHOP_v001.hipnc 1 Quote Link to comment Share on other sites More sharing options...
Doum Posted September 3, 2015 Author Share Posted September 3, 2015 thanks John, Problem solved . I tried something similar, but I was still using it inside the displace shop node. resampling the density in a new position work as it work in SOP, logic. By the way, using this method will not divide the volume and add more detail at render time? Thanks again Quote Link to comment Share on other sites More sharing options...
SSFX Posted September 3, 2015 Share Posted September 3, 2015 So, I realized the solution I posted before wasn't really working. There was indeed a space issue... as usual. So I added a transform to get from world to camera, since I am using a sop vector field (world space) that needs to be used in shop (camera space). Now it works, without deformation weirdness using the pyro displace node. With this setup you don't need to write anything to disk, it might be useful in some situation. volumeDisplaceAlongGradient_v002.hipnc Quote Link to comment Share on other sites More sharing options...
jkunz07 Posted September 3, 2015 Share Posted September 3, 2015 thanks John, Problem solved . I tried something similar, but I was still using it inside the displace shop node. resampling the density in a new position work as it work in SOP, logic. By the way, using this method will not divide the volume and add more detail at render time? Thanks again The detail added at rendertime is independent of the SOP volume resolution. It is determined by the volume quality parameter on the mantra node. Quote Link to comment Share on other sites More sharing options...
fathom Posted September 3, 2015 Share Posted September 3, 2015 i can't upload from work, but i can explain how to take jkunz's file and use a computed gradient. in the shader, add a parm called "density". this plugs into the volumemodel node, replacing the filevolume sample. add an inline vop. add a single output called "g" as a vector. set the code to be "$g = gradient($density);" and plug the density parm into it. take the output and plug it into a normalize. plug that normalize into the "nN" of a displace along normal. take the "fit1" output and plug that into the "amount" on your displace vop. turn on "object space" on your displace along normal. add an output variables node and select "displacement". plug your output of your displacement node into the output vop. plug your output vop into the collect. now render the torus at the vdbfrompolygons1 node. 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.