Skip to content

@relu-interactives/spatial-ecs


@relu-interactives/spatial-ecs / index / EnvironmentSyncSystem

Class: EnvironmentSyncSystem ​

Defined in: systems/EnvironmentSyncSystem.ts:124

Applies the scene's Environment component to the three.js scene: skybox, fog, and (when values.lighting is present) image-based lighting, tone mapping and exposure.

Each part is dirty-checked on its own, so animating lighting.envIntensity every frame does not rebuild the skybox texture.

Runs in the editor and at runtime. While an XR session composites over the real world (World.isXrPassthrough()) the background is withheld; lighting and fog still apply.

On WebGL the environment map is PMREM-prefiltered here. On WebGPU (World.getRendererKind() === "webgpu") the equirect texture is assigned to scene.environment as is and the renderer prefilters it.

Implements ​

Constructors ​

Constructor ​

ts
new EnvironmentSyncSystem(scene): EnvironmentSyncSystem;

Defined in: systems/EnvironmentSyncSystem.ts:173

Parameters ​

ParameterType
sceneScene

Returns ​

EnvironmentSyncSystem

Properties ​

PropertyModifierTypeDefault valueDescriptionDefined in
runsWhilePausedreadonlytruetrueKeep ticking while the world is paused. Leave it unset for anything that moves the game on: such a system stops at world.pause() and picks up where it was at world.resume().systems/EnvironmentSyncSystem.ts:125

Methods ​

update() ​

ts
update(world, deltaTime?): void;

Defined in: systems/EnvironmentSyncSystem.ts:616

Parameters ​

ParameterTypeDefault value
worldWorldundefined
deltaTimenumber0

Returns ​

void

Implementation of ​

EcsSystem.update


dispose() ​

ts
dispose(): void;

Defined in: systems/EnvironmentSyncSystem.ts:656

Returns ​

void

Implementation of ​

EcsSystem.dispose