Jump to content

glass not inheriting colors


Lukich

Recommended Posts

Hello again. I have a small probelm - I created a particle system where particles are colored based on their $LIFE. Then I passed the color info onto the metaballs that I copied to the particles, works great. If I render the scene with, say, vex supermaterial, it looks good, supermaterial inherits diff, so the metaballs come out colored in the render. But the glass shader douesn't work :( It expects a diff parameter, and you can set a single diffuse color to be the color of the glass. But if I put in a glass shader, it comes looking like a regular glass. Do you guys know why?

Thanks a lot,

Luka

Link to comment
Share on other sites

Hey Lukich,

If you slap down an Attribute SOP and rename Cd to diff, the Glass shader should pick it up. You can also pass down refl (reflect color) and transmit (Transmission) as attributes to further color your glass. I just tried it and diff by itself didn't do too much, the transmission color is more important.

Link to comment
Share on other sites

The SuperMat shader has a hidden import vector variable named Cd. This will directly inherit the Cd attribute if it exists on the data. In the shader, diff is multiplied by Cd so the two interact with each other. It also picks up the default Alpha attribute.

The Glass shader does not have Cd defined so you have to override the actual vector variable named diff which is the shaders visible parameter to set the color of the glass. Note that manipulating the Diffuse diff parameter in the glass shader has no effect as it is being overridden by the diff attribute on the geometry.

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