Jump to content
Sign in to follow this  
jon3de

relbbox in surface context

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

 

Share this post


Link to post
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

Share this post


Link to post
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 ?

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×