logo
NeonSign

lighting

NeonSign

Free

Install with the CLI:

bjs download NeonSign

NeonSign

Glowing neon words on a wall, plus the coloured light they throw into the room.

What it does

NeonSignSystem draws the sign's text as a flat, wall-fixed label and puts a light of the same colour just in front of it. The light is a point light by default, or a spot aimed along the sign's facing and tilted down (lightKind: "spot"). Every field is compared each frame, so you can recolour, move, resize or re-letter a live sign and the words and the light change together.

With extruded: true the letters become real 3D slabs. That needs the neonText Babylon adapter plugin. Register it once at startup with await registerBabylonNeonTextExtension(adapter) from adapter/register.ts, before the scene loads. It is async: it checks the adapter first and only then loads the Babylon half, so a Three or Lite game never downloads Babylon for it. Without the plugin (a Three project, tests, or a missed registration) the sign quietly draws the flat label instead. Add a GlowLayer to the scene to make the tubes bloom.

Use it in a scene

A scene is just data — a list of entities, each with its components. At startup the SceneLoader turns this JSON into a live world; edit the file and reload to rebuild it.

Fastest path

bjs download scene NeonSign

Pulls this exact scene into your project and runs it — no copy-paste. Add --all to grab the components and assets it needs too.

Or build it from scratch with the bjs CLI:

  1. 1Scaffold a project
    npm create @babylonjsmarket/arcade@latest my-game

    World, renderer, and dev server — ready to run.

  2. 2Install dependencies
    cd my-game && npm install
  3. 3Add NeonSign
    bjs download NeonSign

    Copies its source into src/ so the scene resolves.

    First time? Run bjs login once.

  4. 4Paste the scene into src/scenes/arcade-room.ts and run
    npm run dev

    SceneLoader builds the world from the JSON; reload to rebuild.

JSON
{
  "entities": {
    "Sign": {
      "components": {
        "NeonSign": {
          "text": "ARCADE",
          "color": [1, 0.2, 0.7],
          "position": [0, 2.6, -1.85],
          "size": 0.8,
          "glow": 2,
          "range": 8
        }
      }
    },
    "Bloom": {
      "components": {
        "GlowLayer": { "intensity": 0.5 }
      }
    }
  }
}

Props

  • text (string) — the words.
  • color ([r, g, b]) — tube colour; also the light colour.
  • position ([x, y, z]), rotation ([x, y, z] radians) — where the sign face is and which way it points.
  • size (metres) — letter height.
  • glow (number) — light brightness; 0 turns the light off.
  • range (metres) — how far the light reaches.
  • glowOffset (metres) — how far in front of the face the light sits.
  • fontSize (CSS px) — label texture resolution.
  • lightKind (point | spot, default point), spotAngle, spotExponent — the light's shape.
  • extruded (boolean, default false), depth (metres, 0.08), fontUrl (default /fonts/neon.json) — 3D letters via the plugin.

Events

  • emits neonsign.created — the sign is up.
  • emits neonsign.text.changed { entityId, text }.
  • emits neonsign.color.changed { entityId, color }.
  • emits neonsign.extruded { entityId, text } — the plugin built 3D letters.

Dependencies

None. The Babylon plugin uses the earcut package to triangulate the letters.

More like this

Was this page helpful?

We read every note — tell us what's working and what isn't.

↑↓ NavigateEnter SelectEsc CloseCtrl+K Open Search