glowAt

A soft round glow at a position on the canvas.

glowAt(opts: {uv: Expr; aspect: Expr | number; x: Expr | number; y: Expr | number; sizeSq: Expr | number}): Expr

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

Returns a 0–1 field, 1 at the position. x and y are in uv (0–1, y down), aspect is the canvas width over height so the glow stays round, and sizeSq is the glow radius squared. Pass several with different positions and sum them with additive.

Parameters

NameTypeNotes
opts{uv: Expr; aspect: Expr | number; x: Expr | number; y: Expr | number; sizeSq: Expr | number}

Example

const glow = glowAt({uv: params.ctx.uv, aspect: params.ctx.aspect, x: 0.5, y: 0.4, sizeSq: 0.02})

Tip. The radius goes in squared: a glow 0.15 across the canvas is sizeSq: 0.0225.

See also

  • glowSpot — A soft oval glow over an offset you have already scaled, the core of a bloom or a glare.
  • glowPoint — A soft glow at the center of a radial frame with no hard edge.
  • radialFrame — The frame for a burst, halo or sweep around a center prop.

Used by

StudioBackground