Variable declarations

All variables are declared using the variable's value type followed by its name. In certain cases, they can or must be initialized with a value after an assignment operator. Global variables must be prefixed with one of the following qualifiers which determine the variable's lifetime, usage, and limitations.

  • const – a constant value
  • parameter (or param) – an adjustable parameter
  • var – a modifiable state variable
  • let and defer – a read-only expression variable
  • glsl – a GLSL variable

See also: Object declarations, Other declarations