pointwise
Write your own pointwise effect: a function of the child's color at this pixel.
pointwise(config: Omit<PointwiseEffect, 'kind'>): PointwiseEffect
Import pointwise from shaders/std.
Give it build, which receives params.childNode (the child's color here) and params.uniforms (your props), and returns the new color. Keep the child's alpha unless you mean to change it. No texture is involved, so it is the cheapest kind of filter.
Parameters
| Name | Type | Notes |
|---|---|---|
config | Omit<PointwiseEffect, 'kind'> |
Example
effect: pointwise({build: ({childNode, uniforms}) => math.vec4(math.mul(childNode.member('rgb'), uniforms.gain), childNode.member('a'))})
See also
gather— Write your own gather effect: a function that can read the child anywhere.tintToward— Mix the child's color toward one color by an amount, leaving its alpha alone.paintThrough— Show a paint through the child, so the child becomes the mask.