auto-git:

[change] src/rendering/world-background-renderer.ts
This commit is contained in:
2026-04-22 13:11:01 +02:00
parent a11063ab7b
commit 8624f6a0a2

View File

@@ -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();