Skip to main content

Intro

info

Please consider sharing your new nodes with us, and with your permission we might add them to Coollab 💜.

Submission link.

Coollab nodes are tiny fragments of shader code written in glsl. If you don't know what this is you can start by watching tutorials from The Art of Code.

To create a new node:

  • Open Coollab's user-data folder. You can do this by using the corresponding Command: Open user data folder

  • In the Nodes folder add a new file with the .clbnode extension.

    You can also put it in a subfolder of Nodes to create a category with the same name as the subfolder. Or you can add it to an existing category of Coollab by naming your subfolder the same as one of Coollab's categories.
    If you want to sort your categories, you can put numbers at the beginning of their name to force an order. These numbers will not be rendered in the category name.

Add a node file

  • Open the file and start writing your node! Here is a very basic example that you can just copy-paste into your file:
Invert Color.clbnode
sRGB main(sRGB Color)
{
return vec3(1.) - Color;
}

All nodes need to have a function called main: this is what will be used to apply the effect on whichever node will be plugged into your node.
In Coollab a lot of implicit conversions and code generation happen behind the scene. This means that you can write minimal nodes and the rest will happen automagically. For example our Invert Color node takes a color and outputs a new color. If you plug a whole image into the Invert Color node, the main function you defined will be called on each pixel of the image, thus creating a new image with inverted colors. Notice that in our Invert Color node we never mentioned images, only colors, which is a simpler and smaller building block. This is great! Our nodes stay very simple and focused on what they want to achieve.

It is possible for the main function to have several inputs, but they must all be of the same type:1

Add.clbnode
float main(float x, float y)
{
return x + y;
}

Also, it is possible that your main function doesn't take any input at all if it represents a constant:

Float Value.clbnode
INPUT float 'Value';

float main()
{
return 'Value';
}
tip

If you want to see more examples, you can check out all of Coollab's nodes.


  1. If you have a use case where this limitation is annoying to you, feel free to contact us and we will happily consider your use case and improve Coollab to make it fit your needs.