The Three.js shader example linked here uses a function called rand()
with a vec2
input to create random numbers.
Interestingly, the function is not defined within the shader code itself. Instead, it appears to be included through the use of #include <common>
at the beginning of the fragment shader.
This brings up the question - what exactly does <common>
refer to? Is it an external file or something specific to Three.js? And can this method also be applied in WebGL/GLSL programming in general?