diff --git a/src/runtime-three/runtime-host.ts b/src/runtime-three/runtime-host.ts index f5ce79e7..f511d4f5 100644 --- a/src/runtime-three/runtime-host.ts +++ b/src/runtime-three/runtime-host.ts @@ -786,18 +786,12 @@ export class RuntimeHost { : null; if (fogState === null) { - if (this.scene.fog !== null) { - this.scene.fog = null; - } + this.underwaterSceneFog.density = 0; return; } this.underwaterSceneFog.color.set(fogState.colorHex); this.underwaterSceneFog.density = fogState.density; - - if (this.scene.fog !== this.underwaterSceneFog) { - this.scene.fog = this.underwaterSceneFog; - } } private getWaterReflectionMode() { diff --git a/src/viewport-three/viewport-host.ts b/src/viewport-three/viewport-host.ts index 22e9fecc..ad146ea4 100644 --- a/src/viewport-three/viewport-host.ts +++ b/src/viewport-three/viewport-host.ts @@ -190,6 +190,7 @@ interface ViewportWaterSurfaceBinding { reflectionMatrixUniform: { value: Matrix4 } | null; reflectionEnabledUniform: { value: number } | null; reflectionRenderTarget: WebGLRenderTarget | null; + lastReflectionUpdateTime: number; } const BRUSH_SELECTED_EDGE_COLOR = 0xf7d2aa; @@ -253,6 +254,7 @@ const GIZMO_RENDER_ORDER = 4_000; const SCALE_SNAP_STEP = 0.1; const MIN_SCALE_COMPONENT = 0.1; const MIN_BOX_SIZE_COMPONENT = 0.01; +const WATER_REFLECTION_UPDATE_INTERVAL_MS = 96; interface CachedMaterialTexture { signature: string;