SaleVonGeist Posted September 19, 2013 Share Posted September 19, 2013 Hi all! I am having trouble with setting up displacement in shader from "restdisplace" volume (from ocean evaluate node in this case). When I try to do it in VOPSOP with "sample vector from volume" it works as expected, but I have no success when I try to replicate it in shader context. The reason I would like to do displacement in shader is to get fine details at render time, without having heavy geometry. I tested the same setup in shader with simple 3D turbulent noise, and it works fine. Also one quick side question, is there a way to "inspect" node output values (in shader context), to see if it is indeed outputing anything, becuase I suspect that maybe I'm not getting anything from "sample vector from volume" node. In VOPSOP I know I can check it out by creating new attribute and read out values from details view, but I don't know how to aproach this in shader context. I provided simple test scene, so if anyone could take a quick look and tell me what am I doing wrong it would be much apreciated! Thanks in advance! Cheers, Sasa SampleVectorFromVolume_in_shader.hip Quote Link to comment Share on other sites More sharing options...
mawi Posted September 19, 2013 Share Posted September 19, 2013 Cant look at your file, but have you transformed P from cameraspace to worldspace before sampling the volume? Quote Link to comment Share on other sites More sharing options...
SaleVonGeist Posted September 19, 2013 Author Share Posted September 19, 2013 Hi Martin and thanks for the reply! Yes, I have tried transforming P from "current to object" at first, and now I tried your suggestion " cameraspace to worldspace" but with no effect, but I'm not sure if I am connecting it at the right place in the network. Since you can't look at the file, here is screen grab. Thanks for your time and effort! Quote Link to comment Share on other sites More sharing options...
rafaelfs Posted September 19, 2013 Share Posted September 19, 2013 Hi Martin and thanks for the reply! Yes, I have tried transforming P from "current to object" at first, and now I tried your suggestion " cameraspace to worldspace" but with no effect, but I'm not sure if I am connecting it at the right place in the network. Since you can't look at the file, here is screen grab. In my mind it would make more sense to transform after sampling... Cheers Quote Link to comment Share on other sites More sharing options...
SaleVonGeist Posted September 19, 2013 Author Share Posted September 19, 2013 Hi Rafael! I just tried your suggestion, but I just get whole plane shifted in space. Have you had a chance to look at my file maybe? Thanks again, I really appreciate help on this one! Quote Link to comment Share on other sites More sharing options...
Pazuzu Posted September 19, 2013 Share Posted September 19, 2013 (edited) You need to sample the volume vector field also with the P transform in object or world space, and it works!!! The problem with this technique is that you loose the filtering from the texture method but if you convert the field to a 3dtexture you can have access to filtering also; Another issue is storage, the texture method is way more efficient. SampleVectorFromVolume_in_shader.hip Edited September 19, 2013 by Pazuzu Quote Link to comment Share on other sites More sharing options...
SaleVonGeist Posted September 19, 2013 Author Share Posted September 19, 2013 Woooohoooo...thank you very much Alejandro!!! One more question though, it works great if I bake and load saved bgeo's in "volume sample vector" node, but when I try with op:/obj/grid_displace/oceanevaluate1 it doesn't work. Does that mean that I have to write out volume to disk, or am I just missing something with op: command. Quote Link to comment Share on other sites More sharing options...
Pazuzu Posted September 19, 2013 Share Posted September 19, 2013 The op: function only works inside Houdini, with Mantra you need to specify the file on disk. Quote Link to comment Share on other sites More sharing options...
SaleVonGeist Posted September 19, 2013 Author Share Posted September 19, 2013 Oh, I see...thanks for clarifying that, and thank you once again for your help! Cheers 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.