Shaders in Flair are divided in two parts, the inputs/outputs and the GLSL code. The ##GLSL line separates these two. Here is the simplest example of a Flair shader.

out vec4 Output;

##GLSL

void main() {
	Output = vec4(1.0, 1.0, 1.0, 1.0);
}

Inputs/Outputs

Built-in Uniforms

Intrinsic Functions

Coding Guidelines

Convert HLSL to GLSL


Based on this shader, Flair will:

  1. Identify input/outputs
  2. Modify the shader node UI accordingly
  3. Bind the data to the GLSL program
  4. Run the GLSL program when requested.

In the specific case above, the shader does not have any inputs, only one output Output. Within the GLSL code, the output will be written as a white color when requested.

To learn more about how to write shaders in Flair, please take a look at the examples under Flair/shaders and refer to the documentation below.