Tutorial
 

If you are reading this chances are you already know how to program with either RSL or Vex. If you don't know one of these languges already, the following information probably won't do you very much good. Vex is very close to RSL in structure. If you look at an example of Vex code and RSL code you won't see alot of difference between the two shaders if the do the exact same thing. Instead of trying to tell you how to translate these languge I am instead going to give you a RSL to Vex dictionary and some general tips on translating RSL to Vex and leave the rest up to you.

 

RSL

VEX
Details

point

vector
Vector is the catch all workhorse datatype for any value which returns three values.
color
vector
Vector is the catch all workhorse datatype for any value which returns three values.
normal
vector
Vector is the catch all workhorse datatype for any value which returns three values
cspline
spline
Standard Catmull-Rom spline. Usage is the same in both languages.
lerp
mix
Lerp and Mix operate exactly the same in both languages.
normal1.vector2
dot(vector1,vector2)
Accept for this slight difference in syntax for creating a dot product the function behaves exactly the same in both languages.
Cs
Cf
You can only assign the value of Cf once in Vex.
Os
Of
You can only assign the value of Of once in Vex.
faceforward
frontface
Usage is the same in both languages.
string coordname = "world";
point pp = transform(coordname,P);
vector pp = ow_space(P); Both of these statements declare a point in the terms of world space.

 

The way Vex interpets t and s is somewhat different from RSL. Once you have converted your shader you may need to change your expressions to compensate. In most cases subtracting s and t from 1 will remedy this. Also, the way a shader previews, may be reversed. You may need to convert the shader into a VOP node and then do a V = 1 - V function to fix this.

All Vex surface shaders should end with value being assigned to Cf (color), Of (Opacity), and Af (alpha.)

When assigning #pragma labels for your parameters, remember to that labels may not have spaces.

To get color pickers in color parameters, you will need to create #pragma hints for colors.

Vector4 may be used instead of vector for colors. This will give those colors declarable alpha channels.