Get Vertex Color in OSL

Hi! It’s said in the documentation.
https://docs.blender.org/manual/en/latest/render/shader_nodes/osl.html

Some object, particle and mesh attributes are available to the built-in getattribute() function. UV maps and vertex colors can be retrieved using their name.

But getattribute(“Col”,color_variable) do nothing. How to get the vertex color in OSL?

It’s a bug? Should I make a bug report about it?

Cycles currently does not automatically export attributes if they are requested by an OSL shader. So while this syntax works if the vertex color is already requested to be exported by a Vertex Color node for example, just an OSL script by itself does not work.

1 Like

Ouch, that’s sad but thanks for reply :wink: