auto-git:
[change] src/rendering/world-background-renderer.ts
This commit is contained in:
@@ -59,6 +59,23 @@ export interface WorldEnvironmentState {
|
|||||||
intensity: number;
|
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(
|
export function resolveWorldEnvironmentState(
|
||||||
background: WorldBackgroundSettings,
|
background: WorldBackgroundSettings,
|
||||||
backgroundTexture: Texture | null,
|
backgroundTexture: Texture | null,
|
||||||
@@ -243,6 +260,10 @@ export class WorldBackgroundRenderer {
|
|||||||
this.anchor.position.copy(camera.position);
|
this.anchor.position.copy(camera.position);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
syncToOrigin() {
|
||||||
|
this.anchor.position.set(0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
dispose() {
|
dispose() {
|
||||||
this.geometry.dispose();
|
this.geometry.dispose();
|
||||||
this.gradientMaterial.dispose();
|
this.gradientMaterial.dispose();
|
||||||
|
|||||||
Reference in New Issue
Block a user