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{aZ as e,ao as i,O as s}from"./index-BPURObVq.esm.min.js";let n;class r{constructor(i){this.name=e.NAME_POSTPROCESSRENDERPIPELINEMANAGER,this.scene=i}register(){this.scene._gatherRenderTargetsStage.registerStep(e.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()}}let t=!1;function o(s){s&&(n=s),t||(t=!0,Object.defineProperty(i.prototype,"postProcessRenderPipelineManager",{get:function(){if(!this._postProcessRenderPipelineManager){let i=this._getComponent(e.NAME_POSTPROCESSRENDERPIPELINEMANAGER);i||(i=new r(this),this._addComponent(i)),this._postProcessRenderPipelineManager=new n}return this._postProcessRenderPipelineManager},enumerable:!0,configurable:!0}))}class p{constructor(){this._renderPipelines={},this._onNewPipelineAddedObservable=new s,this._onPipelineRemovedObservable=new s,o(p)}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()}}}export{p as P,o as R,r as a}; //# sourceMappingURL=postProcessRenderPipelineManager-Im9ZJXSn.esm.min.js.map