Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Sign in to follow this  
Followers 0
jon3de

relbbox in surface context

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

1 person likes this

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  
Followers 0