db87f6fe2a36f79a154eb0b3b1328566b168386522226b3b1f754929984fea01.json 13 KB

1
  1. {"ast":null,"code":"/**\n * PostProcessRenderPipelineManager class\n * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/postProcessRenderPipeline\n */\nexport class PostProcessRenderPipelineManager {\n /**\n * Initializes a PostProcessRenderPipelineManager\n * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/postProcessRenderPipeline\n */\n constructor() {\n this._renderPipelines = {};\n }\n /**\n * Gets the list of supported render pipelines\n */\n get supportedPipelines() {\n const result = [];\n for (const renderPipelineName in this._renderPipelines) {\n if (Object.prototype.hasOwnProperty.call(this._renderPipelines, renderPipelineName)) {\n const pipeline = this._renderPipelines[renderPipelineName];\n if (pipeline.isSupported) {\n result.push(pipeline);\n }\n }\n }\n return result;\n }\n /**\n * Adds a pipeline to the manager\n * @param renderPipeline The pipeline to add\n */\n addPipeline(renderPipeline) {\n this._renderPipelines[renderPipeline._name] = renderPipeline;\n }\n /**\n * Remove the pipeline from the manager\n * @param renderPipelineName the name of the pipeline to remove\n */\n removePipeline(renderPipelineName) {\n delete this._renderPipelines[renderPipelineName];\n }\n /**\n * Attaches a camera to the pipeline\n * @param renderPipelineName The name of the pipeline to attach to\n * @param cameras the camera to attach\n * @param unique if the camera can be attached multiple times to the pipeline\n */\n attachCamerasToRenderPipeline(renderPipelineName, cameras, unique = false) {\n const renderPipeline = this._renderPipelines[renderPipelineName];\n if (!renderPipeline) {\n return;\n }\n renderPipeline._attachCameras(cameras, unique);\n }\n /**\n * Detaches a camera from the pipeline\n * @param renderPipelineName The name of the pipeline to detach from\n * @param cameras the camera to detach\n */\n detachCamerasFromRenderPipeline(renderPipelineName, cameras) {\n const renderPipeline = this._renderPipelines[renderPipelineName];\n if (!renderPipeline) {\n return;\n }\n renderPipeline._detachCameras(cameras);\n }\n /**\n * Enables an effect by name on a pipeline\n * @param renderPipelineName the name of the pipeline to enable the effect in\n * @param renderEffectName the name of the effect to enable\n * @param cameras the cameras that the effect should be enabled on\n */\n enableEffectInPipeline(renderPipelineName, renderEffectName, cameras) {\n const renderPipeline = this._renderPipelines[renderPipelineName];\n if (!renderPipeline) {\n return;\n }\n renderPipeline._enableEffect(renderEffectName, cameras);\n }\n /**\n * Disables an effect by name on a pipeline\n * @param renderPipelineName the name of the pipeline to disable the effect in\n * @param renderEffectName the name of the effect to disable\n * @param cameras the cameras that the effect should be disabled on\n */\n disableEffectInPipeline(renderPipelineName, renderEffectName, cameras) {\n const renderPipeline = this._renderPipelines[renderPipelineName];\n if (!renderPipeline) {\n return;\n }\n renderPipeline._disableEffect(renderEffectName, cameras);\n }\n /**\n * Updates the state of all contained render pipelines and disposes of any non supported pipelines\n */\n update() {\n for (const renderPipelineName in this._renderPipelines) {\n if (Object.prototype.hasOwnProperty.call(this._renderPipelines, renderPipelineName)) {\n const pipeline = this._renderPipelines[renderPipelineName];\n if (!pipeline.isSupported) {\n pipeline.dispose();\n delete this._renderPipelines[renderPipelineName];\n } else {\n pipeline._update();\n }\n }\n }\n }\n /** @internal */\n _rebuild() {\n for (const renderPipelineName in this._renderPipelines) {\n if (Object.prototype.hasOwnProperty.call(this._renderPipelines, renderPipelineName)) {\n const pipeline = this._renderPipelines[renderPipelineName];\n pipeline._rebuild();\n }\n }\n }\n /**\n * Disposes of the manager and pipelines\n */\n dispose() {\n for (const renderPipelineName in this._renderPipelines) {\n if (Object.prototype.hasOwnProperty.call(this._renderPipelines, renderPipelineName)) {\n const pipeline = this._renderPipelines[renderPipelineName];\n pipeline.dispose();\n }\n }\n }\n}","map":{"version":3,"names":["PostProcessRenderPipelineManager","constructor","_renderPipelines","supportedPipelines","result","renderPipelineName","Object","prototype","hasOwnProperty","call","pipeline","isSupported","push","addPipeline","renderPipeline","_name","removePipeline","attachCamerasToRenderPipeline","cameras","unique","_attachCameras","detachCamerasFromRenderPipeline","_detachCameras","enableEffectInPipeline","renderEffectName","_enableEffect","disableEffectInPipeline","_disableEffect","update","dispose","_update","_rebuild"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/PostProcesses/RenderPipeline/postProcessRenderPipelineManager.js"],"sourcesContent":["/**\n * PostProcessRenderPipelineManager class\n * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/postProcessRenderPipeline\n */\nexport class PostProcessRenderPipelineManager {\n /**\n * Initializes a PostProcessRenderPipelineManager\n * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/postProcessRenderPipeline\n */\n constructor() {\n this._renderPipelines = {};\n }\n /**\n * Gets the list of supported render pipelines\n */\n get supportedPipelines() {\n const result = [];\n for (const renderPipelineName in this._renderPipelines) {\n if (Object.prototype.hasOwnProperty.call(this._renderPipelines, renderPipelineName)) {\n const pipeline = this._renderPipelines[renderPipelineName];\n if (pipeline.isSupported) {\n result.push(pipeline);\n }\n }\n }\n return result;\n }\n /**\n * Adds a pipeline to the manager\n * @param renderPipeline The pipeline to add\n */\n addPipeline(renderPipeline) {\n this._renderPipelines[renderPipeline._name] = renderPipeline;\n }\n /**\n * Remove the pipeline from the manager\n * @param renderPipelineName the name of the pipeline to remove\n */\n removePipeline(renderPipelineName) {\n delete this._renderPipelines[renderPipelineName];\n }\n /**\n * Attaches a camera to the pipeline\n * @param renderPipelineName The name of the pipeline to attach to\n * @param cameras the camera to attach\n * @param unique if the camera can be attached multiple times to the pipeline\n */\n attachCamerasToRenderPipeline(renderPipelineName, cameras, unique = false) {\n const renderPipeline = this._renderPipelines[renderPipelineName];\n if (!renderPipeline) {\n return;\n }\n renderPipeline._attachCameras(cameras, unique);\n }\n /**\n * Detaches a camera from the pipeline\n * @param renderPipelineName The name of the pipeline to detach from\n * @param cameras the camera to detach\n */\n detachCamerasFromRenderPipeline(renderPipelineName, cameras) {\n const renderPipeline = this._renderPipelines[renderPipelineName];\n if (!renderPipeline) {\n return;\n }\n renderPipeline._detachCameras(cameras);\n }\n /**\n * Enables an effect by name on a pipeline\n * @param renderPipelineName the name of the pipeline to enable the effect in\n * @param renderEffectName the name of the effect to enable\n * @param cameras the cameras that the effect should be enabled on\n */\n enableEffectInPipeline(renderPipelineName, renderEffectName, cameras) {\n const renderPipeline = this._renderPipelines[renderPipelineName];\n if (!renderPipeline) {\n return;\n }\n renderPipeline._enableEffect(renderEffectName, cameras);\n }\n /**\n * Disables an effect by name on a pipeline\n * @param renderPipelineName the name of the pipeline to disable the effect in\n * @param renderEffectName the name of the effect to disable\n * @param cameras the cameras that the effect should be disabled on\n */\n disableEffectInPipeline(renderPipelineName, renderEffectName, cameras) {\n const renderPipeline = this._renderPipelines[renderPipelineName];\n if (!renderPipeline) {\n return;\n }\n renderPipeline._disableEffect(renderEffectName, cameras);\n }\n /**\n * Updates the state of all contained render pipelines and disposes of any non supported pipelines\n */\n update() {\n for (const renderPipelineName in this._renderPipelines) {\n if (Object.prototype.hasOwnProperty.call(this._renderPipelines, renderPipelineName)) {\n const pipeline = this._renderPipelines[renderPipelineName];\n if (!pipeline.isSupported) {\n pipeline.dispose();\n delete this._renderPipelines[renderPipelineName];\n }\n else {\n pipeline._update();\n }\n }\n }\n }\n /** @internal */\n _rebuild() {\n for (const renderPipelineName in this._renderPipelines) {\n if (Object.prototype.hasOwnProperty.call(this._renderPipelines, renderPipelineName)) {\n const pipeline = this._renderPipelines[renderPipelineName];\n pipeline._rebuild();\n }\n }\n }\n /**\n * Disposes of the manager and pipelines\n */\n dispose() {\n for (const renderPipelineName in this._renderPipelines) {\n if (Object.prototype.hasOwnProperty.call(this._renderPipelines, renderPipelineName)) {\n const pipeline = this._renderPipelines[renderPipelineName];\n pipeline.dispose();\n }\n }\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA,OAAO,MAAMA,gCAAgC,CAAC;EAC1C;AACJ;AACA;AACA;EACIC,WAAWA,CAAA,EAAG;IACV,IAAI,CAACC,gBAAgB,GAAG,CAAC,CAAC;EAC9B;EACA;AACJ;AACA;EACI,IAAIC,kBAAkBA,CAAA,EAAG;IACrB,MAAMC,MAAM,GAAG,E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