Jump to content
Andrea

Assign volume shader at SOP level

Recommended Posts

Hello!

I have created a material using Material Shader Builder with a Volume Core inside. While working on a project I have noticed that if I assign this material at obj level it works, if I assign the same material at Sop level it doesn't.  

It's not the first time that I have this problem but it's never been an issue since now. I really need to assign it at SOP level with some other materials.

 

In the hip I have created two boxes. One box has the material assigned at SOP and the other one at obj level. Any suggestions? Thanks in advance

material builder_test.hip

Share this post


Link to post
Share on other sites

I dont know why, but if you pack the box before applying the material it works.

  • Thanks 1

Share this post


Link to post
Share on other sites

Thank you David, I'll try that tomorrow.

 

 

Share this post


Link to post
Share on other sites

Your shader is getting assigned alright (which you can test by using different shader) but i guess it has something to do with "uniform volume" render property which I guess should not be assigned per primitive but as a whole object in order to determine surface of a volume.

I guess when you pack an object beforehand - you are assigning material to the WHOLE, pack object, not just individual primitives - therefore it may work.

Alternatively, you could add your "uniform volume / volume quality / volume density" render properties separately on the geometry level.

material builder_test2.hip

  • Thanks 2

Share this post


Link to post
Share on other sites

Interesting, thanks Albert. Probably it makes sense that you have to assign the volume shader to the whole geometry being a little bit different from the other components.

 

I did several tests with different shaders and is just with the volume shader that it doesn't work correctly. 

But after all packing or, as you said, add the render properties on the geometry level is really quick to do, so not a big problem if I'll be able to remember in which shaders I have used the volume for refractions 

 

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

×