glslify = function (arg, opts) { if (Array.isArray(arg)) { // template string return iface().tag.apply(null, arguments) } else if (typeof arg === 'string' && !/\n/.test(arg) && opts && opts._flags) { // browserify transform return require('./transform.js').apply(this, arguments) } else if (typeof arg === 'string' && /\n/.test(arg)) { // source string return iface().compile(arg, opts) } else if (typeof arg === 'string') { // source file return iface().file(arg, opts) } else throw new Error('unhandled argument type: ' + typeof arg) }
n/a
compile = function (src, opts) { return iface().compile(src, opts) }
...
[tagged template string function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals
).
### var src = glsl(file, opts)
### var src = glsl(shaderSource, opts)
Compile a shader using an inline shader string or a file name.
These are convencience methods provided that call `glsl.compile()` or
`glsl.file()` accordingly. These methods are also provided for backwards
compatibility with the previous `< 6` interface.
Optionally provide:
* `opts.basedir` - directory to resolve relative paths
* `opts.transform` - an array of transform functions, transform module name
...
file = function (file, opts) { return iface().file(file, opts) }
...
### var src = glsl(file, opts)
### var src = glsl(shaderSource, opts)
Compile a shader using an inline shader string or a file name.
These are convencience methods provided that call `glsl.compile()` or
`glsl.file()` accordingly. These methods are also provided for backwards
compatibility with the previous `< 6` interface.
Optionally provide:
* `opts.basedir` - directory to resolve relative paths
* `opts.transform` - an array of transform functions, transform module name
...