Registers a callback to set the final color for each pixel in a filter shader. This hook can be used inside baseFilterShader().modify() and similar shader modify() calls to control the output color for each pixel. The callback receives the following arguments:
inputs: an object with the following properties:texCoord: a two-component vector representing the texture coordinates (u, v).canvasSize: a two-component vector representing the canvas size in pixels (width, height).texelSize: a two-component vector representing the size of a single texel in texture space.
canvasContent: a texture containing the sketch's contents before the filter is applied.
Return a four-component vector [r, g, b, a] for the pixel.
This hook is available in:
Examples
Syntax
getColor(callback)
Parameters
Related References
combineColors
Registers a callback to customize how color components are combined in the fragment shader.
getCameraInputs
Registers a callback to adjust vertex properties after the model has been transformed by the camera, but before projection, in the vertex shader.
getColor
Registers a callback to set the final color for each pixel in a filter shader.
getFinalColor
Registers a callback to change the final color of each pixel after all lighting and mixing is done in the fragment shader.