Jump to content

varying shader values on instances


Recommended Posts

So, I have this project where I am rendering thousands of instances, and need to set the base color on a couple of shaders using the Cd from the source points. The basic idea is a field of small containers, where the contents and the label need the same color, but require different shaders. The instance object is actually a few objects merged together, each with a different shader. I want the instances to inherit the color from the point, and drive the diffuse color of the shaders. I have experimented with many variations on the shader assignments, both at the SOP and object level.

1. I tried naming the 'Cd' attrib to 'baseColor' (I am using the Mantra Surface Material) for example, and no luck.

2. I tried using material SOP to override the base color of the label shader, but that only let me assign that one shader, and it would affect ANY primitive that didn't have a material SOP, not just the one I am overriding.

3. I also tried using the properties SHOP, but couldn't get that to set overrides, but I may have not been using it correctly. There is very sparse documentation on this method.

The only solution I could come up with is to have a couple of instances, one for each shader I want to modify. I can render them all together and all works as it should. I just wanted to post this to see if there is a more elegant solution (some form of the ones I mentioned above, or something else entirely) because it feels a bit clunky this way.

Hopefully this is making sense.

Thanks

Gosh

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