UNPKG

@babylonjs/viewer

Version:

The Babylon Viewer aims to simplify a specific but common Babylon.js use case: loading, viewing, and interacting with a 3D model.

3 lines (2 loc) 2.81 kB
import{O as e,F as i,D as s}from"./index-yNtOWHHe.esm.min.js";class n{constructor(){this._renderPipelines={},this._onNewPipelineAddedObservable=new e,this._onPipelineRemovedObservable=new e}get onNewPipelineAddedObservable(){return this._onNewPipelineAddedObservable}get onPipelineRemovedObservable(){return this._onPipelineRemovedObservable}get supportedPipelines(){const e=[];for(const i in this._renderPipelines)if(Object.prototype.hasOwnProperty.call(this._renderPipelines,i)){const s=this._renderPipelines[i];s.isSupported&&e.push(s)}return e}addPipeline(e){this.removePipeline(e._name),this._renderPipelines[e._name]=e,this._onNewPipelineAddedObservable.notifyObservers(e)}removePipeline(e){const i=this._renderPipelines[e];i&&(this._onPipelineRemovedObservable.notifyObservers(i),delete this._renderPipelines[e])}attachCamerasToRenderPipeline(e,i,s=!1){const n=this._renderPipelines[e];n&&n._attachCameras(i,s)}detachCamerasFromRenderPipeline(e,i){const s=this._renderPipelines[e];s&&s._detachCameras(i)}enableEffectInPipeline(e,i,s){const n=this._renderPipelines[e];n&&n._enableEffect(i,s)}disableEffectInPipeline(e,i,s){const n=this._renderPipelines[e];n&&n._disableEffect(i,s)}update(){for(const e in this._renderPipelines)if(Object.prototype.hasOwnProperty.call(this._renderPipelines,e)){const i=this._renderPipelines[e];i.isSupported?i._update():(i.dispose(),delete this._renderPipelines[e])}}_rebuild(){for(const e in this._renderPipelines)if(Object.prototype.hasOwnProperty.call(this._renderPipelines,e)){this._renderPipelines[e]._rebuild()}}dispose(){for(const e in this._renderPipelines)if(Object.prototype.hasOwnProperty.call(this._renderPipelines,e)){this._renderPipelines[e].dispose()}}}Object.defineProperty(s.prototype,"postProcessRenderPipelineManager",{get:function(){if(!this._postProcessRenderPipelineManager){let e=this._getComponent(i.NAME_POSTPROCESSRENDERPIPELINEMANAGER);e||(e=new r(this),this._addComponent(e)),this._postProcessRenderPipelineManager=new n}return this._postProcessRenderPipelineManager},enumerable:!0,configurable:!0});class r{constructor(e){this.name=i.NAME_POSTPROCESSRENDERPIPELINEMANAGER,this.scene=e}register(){this.scene._gatherRenderTargetsStage.registerStep(i.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER,this,this._gatherRenderTargets)}rebuild(){this.scene._postProcessRenderPipelineManager&&this.scene._postProcessRenderPipelineManager._rebuild()}dispose(){this.scene._postProcessRenderPipelineManager&&this.scene._postProcessRenderPipelineManager.dispose()}_gatherRenderTargets(){this.scene._postProcessRenderPipelineManager&&this.scene._postProcessRenderPipelineManager.update()}}export{r as PostProcessRenderPipelineManagerSceneComponent}; //# sourceMappingURL=postProcessRenderPipelineManagerSceneComponent-D5ZuI2SO.esm.min.js.map