The variable section declares a state variable, whose value is accessible throughout GLSL code and may be modified by events. Unlike global GLSL variable, the value of a state variable will persist inbetween animation frames. Its syntax can be one of:

variable <type> <name>;
variable <type> <name> = <initial value>;

The variable keyword may be shortened to var. <type> is the type of the variable. Currently, only basic GLSL types are allowed. If <initial value> is not specified, it will be zero.


variable vec3 cubePosition = vec3(1.25, 0.0, -2.0);