A parameter is a variable, which can be directly manipulated in the GUI, and is accessible throughout the remainder of the script, including GLSL functions. It is a handy tool for fine-tuning the appearance of your outputs.

Its syntax can be one of:

parameter <type> <name>;
parameter <type> <name> = <value>;
parameter <type> <name> : <control type>;
parameter <type> <name> = <value> : <control type>;

The parameter keyword may be shortened to param. <type> is the type of the parameter variable. Currently, only basic GLSL types are allowed (float, int, vecn, ivecn, matn, and bool). <value> is its default value (zero if not specified), and <control type> is the type of GUI element that shall control it, possibly with additional parameters. The available control types are listed below. A linear scale will be used by default.

Control types

The parameter control type can be one of:

  • range(<minimum>, <maximum>) – the default control, allows the user to change the value (or its individual components) using a linear slider. if <minimum> is omitted, it will be 0. If <maximum> is also omitted, the range will be from 0 to 1
  • logrange(<minimum>, <maximum>) – allows the user to change the value (or its individual components) using a logarithmic scale slider
  • toggle() – the default control for bool parameters, cannot be used with other types. Allows to toggle between true and false using a simple checkbox
  • color() – an interactive color picker control, only applicable to vec3 (RGB) and vec4 (RGBA) parameter types
  • srgb_color() – same as color, but displays the color in sRGB color space. Should be used with sRGB image shaders.
  • hidden() – the parameter won't be shown in the GUI, but can be controlled programmatically


parameter vec2 myCoord = vec2(0.3, -0.4) : range(vec2(-1.0, -1.0), vec2(1.0, 1.0));