How to use Vertex Color (@Cd) in Vex Surface material

   2839   1   1
User Avatar
Member
18 posts
Joined: Sept. 2019
Offline
Hi

How can I use vertex color in shader written in Vex?
@Cd cannot be compiled with an error:

material:43:31: Error 1109: Unknown token '@'
material:43:31: Error 1088: Syntax error, unexpected end of file, expecting ';'.


By the way, I cannot find any good learning resources on vex materials

Regards and thanks in advance
User Avatar
Member
8177 posts
Joined: Sept. 2011
Offline
There's no @ in VEX. That's used by the pre-processor for wrangles only. Just add
vector Cd = {0,0,0};
to the shader's args. There's a great resource for learning vex materials right in the houdini install folder. Go to $HFS/houdini/vex; it's a trove of source code with comments.
  • Quick Links