This package helps to combine GLSL code snippets.
This package is build around functions of type Generator -> Generator.
They are all meant to be used in a pipeline (|>) or by composing them (>>).
This starts a fragment shader pipeline
Starts a vertex shader
Shaders usually start by defining variables and functions
emptyFragmentShader
|> defineUniform "vec3" "color"
|> define glslCodeDefiningAFunctionThen you define the code for main using code snippets and possibly some more variables. Variables used here will be automatically declared in the genrated code.
code
|> (s "vec4 c = vec4(color * " >> uniform "float" "colorScale" >> ", 1.0);")
|> s "gl_FragColor = c;"Then you take a finished Generator and generate code from it:
Transform a generator into the finished GLSL code
Transform a generator into the finished elm code
A type that describes a fragment shader