In this Three.js shader example a function called rand()
(taking a vec2
as an argument) is used to generate random numbers.
However, the function is not defined in the shader code. Instead, it seems to get included using #include <common>
(first line of the fragment shader).
I guess #include
works a bit like in C/C++, but what exactly does <common>
refer to? Is it an external file? Is it something specific to Three.js or will it also work with WebGL/GLSL in general?