From 8624f6a0a247e5e292180c5c9cc1ef46f159e4be Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Wed, 22 Apr 2026 13:11:01 +0200 Subject: [PATCH] auto-git: [change] src/rendering/world-background-renderer.ts --- src/rendering/world-background-renderer.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/rendering/world-background-renderer.ts b/src/rendering/world-background-renderer.ts index d958599b..8875b015 100644 --- a/src/rendering/world-background-renderer.ts +++ b/src/rendering/world-background-renderer.ts @@ -59,6 +59,23 @@ export interface WorldEnvironmentState { intensity: number; } +export function shouldUseDynamicWorldEnvironment( + background: WorldBackgroundSettings, + backgroundTexture: Texture | null, + overlay: WorldBackgroundOverlayState | null +): boolean { + const overlayTexture = overlay?.texture ?? null; + const overlayOpacity = clamp(overlay?.opacity ?? 0, 0, 1); + + return ( + background.mode === "image" && + backgroundTexture !== null && + overlayTexture !== null && + overlayOpacity > NIGHT_BACKGROUND_EPSILON && + overlayOpacity < 1 - NIGHT_BACKGROUND_EPSILON + ); +} + export function resolveWorldEnvironmentState( background: WorldBackgroundSettings, backgroundTexture: Texture | null, @@ -243,6 +260,10 @@ export class WorldBackgroundRenderer { this.anchor.position.copy(camera.position); } + syncToOrigin() { + this.anchor.position.set(0, 0, 0); + } + dispose() { this.geometry.dispose(); this.gradientMaterial.dispose();