Refactor fog handling and add reflection update timestamp
This commit is contained in:
@@ -786,18 +786,12 @@ export class RuntimeHost {
|
|||||||
: null;
|
: null;
|
||||||
|
|
||||||
if (fogState === null) {
|
if (fogState === null) {
|
||||||
if (this.scene.fog !== null) {
|
this.underwaterSceneFog.density = 0;
|
||||||
this.scene.fog = null;
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.underwaterSceneFog.color.set(fogState.colorHex);
|
this.underwaterSceneFog.color.set(fogState.colorHex);
|
||||||
this.underwaterSceneFog.density = fogState.density;
|
this.underwaterSceneFog.density = fogState.density;
|
||||||
|
|
||||||
if (this.scene.fog !== this.underwaterSceneFog) {
|
|
||||||
this.scene.fog = this.underwaterSceneFog;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private getWaterReflectionMode() {
|
private getWaterReflectionMode() {
|
||||||
|
|||||||
@@ -190,6 +190,7 @@ interface ViewportWaterSurfaceBinding {
|
|||||||
reflectionMatrixUniform: { value: Matrix4 } | null;
|
reflectionMatrixUniform: { value: Matrix4 } | null;
|
||||||
reflectionEnabledUniform: { value: number } | null;
|
reflectionEnabledUniform: { value: number } | null;
|
||||||
reflectionRenderTarget: WebGLRenderTarget | null;
|
reflectionRenderTarget: WebGLRenderTarget | null;
|
||||||
|
lastReflectionUpdateTime: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
const BRUSH_SELECTED_EDGE_COLOR = 0xf7d2aa;
|
const BRUSH_SELECTED_EDGE_COLOR = 0xf7d2aa;
|
||||||
@@ -253,6 +254,7 @@ const GIZMO_RENDER_ORDER = 4_000;
|
|||||||
const SCALE_SNAP_STEP = 0.1;
|
const SCALE_SNAP_STEP = 0.1;
|
||||||
const MIN_SCALE_COMPONENT = 0.1;
|
const MIN_SCALE_COMPONENT = 0.1;
|
||||||
const MIN_BOX_SIZE_COMPONENT = 0.01;
|
const MIN_BOX_SIZE_COMPONENT = 0.01;
|
||||||
|
const WATER_REFLECTION_UPDATE_INTERVAL_MS = 96;
|
||||||
|
|
||||||
interface CachedMaterialTexture {
|
interface CachedMaterialTexture {
|
||||||
signature: string;
|
signature: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user