diff --git a/packages/viewer-sandbox/src/main.ts b/packages/viewer-sandbox/src/main.ts index 1e5cca01b9..a936e51d98 100644 --- a/packages/viewer-sandbox/src/main.ts +++ b/packages/viewer-sandbox/src/main.ts @@ -21,7 +21,6 @@ import { SectionTool } from '@speckle/viewer' import { SectionOutlines } from '@speckle/viewer' import { ViewModesKeys } from './Extensions/ViewModesKeys' import { BoxSelection } from './Extensions/BoxSelection' -import { SnowPipeline } from './Pipelines/Snow/SnowPipeline' const createViewer = async (containerName: string, _stream: string) => { const container = document.querySelector(containerName) @@ -83,9 +82,6 @@ const createViewer = async (containerName: string, _stream: string) => { Object.assign(sandbox.sceneParams.worldSize, viewer.World.worldSize) Object.assign(sandbox.sceneParams.worldOrigin, viewer.World.worldOrigin) sandbox.refresh() - const snowPipeline = new SnowPipeline(viewer.getRenderer()) - viewer.getRenderer().pipeline = snowPipeline - void snowPipeline.start() }) viewer.on(ViewerEvent.UnloadComplete, () => { diff --git a/packages/viewer/src/modules/SpeckleRenderer.ts b/packages/viewer/src/modules/SpeckleRenderer.ts index 19e2ec0963..6a2d6f3793 100644 --- a/packages/viewer/src/modules/SpeckleRenderer.ts +++ b/packages/viewer/src/modules/SpeckleRenderer.ts @@ -605,7 +605,7 @@ export default class SpeckleRenderer { this.updateHelpers() /** We'll just update the shadowcatcher after all batches are loaded */ - this.updateShadowCatcher() + this.updateShadowCatcher(true) this.updateClippingPlanes() if (this._speckleCamera) this._speckleCamera.updateCameraPlanes(this.sceneBox) delete this.cancel[renderTree.id] @@ -641,7 +641,6 @@ export default class SpeckleRenderer { public removeRenderTree(subtreeId: string) { this.rootGroup.remove(this.rootGroup.getObjectByName(subtreeId) as Object3D) - this.updateShadowCatcher() const batches = this.batcher.getBatches(subtreeId) batches.forEach((value) => { @@ -651,6 +650,7 @@ export default class SpeckleRenderer { this.batcher.purgeBatches(subtreeId) this.updateDirectLights() this.updateHelpers() + this.updateShadowCatcher(true) } public cancelRenderTree(subtreeId: string) { @@ -844,14 +844,15 @@ export default class SpeckleRenderer { this._shadowcatcher?.updateClippingPlanes(planes) } - public updateShadowCatcher() { + public updateShadowCatcher(force: boolean = false) { if (this.sunConfiguration.shadowcatcher !== undefined) this._shadowcatcher.shadowcatcherMesh.visible = this.sunConfiguration.shadowcatcher if (this.sunConfiguration.shadowcatcher) { this._shadowcatcher.bake( this.clippingVolume, - this._renderer.capabilities.maxTextureSize + this._renderer.capabilities.maxTextureSize, + force ) this.needsRender = true } diff --git a/packages/viewer/src/modules/Viewer.ts b/packages/viewer/src/modules/Viewer.ts index 0aaa797574..d0f77a118f 100644 --- a/packages/viewer/src/modules/Viewer.ts +++ b/packages/viewer/src/modules/Viewer.ts @@ -366,7 +366,7 @@ export class Viewer extends EventEmitter implements IViewer { this.speckleRenderer.removeRenderTree(resource) this.tree.getRenderTree(resource)?.purge() this.tree.purge(resource) - this.requestRender(UpdateFlags.RENDER | UpdateFlags.SHADOWS) + this.requestRender(UpdateFlags.RENDER_RESET | UpdateFlags.SHADOWS) } } finally { if (--this.inProgressOperations === 0) {