---
title: "beamFrame"
description: "The frame of a beam that starts at an anchor prop and points at the canvas center."
group: "light"
groupTitle: "Noise, light & materials"
categoryId: "light"
categorySlug: "light"
categoryTitle: "Light"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/paint/light.ts#L234"
---

# beamFrame

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

```ts
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

| Name | Type | Notes |
|---|---|---|
| `anchor` | `PropRef` |  |

## Example

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

## See also

- [`beamBloom`](/docs/primitives/light/beambloom) — The soft pool of light at the start of a beam, with a wider faint shoulder around it.
- [`beamStreaks`](/docs/primitives/light/beamstreaks) — Two bright bands crossing a beam further along it, slowly drifting, like light bouncing inside a film camera.
- [`screenGlow`](/docs/primitives/light/screenglow) — An `effect` that shines emitted light onto the layer inside it, the way light hits film.

## Used by

[LightLeak](/docs/components/lightleak)