vignetteMask

Darkens the corners of the canvas.

vignetteMask(slots: {strength: ArgSpec; scale?: number}): LightValue

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

Returns a field that is 1 at the center and falls toward 0 in the corners, kept round on any canvas shape. Multiply your color by it. strength 0 leaves the image alone and about 2 takes the corners to black. scale multiplies strength, for mapping a 0–100 slider onto that range.

Parameters

NameTypeNotes
slots{strength: ArgSpec; scale?: number}

Example

const vig = vignetteMask({strength: p('vignette'), scale: 0.025})(params)
return vec4(mul(rgb, vig), 1)

See also

  • featherMask — A round mask that is solid inside a radius and fades out at its edge.

Used by

StudioBackground