Creates and loads a filter shader from an external file.
Examples
Syntax
loadFilterShader(fragFilename, [successCallback], [failureCallback])
Parameters
fragFilename
String: path to the fragment shader file
successCallback
Function: callback to be called once the shader is loaded. Will be passed the p5.Shader object.
failureCallback
Function: callback to be called if there is an error loading the shader. Will be passed the error event.
Returns
Promise<p5.Shader>: a promise that resolves with a shader object
Notice any errors or typos? Please let us know. Please feel free to edit src/webgl/material.js and open a pull request!
Related References
copyToContext
Copies the shader from one drawing context to another.
inspectHooks
Logs the hooks available in this shader, and their current implementation.
modify
Returns a new shader, based on the original, but with custom snippets of shader code replacing default behaviour.
setUniform
Sets the shader’s uniform (global) variables.