Jump to content

relbbox in surface context


jon3de

Recommended Posts

hi,

I try to work with the relbbox node in a shader just like in sops but it doesnt give me the desired results. The picture below shows my network in the shader which I thought should give me a gradiant from bottom to the top of the box. But it looks like that I´m missing something.

I read that P in shading context is P in camera space. But converting it from cam to obj space also didn´t change anything. I would be thankfull for some help here. 

relBboxQuestion.jpg

 

Link to comment
Share on other sites

relbbox() requires geometry file to work on, it will not pick up geometry that's being shaded, so if your object is delay loaded, you can promote file input to the shader and put the same geometry file in there, if not, you'll have to export geometry to the file to reference in the shader

or you can pre-compute relbbox as an attribute in SOPs and bind that in the shader

  • Like 1
Link to comment
Share on other sites

Ah thank you Tomas,

I came to this situation while working with alembic caches so the pre compute in SOPs workflow is no option.

I saved my test cube out and used the file for the relbbox node. That worked. So i think I can also refer to some alemic cache instead and this solves my problem.

May I ask you if this is the normal way of doing such things like gradiant in one axis etc. Im asking myself why does the Shader is not able to look up the dimensions of a cube in the scene but from a file on disk ?

 

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