Apart from the simple datatypes like bool, int, float and double with HLSL you can use all those as vectors also, by simply writing something like:
Now you can reach the individual vector components using swizzles, which work as suffixes to the variable names:
.x, .y, .z, .w
are the same as:
.r, .g, .b, .a
With all the basic datatypes you can also declare arrays, but note that their length is limited, depending on the constant register count of the shader profile used. You can find out about the number of allowed constants on msdn:
You can define and access arrays like the following example demonstrates:
HLSL has a small list of built-in functions. A rightclick in vvvvs shader editor pops up the list.
Besides the main vertex- and pixelshader functions you can define any number of helper functions in an effect file. If this gets too confusing functions can be outsourced into an extra textfile and linked to from any effect via the # include directive which offers 2 different usages:
In every technique you have to specify a shader profile with which you want the vertex- and pixelshader functions compiled. Generally speaking, the higher the profile number the more flexible it is. If your shader shows an error regarding that you are out of instructions with the currently set profile you may try one with a higher number.
Details about shader profiles and corresponding features can be found on msdn: Shader Models vs. Shader Profiles
Depending on the capabilities of your graphic card, vvvv supports the following profiles:
anonymous user login