beamFrame

The frame of a beam that starts at an anchor prop and points at the canvas center.

beamFrame(anchor: PropRef): LightValue

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

Gives each pixel its distance along the beam and its sideways offset from it as vec2(u, v), in aspect-corrected uv. Drag the anchor anywhere and the beam still points inward. Built for filters over a child (a light leak inside screenGlow), where it reads the child's uv.

Parameters

NameTypeNotes
anchorPropRef

Example

const frame = local(beamFrame(p('position'))(params), 'leakFrame')

See also

  • beamBloom — The soft pool of light at the start of a beam, with a wider faint shoulder around it.
  • beamStreaks — Two bright bands crossing a beam further along it, slowly drifting, like light bouncing inside a film camera.
  • screenGlow — An effect that shines emitted light onto the layer inside it, the way light hits film.

Used by

LightLeak