Jump to content

"Sample vector from volume" setup in shader - question


Recommended Posts

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

Link to comment
Share on other sites

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!

post-6719-0-31849000-1379603253_thumb.jp

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by Pazuzu
Link to comment
Share on other sites

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.

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.

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