Table of Contents
Below is a quick reference of plugs available in our implementation. We have found these plugs to be sufficient for a wide range of effects, although of course there's always a place for changes and improvements. Remember that you can always define your own plugs in your effects and shader nodes.
Parameter names are shown below merely to document the parameter meaning. Of course you can change the parameter names when declaring your own plug function. To some extent you can also change the parameter qualifiers:
If a parameter below is “inout”, you can change it to “in”, or “const in” if you don't want to modify the given value.
You can also change the “inout” parameter to just “out”, if you want to unconditionally overwrite the given value. Although this is usually not advised, as it means that you disable previous effects working on this parameter. Most of the time, summing or multiplying to the previous value is a better choice.
If a parameter below is shown as “in”, you can add or remove the const qualifier as you wish. Using const may allow the shader compiler for additional optimizations.
void PLUG_vertex_object_space_change(
inout vec4 vertex_object,
inout vec3 normal_object)
You can modify the vertex position and normal vector in object space here.
If you don't need to modify the vertex position,
consider using the vertex_object_space
instead, that may result in more optimized shader.
void PLUG_vertex_object_space(
const in vec4 vertex_object,
inout vec3 normal_object)
Process the vertex and normal in object space. You cannot change the vertex position here, but you can still change the normal vector.
void PLUG_vertex_eye_space(
const in vec4 vertex_eye,
const in vec3 normal_eye)
Process the vertex and normal in eye (camera) space.