logo
PointLight

lighting

PointLight

Free

Install with the CLI:

bjs download PointLight

PointLight

A lamp: light that shines every way from one spot and fades with distance.

What it does

PointLightSystem creates a point light through the renderer adapter when the component attaches and disposes it when it goes. Position and intensity are checked each frame, so you can move or dim a live light. Keep range bounded: a bounded light is what lets a room hold many small lamps without each one lighting every surface.

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 PointLight

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

    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": {
        "PointLight": {
          "position": [2, 3, 2],
          "intensity": 1.5,
          "diffuse": [1, 0.8, 0.5],
          "range": 12
        }
      }
    }
  }
}

Props

  • position ([x, y, z]) — where the light is.
  • intensity (number) — brightness.
  • diffuse ([r, g, b], default white) — light colour.
  • specular ([r, g, b]) — highlight colour.
  • range (number) — distance where the light stops.

Events

  • emits pointlight.created — the light exists.
  • emits pointlight.intensity.changed — brightness moved.
  • emits pointlight.moved — position moved.

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