coverageOver

Lays a light color over a background color by a coverage field, like a layer with an opacity mask, as a finished paint.

coverageOver(slots: {color: PropRef; background: PropRef; coverage: LightValue}): LightValue

Import light from shaders/std and use light.coverageOver.

color and background are color props, coverage a 0–1 light. The color's own alpha counts as opacity, so a half-transparent ray color shows the background through it.

Parameters

NameTypeNotes
slots{color: PropRef; background: PropRef; coverage: LightValue}

Example

paint: coverageOver({color: p('rayColor'), background: p('backgroundColor'), coverage: withFrame(seamlessRadialFrame(p('center')), noiseRays({density: p('density'), intensity: p('intensity'), spotty: p('spotty')}))})

See also

  • coverageMix — Blends from a background color to a light color by a coverage field, as a finished paint.
  • noiseRays — Volumetric god rays: shafts of light drifting outward from the center, moving on the layer's clock.

Used by

Godrays