
21913.4 Source Transforms
e name eld must be unique, as npm has a single namespace for published packages.
If unsure, check http://npmjs.org/package/<n a m e> to make sure the name isn’t already
taken. e version eld should be familiar, and description is an additional eld
used by npm for searching for and displaying the package.
Let’s create an index.glsl le: is le will be the default le loaded when users of
our package use require(glsl-example-sum):
float sum(float a, float b) {return a + b}
float sum(vec2 a, vec2 b) {return a + b}
float sum(vec3 a, vec3 b) {return a + b}
float sum(vec4 a, vec4 b) {return a + b}
#pragma export(sum)
If de ...