Shader workflow

Here I try to describe how the shaders are translated from maya to vex code.
Basically its quite simple, there are a few steps:
To make a clean transition of the nodes, every single maya shading node needs its counterpart as vex shader code. Of course this is a lot of work and at the beginning only a few shaders are available and only a few attributes are supported.

This image shows basic procedure:

Now it is important that the translators know which shading nodes and which attributes are supported. The source for this information is a text file called shaderDefinitions.txt and it resides in the ressources subdirectory of the installation. If you open the file you can see how the shaders are defined.

Every shader has its own segement. It is always started by:
shader_start
then follows the name in the form:
name:kTextureBase
followes by input and output attributes like this one:
inatt:defaultColor:color:0.5,0.5,0.0
and is finally finished by:
shader_end

A comment starts at the very beginning of the like with a '#' sign.
A attribute line consists of these parts:
inatt|outatt:nameOfAttribute:typeOfAttribute:defaultValue
Thats all.

With this file, all supported nodes are defined. Every single node needs its counterpart as vex souce code file. e.g. a node called bulge needs its counterpart in the ShaderIncludes directory called bulge.h.

Now that we know the translator knows which nodes can be used. It parses the shading networks and save the found nodes with the connections in a list. If a node is not supported, the current value of the connection is used.

Then for every network the shading node list is translated in a source code file. The translator does not check if the include files are existent. It simply thinks that they exist if the node is known because it is found in the shaderDefinitions file. The translator simply write a #include xxx.h line into the shader code. From all parameters, the sourcecode is created.

And finally the vcc compiler is called to create the final vex file and otl library.