Phaser AE

Light Beams

Free packv3.0.0-33DLook

Volumetric spotlight shafts: the visible cone of light a torch, a searchlight, a lighthouse or headlights throw through haze. A beam follows its light or is aimed by hand, shades like light, and fades out before it meets a solid.

This is a Free pack. Every phaser.io account can use it in their games.

Released October 14, 2026 · updated October 19, 2026

Light Beams: a screenshot of its demo
A note about these graphics

Expansion packs don't come with graphics. This screenshot is one way of drawing what the pack does, made for its demo: none of the sprites, tiles or backgrounds in it are in the pack.

That's by design. A pack is a game's logic, mechanics and effects, and it works with whatever art you give it. Some packs draw effects, backdrops or 3D scenes of their own, but none carries a game's sprites.

So the look is yours. Make the art on phaser.io, bring your own, or let your agent draw it in code: the same pack can look like anything.

The pack

beams3d

function beams3d(opts: Beams3dOptions = {}): Pack<{ beams: Beams3dApi }>

The beams-3d pack: visible shafts of light from spot lights, one instanced draw. Requires a 3D world and render-3d, whose depth the shafts dissolve against so they never cut through the world.

Types

Beam

interface Beam

A live beam. Its look (length, cone, color, intensity) can be read and set at any time; on a beam that follows a light, reading a field it has not set gives the light's current value, and setting one makes it the beam's own. Its pose (x, y, z, dir, pitch) is settable on a beam from at, so a lighthouse can sweep one by turning dir; a following beam's pose is its light's, and setting it is an error in dev (move or aim the light instead) and ignored in production. A non-finite number is the same error.

  • length: number — How far the shaft reaches, world units. Live.
  • cone: number — Half-angle of the cone, radians. Live.
  • color: string — Colour, CSS. Live.
  • intensity: number — Additive core strength. Live.
  • x: number — Lamp world x. Live on a beam from at; the light's x on a following beam.
  • y: number — Lamp world y. Live on a beam from at; the light's y on a following beam.
  • z: number — Lamp world z. Live on a beam from at; the light's z on a following beam.
  • dir: number — Aim yaw, radians, 0 toward +z. Live on a beam from at; the light's light3d.dir on a following beam.
  • pitch: number — Aim pitch, radians, positive down. Live on a beam from at; the light's light3d.pitch on a following beam.
  • readonly light: Handle | null — The light it follows, or null for a beam from at.
  • kill(): void — Remove it now. Further writes to it are ignored.
  • readonly alive: boolean — True until killed, or until the light it follows dies.

BeamPose

interface BeamPose

Where a hand-placed beam's lamp is and where it points: what at takes on top of a BeamSpec.

  • x: number — Lamp position, world x.
  • y: number — Lamp position, world y (up).
  • z: number — Lamp position, world z.
  • dir: number — Aim yaw, radians, as a lighting-3d light's light3d.dir: 0 points +z.
  • pitch: number — Aim pitch, radians, as light3d.pitch: positive points down, Math.PI / 2 straight down.

Beams3dApi

interface Beams3dApi

game.beams.

  • add(light: Handle, spec?: BeamSpec): Beam — Give a SPOT light (from lighting-3d's game.lights.add with a cone) a visible shaft. It follows the light's position, aim, cone, reach and colour every frame, except what spec sets, and dies with the light. It is not drawn while the light is off, at zero intensity or not a spot (a point light, cone 0). A handle with no light3d (lighting-3d not composed) throws in dev.
  • at(spec: BeamSpec & BeamPose): Beam — A shaft that follows nothing, placed and aimed by hand; move or sweep it through the returned Beam.
  • strength: number — A multiplier over every beam. Default the strength option. Live.
  • soft: number — How far ahead of a solid a shaft dissolves, world units, at least 0.01. Live.
  • enabled: boolean — Whether the pass draws. Live.
  • readonly count: number — Beams alive now (killed ones and those whose light died are dropped every step, drawn or not).
  • readonly drawn: number — Beams drawn last frame: 0 headless, while disabled, or with no visible beam.

Beams3dOptions

interface Beams3dOptions

Manifest options.

  • soft?: number — How far ahead of a solid a shaft starts to dissolve, world units; at least 0.01. Default 1.5.
  • strength?: number — A multiplier over every beam's own intensity. Default 1.
  • enabled?: boolean — Whether the pass draws at all. Default true.

BeamSpec

interface BeamSpec

How one beam looks. On a beam that follows a light, every field left out FOLLOWS the light, read every frame; a field given (or set later on the Beam) is the beam's own from then on.

  • length?: number — How far the shaft reaches from the lamp, world units. Default: the light's radius (20 for a beam from at).
  • cone?: number — Half-angle of the cone, RADIANS (lighting-3d's lights.add takes degrees; its light3d.cone is radians, as this is). Capped just under 90°. Default: the light's cone (0.4 for a beam from at).
  • intensity?: number — Additive core strength, 0 upward; 0.5 reads as a clear shaft in haze. Default 0.5.
  • color?: string — Colour, any CSS colour. Default: the light's light3d.color ('#ffeecc' for a beam from at).