logo
GlowLayer

rendering

GlowLayer

Free

Install with the CLI:

bjs download GlowLayer

GlowLayer

Scene-wide bloom, so emissive screens and neon tubes glow.

What it does

GlowLayerSystem turns on the renderer's glow pass when the component attaches and turns it off when it goes. The adapter's glow pass starts with an empty list: nothing glows until a mesh is added to it. With includeEmissive on (the default), the system listens for every mesh the scene makes (meshprimitive.created, mesh.loaded) and adds each one, so anything with an emissive material blooms. Order does not matter: meshes that show up before the glow pass are remembered and added once it is up. intensity is checked each frame, so a slider drives it live.

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 GlowLayer

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 GlowLayer
    bjs download GlowLayer

    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": {
    "Lamp": {
      "components": {
        "MeshPrimitive": {
          "primitive": "box",
          "position": [0, 0.5, 0],
          "material": {
            "diffuseColor": [0, 0, 0],
            "emissiveColor": [0.1, 0.9, 1]
          }
        }
      }
    },
    "Bloom": {
      "components": {
        "GlowLayer": { "intensity": 0.6 }
      }
    }
  }
}

Props

  • intensity (number, default 0.45) — how far the bloom spreads.
  • textureRatio (number, default 0.25) — size of the glow buffer. Lower is cheaper and softer.
  • samples (number, optional) — MSAA samples on the glow buffer.
  • enabled (boolean, default true) — off switch that keeps the settings.
  • includeEmissive (boolean, default true) — add every scene mesh. Set false to add meshes yourself.

Events

  • emits glowlayer.applied { entityId, intensity } — the glow pass is up.
  • emits glowlayer.mesh.enrolled { entityId, meshEntityId } — a mesh was added to the glow.
  • emits glowlayer.cleared { entityId } — the glow pass was torn down.
  • listens meshprimitive.created, meshprimitive.disposed, mesh.loaded — to find meshes.

Dependencies

None.

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