A shader hook block that sets the color for each pixel in a filter shader. This hook can be used inside buildFilterShader() to control the output color for each pixel.
filterColor has 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.
Call .set() on the hook with a vector with four components (red, green, blue, alpha) to update the final color.
This hook is available in:
Examples
Related References
baseColorShader
Returns the default shader used for fills when no lights or textures are activate.
baseFilterShader
Returns the base shader used for filters.
baseMaterialShader
Returns the default shader used for fills when lights or textures are used.
baseNormalShader
Returns the default shader used for fills when normalMaterial() is activated.