API

Interface SceneContext

Top-level scene context — pure state, no attached methods.

interface SceneContext {
    animationGroups: AnimationGroup[];
    camera: Camera | null;
    clearColor: GPUColorDict;
    clipPlane: ClipPlane | null;
    environmentPrimaryColor?: [number, number, number];
    fixedDeltaMs: number;
    fog: FogConfig | null;
    imageProcessing: ImageProcessingConfig;
    lights: LightBase[];
    meshes: Mesh[];
    name?: string;
    shadowGenerators: ShadowGenerator[];
    surface: SurfaceContext;
}

Hierarchy (View Summary)

Index
animationGroups: AnimationGroup[]

Animation groups loaded from glTF or created manually.

camera: Camera | null
clearColor: GPUColorDict

Clear color used when this context is the first active one in a frame.

clipPlane: ClipPlane | null

Scene clip plane as (normal.x, normal.y, normal.z, d). Matches Babylon.js Plane dot(worldPosition, plane) > 0 discard semantics.

environmentPrimaryColor?: [number, number, number]

Background material primaryColor (linear RGB). Default from Babylon createDefaultEnvironment.

fixedDeltaMs: number

Fixed delta time in ms for deterministic animation. 0 = use real rAF delta.

fog: FogConfig | null

Fog configuration. Null = no fog.

imageProcessing: ImageProcessingConfig
lights: LightBase[]
meshes: Mesh[]

All meshes added to the scene (standard + PBR).

name?: string

Optional display name for tooling and diagnostics.

shadowGenerators: ShadowGenerator[]

Shadow generators registered on this scene.

Surface this scene renders into. Set at scene-creation time and immutable afterwards — the default render task is sized and MSAA-matched to this surface, and registerScene attaches the scene to it. For the engine's primary surface (the common single-canvas case) this is the engine itself. The owning engine is reachable via scene.surface.engine.