noiseTone

The standard contrast and balance controls of a noise texture, turning a 0–1 field into the ramp position.

noiseTone(field: Field, slots?: {contrast?: PropRef; balance?: PropRef}): Field

Import noise from shaders/std and use noise.noiseTone.

contrast steepens the field around mid-grey (0 = unchanged, positive = sharper, negative = flatter). balance shifts the whole range (positive = more of the first color). Leave the slots out for a texture without those controls. The result is flipped: where the field is high the ramp shows its first color. Expects a unit field, so put unitized around a signed basis first.

Parameters

NameTypeNotes
fieldField
slots{contrast?: PropRef; balance?: PropRef}Optional.

Example

paint: rampOver(noiseTone(seededPlane(evolving(noiseField('perlin'), {rate: 0.3}), {scale: p('scale'), seed: p('seed')}), {contrast: p('contrast'), balance: p('balance')}), stops(p('colorSpace')))

Tip. Contrast here is additive: 0 is the identity, not 1. Default the prop to 0.

See also

  • signedTone — Contrast and balance for a signed field (−1 to 1), applied before it is squashed to 0–1.
  • gainTone — Contrast as a multiplier and balance as a shift over a 0–1 field, not flipped.
  • unitized — Turns a signed field (−1 to 1) into a unit field (0 to 1).

Used by

BlockNoise, BlueNoise, CurlNoise, ErosionNoise, GaborNoise, PerlinNoise, Scratches, WaveletNoise