isValue

Skip the filter entirely while prop equals value, for a filter whose no-op is not 0.

isValue(prop: string, value: unknown): IdentityRule

Import isValue from shaders/std.

An unset prop counts as its default; a per-pixel mapped prop disables the skip. Give the prop recompile: crosses(value) so the skip switches on and off.

Parameters

NameTypeNotes
propstring
valueunknown

Example

props: {intensity: {default: 1, recompile: crosses(1)}},
effect: saturate(p('intensity')),
identityWhen: isValue('intensity', 1),

See also

  • isZero — Skip the filter entirely while prop is exactly 0.
  • allOf — Skip the filter only while every rule holds, for a no-op that needs several props at rest.
  • crosses — Rebuild the shader only when the prop crosses value, not on every change.

Used by

Exposure, Saturation