import{O as p,a as t,b as o}from"./index-CDrXokXW.js";import"./index-DWyDLubb.js";class l{constructor(){this._renderPipelines={},this._onNewPipelineAddedObservable=new p,this._onPipelineRemovedObservable=new 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 n=this._renderPipelines[i];n.isSupported&&e.push(n)}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,n=!1){const s=this._renderPipelines[e];s&&s._attachCameras(i,n)}detachCamerasFromRenderPipeline(e,i){const n=this._renderPipelines[e];n&&n._detachCameras(i)}enableEffectInPipeline(e,i,n){const s=this._renderPipelines[e];s&&s._enableEffect(i,n)}disableEffectInPipeline(e,i,n){const s=this._renderPipelines[e];s&&s._disableEffect(i,n)}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)Object.prototype.hasOwnProperty.call(this._renderPipelines,e)&&this._renderPipelines[e]._rebuild()}dispose(){for(const e in this._renderPipelines)Object.prototype.hasOwnProperty.call(this._renderPipelines,e)&&this._renderPipelines[e].dispose()}}Object.defineProperty(o.prototype,"postProcessRenderPipelineManager",{get:function(){if(!this._postProcessRenderPipelineManager){let r=this._getComponent(t.NAME_POSTPROCESSRENDERPIPELINEMANAGER);r||(r=new a(this),this._addComponent(r)),this._postProcessRenderPipelineManager=new l}return this._postProcessRenderPipelineManager},enumerable:!0,configurable:!0});class a{constructor(e){this.name=t.NAME_POSTPROCESSRENDERPIPELINEMANAGER,this.scene=e}register(){this.scene._gatherRenderTargetsStage.registerStep(t.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{a as PostProcessRenderPipelineManagerSceneComponent};
