filmGrain
Sprinkle film grain over the child, heaviest in the shadows.
filmGrain(slots: {strength: ArgSpec; bias: ArgSpec; animated: PropRef}): PointwiseEffect
Import effects from shaders/std and use effects.color.filmGrain.
strength (0–1) sets how visible the grain is. bias (0–10) concentrates it in darker areas; 0 grains everything evenly. While the boolean animated prop is on the pattern changes every frame; off, it freezes. The definition must declare the grain's clock: extraFields: {animTime: {schema: schema.f32, initial: 0}}. Alpha kept.
Parameters
| Name | Type | Notes |
|---|---|---|
slots | {strength: ArgSpec; bias: ArgSpec; animated: PropRef} |
Example
effect: filmGrain({strength: p('strength'), bias: p('bias'), animated: p('animated')})
Tip. Declare
identityWhen: isZero('strength').
See also
posterize— Reduce the child to a few flat color levels, like a screen-printed poster.