radialMask
An amount that is 0 near a center and grows to 1 with distance, for an effect's strength.
radialMask(slots: {center: PropRef; radius: PropRef; falloff: PropRef}): Scalar
Import mask from shaders/std and use mask.radialMask.
Coverage stays 0 inside radius and reaches 1 at radius + falloff, measured in uv with the aspect corrected so the ring is round. Every slot takes a prop: center is a position prop, radius and falloff are numbers in uv. Chain .times(p('intensity')) to scale it.
Parameters
| Name | Type | Notes |
|---|---|---|
slots | {center: PropRef; radius: PropRef; falloff: PropRef} |
Example
effect: tintToward(p('color'), {amount: radialMask({center: p('center'), radius: p('radius'), falloff: p('falloff')}).times(p('intensity'))})
Tip. Also exported at the top level of
shaders/std, soradialMaskworks without themask.prefix.
See also
softDisc— A filled disc with a soft, shaped edge.