Jump to content

Set shader's refractive tint to point color


Recommended Posts

Hi,

I'm trying to render a liquid and have the refraction tint set to the color that is a point attribute of the geometry for the liquid surface. I am using the basic liquid shader, and I have tried setting the channels of the refraction tint to Cd.x, Cd.y, and Cd.z. This just renders the surface as black.

When I apply the basic_surface to my geometry, the color appears when I have "use point color" checked, but I cannot figure out how to pipe this color into the basic_liquid shader.

Thanks in advance.

Link to comment
Share on other sites

Refraction Tint in basic_liquid shader is label for vector parameter called: transmitColor

you can see it if you hold your mouse over that label

so just create vector attribute called "transmitColor" in SOPs, it will override that parameter in shader

if that attribute is Detail then it will be overridden for whole object

if the attribute is primitive then it will be overridden per primitive and so on

to create that attribute based on Cd attribute use Attribute Create SOP to create transmitColor vector attribute (point if your Cd is point) then in Value parameters write $CR $CG $CB

or just use Attribute SOP to rename Cd to transmitColor

similarly you can create attributes for other parameters of the shader, just look at the real name of the parameter and create attribute of that type and name

NOTE: if vector does not work use float3, but i think it should

Link to comment
Share on other sites

Thank you very much! I tried both methods and they both worked well (both the Attribute Create SOP and the Attribute SOP). In case it helps someone else, I went with the Attribute Create SOP, which kept the Cd attribute, so I could continue to see the color in the viewport.

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