auto-git:
[change] src/viewport-three/viewport-host.ts
This commit is contained in:
@@ -215,6 +215,10 @@ import {
|
|||||||
resolveWorldEnvironmentState,
|
resolveWorldEnvironmentState,
|
||||||
WorldBackgroundRenderer
|
WorldBackgroundRenderer
|
||||||
} from "../rendering/world-background-renderer";
|
} from "../rendering/world-background-renderer";
|
||||||
|
import {
|
||||||
|
createRendererQuantizedEnvironmentBlendCache,
|
||||||
|
type QuantizedEnvironmentBlendCache
|
||||||
|
} from "../rendering/quantized-environment-blend-cache";
|
||||||
import {
|
import {
|
||||||
applyWhiteboxBevelToMaterial,
|
applyWhiteboxBevelToMaterial,
|
||||||
shouldApplyWhiteboxBevel
|
shouldApplyWhiteboxBevel
|
||||||
@@ -510,6 +514,7 @@ export class ViewportHost {
|
|||||||
CachedMaterialTexture
|
CachedMaterialTexture
|
||||||
>();
|
>();
|
||||||
private readonly materialTextureLoader = new TextureLoader();
|
private readonly materialTextureLoader = new TextureLoader();
|
||||||
|
private readonly environmentBlendCache: QuantizedEnvironmentBlendCache;
|
||||||
private currentDocument: SceneDocument | null = null;
|
private currentDocument: SceneDocument | null = null;
|
||||||
private currentWorld: WorldSettings | null = null;
|
private currentWorld: WorldSettings | null = null;
|
||||||
private currentSimulationScene: RuntimeSceneDefinition | null = null;
|
private currentSimulationScene: RuntimeSceneDefinition | null = null;
|
||||||
@@ -679,6 +684,14 @@ export class ViewportHost {
|
|||||||
this.scene.add(this.boxCreatePreviewEdges);
|
this.scene.add(this.boxCreatePreviewEdges);
|
||||||
this.renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
|
this.renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
|
||||||
this.renderer.setClearAlpha(0);
|
this.renderer.setClearAlpha(0);
|
||||||
|
this.environmentBlendCache = createRendererQuantizedEnvironmentBlendCache(
|
||||||
|
this.renderer,
|
||||||
|
{
|
||||||
|
onTextureReady: () => {
|
||||||
|
this.applyWorld();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
this.applyViewModePose();
|
this.applyViewModePose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -805,6 +818,7 @@ export class ViewportHost {
|
|||||||
this.projectAssets = projectAssets;
|
this.projectAssets = projectAssets;
|
||||||
this.loadedModelAssets = loadedModelAssets;
|
this.loadedModelAssets = loadedModelAssets;
|
||||||
this.loadedImageAssets = loadedImageAssets;
|
this.loadedImageAssets = loadedImageAssets;
|
||||||
|
this.environmentBlendCache.clear();
|
||||||
|
|
||||||
if (this.currentWorld !== null) {
|
if (this.currentWorld !== null) {
|
||||||
this.applyWorld();
|
this.applyWorld();
|
||||||
@@ -1235,6 +1249,7 @@ export class ViewportHost {
|
|||||||
this.terrainBrushPreviewLine.material.dispose();
|
this.terrainBrushPreviewLine.material.dispose();
|
||||||
this.terrainBrushPreviewCenter.geometry.dispose();
|
this.terrainBrushPreviewCenter.geometry.dispose();
|
||||||
this.terrainBrushPreviewCenter.material.dispose();
|
this.terrainBrushPreviewCenter.material.dispose();
|
||||||
|
this.environmentBlendCache.dispose();
|
||||||
this.worldBackgroundRenderer.dispose();
|
this.worldBackgroundRenderer.dispose();
|
||||||
this.renderer.forceContextLoss();
|
this.renderer.forceContextLoss();
|
||||||
this.renderer.dispose();
|
this.renderer.dispose();
|
||||||
|
|||||||
Reference in New Issue
Block a user