From 3e66408af035cf22dafdec407ac969c613a99d09 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Tue, 31 Mar 2026 23:14:33 +0200 Subject: [PATCH] Set scene environment and intensity based on background mode --- src/viewport-three/viewport-host.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/viewport-three/viewport-host.ts b/src/viewport-three/viewport-host.ts index 9cf93a3c..22c081f3 100644 --- a/src/viewport-three/viewport-host.ts +++ b/src/viewport-three/viewport-host.ts @@ -345,11 +345,16 @@ export class ViewportHost { this.sunLight.position.set(world.sunLight.direction.x, world.sunLight.direction.y, world.sunLight.direction.z).normalize().multiplyScalar(18); if (world.background.mode === "image") { - this.scene.background = this.loadedImageAssets[world.background.assetId]?.texture ?? null; + const texture = this.loadedImageAssets[world.background.assetId]?.texture ?? null; + this.scene.background = texture; + this.scene.environment = texture; + this.scene.environmentIntensity = world.background.environmentIntensity; return; } this.scene.background = null; + this.scene.environment = null; + this.scene.environmentIntensity = 1; } private rebuildLocalLights(document: SceneDocument) {