Phaser AE

3D Point and Spot Lights

Free packv3.0.0-33DLook

Point and spot lights as ordinary game objects. A light lives in a scene, can follow an object, is killed by a tag sweep and is tweened like anything else, so there is no separate light list to keep in step with the world.

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

Released October 14, 2026 · updated October 20, 2026

3D Point and Spot Lights: 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.

What it does

game.lights.add spawns a light with a position, a radius, a colour and an intensity, and returns its handle. The handle's light3d fields are all live, so you change a light's colour, brightness, cone or flicker by assigning to it. Give a light follow and it rides with an object, and dies with it; give it tags and a tag sweep removes it with everything else. The sun, ambient and fog stay with render-3d; this pack is for every light that is local.

A light fades smoothly to nothing at its radius, using an inverse-square falloff windowed so it reaches zero exactly at the edge, which stops a light popping as it crosses a cull boundary. A cone in degrees turns it into a spot, aimed by yaw and pitch, with a soft rim or a full-brightness inner cone of your choosing. Flicker beats two sine waves together, so a torch wavers like fire.

Each frame the live lights are sorted by distance from the camera and the nearest are sent to the renderer, up to a cap of 64 by default and 256 at most. A scene can hold more lights than that, and the ones dropped are the furthest away. Past a couple of dozen lights render-3d switches to clustered shading, binning lights into cells of the view so each pixel only considers the lights near it.

Features

  • Lights as objects — spawned, followed, tweened, tagged and killed like any other object in the scene.
  • Point and spot — a radius for a point light, plus a cone, an inner cone, a yaw and a pitch for a spot.
  • Physical falloff — a windowed inverse square that fades to zero exactly at the radius.
  • Flicker — depth and speed for torches, candles and faulty lamps.
  • Nearest first — the closest lights to the camera are sent each frame, up to a cap you can raise to 256.
  • Lights meshes and water — meshes, the water surface and lit CPU 3D particles share the same lights.

Good for

  • Dungeons and caves, with flickering torches along the walls.
  • Interiors, with a lamp over a table and lights in each room.
  • Night driving and chases, with headlight spots that follow the car.
  • Spells and weapons, with a glow in a hand or a muzzle flash.
  • Light shows and stages, with many coloured lights across a scene.

Make it yours

Each light takes its position, radius, color, intensity, a cone and innerCone in degrees, dir and pitch, flicker and flickerSpeed, an object to follow, an id, a layer and tags. The pack's option max sets how many lights reach the renderer at once. Two different uses: a dungeon with a hundred wall torches, each a warm point light with flicker, of which only the nearest are sent as the player walks; and a car at night with two narrow white spots that follow it, aimed down the road, plus a red point light behind for its tail lights.

A quick look

A flickering torch, and a spot light swept round by turning its yaw:

const torch = game.lights.add({ x: 4, y: 3, z: -2, radius: 10, color: '#ffb060', intensity: 40, flicker: 0.3 });
const lamp = game.lights.add({ x: 0, y: 9, z: 0, radius: 24, cone: 18, color: '#ffe7b0', pitch: 70 });
game.step('sweep', dt => { lamp.light3d.dir += 0.6 * dt; });   // every field is live

Works with

  • render-3d — required to see anything: it binds the lights and shades with them, flat or clustered.
  • beams-3d — a visible shaft of light through haze that follows a spot light.
  • blob-shadows-3d — contact shadows that ground objects, since these lights cast none.
  • lighting-2d — lights for 2D worlds.

Good to know

  • These lights cast no shadows; only the sun does.
  • There is no bounce light or light probes: it is direct light plus hemisphere ambient.
  • intensity is in inverse-square units, so a lamp meant to read twenty units away needs far more than one beside the bulb; check it at the distance it works at.
  • Spot cones are given in degrees to add, but the live light3d.cone field is in radians.

More Look packs

Show all →