1 |
- {"ast":null,"code":"import { Observable } from \"../../Misc/observable.js\";\nimport { Matrix, Vector3 } from \"../../Maths/math.vector.js\";\nimport { Texture } from \"../../Materials/Textures/texture.js\";\nimport { PostProcessManager } from \"../../PostProcesses/postProcessManager.js\";\nimport { FloorPOT, NearestPOT } from \"../../Misc/tools.functions.js\";\nimport { Effect } from \"../effect.js\";\nimport { Logger } from \"../../Misc/logger.js\";\nimport { ObjectRenderer } from \"../../Rendering/objectRenderer.js\";\n/**\n * Sets a depth stencil texture from a render target on the engine to be used in the shader.\n * @param channel Name of the sampler variable.\n * @param texture Texture to set.\n */\nEffect.prototype.setDepthStencilTexture = function (channel, texture) {\n this._engine.setDepthStencilTexture(this._samplers[channel], this._uniforms[channel], texture, channel);\n};\n/**\n * This Helps creating a texture that will be created from a camera in your scene.\n * It is basically a dynamic texture that could be used to create special effects for instance.\n * Actually, It is the base of lot of effects in the framework like post process, shadows, effect layers and rendering pipelines...\n */\nexport class RenderTargetTexture extends Texture {\n /**\n * Use this predicate to dynamically define the list of mesh you want to render.\n * If set, the renderList property will be overwritten.\n */\n get renderListPredicate() {\n return this._objectRenderer.renderListPredicate;\n }\n set renderListPredicate(value) {\n this._objectRenderer.renderListPredicate = value;\n }\n /**\n * Use this list to define the list of mesh you want to render.\n */\n get renderList() {\n return this._objectRenderer.renderList;\n }\n set renderList(value) {\n this._objectRenderer.renderList = value;\n }\n /**\n * Define the list of particle systems to render in the texture. If not provided, will render all the particle systems of the scene.\n * Note that the particle systems are rendered only if renderParticles is set to true.\n */\n get particleSystemList() {\n return this._objectRenderer.particleSystemList;\n }\n set particleSystemList(value) {\n this._objectRenderer.particleSystemList = value;\n }\n /**\n * Use this function to overload the renderList array at rendering time.\n * Return null to render with the current renderList, else return the list of meshes to use for rendering.\n * For 2DArray RTT, layerOrFace is the index of the layer that is going to be rendered, else it is the faceIndex of\n * the cube (if the RTT is a cube, else layerOrFace=0).\n * The renderList passed to the function is the current render list (the one that will be used if the function returns null).\n * The length of this list is passed through renderListLength: don't use renderList.length directly because the array can\n * hold dummy elements!\n */\n get getCustomRenderList() {\n return this._objectRenderer.getCustomRenderList;\n }\n set getCustomRenderList(value) {\n this._objectRenderer.getCustomRenderList = value;\n }\n /**\n * Define if particles should be rendered in your texture (default: true).\n */\n get renderParticles() {\n return this._objectRenderer.renderParticles;\n }\n set renderParticles(value) {\n this._objectRenderer.renderParticles = value;\n }\n /**\n * Define if sprites should be rendered in your texture (default: false).\n */\n get renderSprites() {\n return this._objectRenderer.renderSprites;\n }\n set renderSprites(value) {\n this._objectRenderer.renderSprites = value;\n }\n /**\n * Force checking the layerMask property even if a custom list of meshes is provided (ie. if renderList is not undefined) (default: false).\n */\n get forceLayerMaskCheck() {\n return this._objectRenderer.forceLayerMaskCheck;\n }\n set forceLayerMaskCheck(value) {\n this._objectRenderer.forceLayerMaskCheck = value;\n }\n /**\n * Define the camera used to render the texture.\n */\n get activeCamera() {\n return this._objectRenderer.activeCamera;\n }\n set activeCamera(value) {\n this._objectRenderer.activeCamera = value;\n }\n /**\n * Override the mesh isReady function with your own one.\n */\n get customIsReadyFunction() {\n return this._objectRenderer.customIsReadyFunction;\n }\n set customIsReadyFunction(value) {\n this._objectRenderer.customIsReadyFunction = value;\n }\n /**\n * Override the render function of the texture with your own one.\n */\n get customRenderFunction() {\n return this._objectRenderer.customRenderFunction;\n }\n set customRenderFunction(value) {\n this._objectRenderer.customRenderFunction = value;\n }\n /**\n * Post-processes for this render target\n */\n get postProcesses() {\n return this._postProcesses;\n }\n get _prePassEnabled() {\n return !!this._prePassRenderTarget && this._prePassRenderTarget.enabled;\n }\n /**\n * Set a after unbind callback in the texture.\n * This has been kept for backward compatibility and use of onAfterUnbindObservable is recommended.\n */\n set onAfterUnbind(callback) {\n if (this._onAfterUnbindObserver) {\n this.onAfterUnbindObservable.remove(this._onAfterUnbindObserver);\n }\n this._onAfterUnbindObserver = this.onAfterUnbindObservable.add(callback);\n }\n /**\n * An event triggered before rendering the texture\n */\n get onBeforeRenderObservable() {\n return this._objectRenderer.onBeforeRenderObservable;\n }\n /**\n * Set a before render callback in the texture.\n * This has been kept for backward compatibility and use of onBeforeRenderObservable is recommended.\n */\n set onBeforeRender(callback) {\n if (this._onBeforeRenderObserver) {\n this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver);\n }\n this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(callback);\n }\n /**\n * An event triggered after rendering the texture\n */\n get onAfterRenderObservable() {\n return this._objectRenderer.onAfterRenderObservable;\n }\n /**\n * Set a after render callback in the texture.\n * This has been kept for backward compatibility and use of onAfterRenderObservable is recommended.\n */\n set onAfterRender(callback) {\n if (this._onAfterRenderObserver) {\n this.onAfterRenderObservable.remove(this._onAfterRenderObserver);\n }\n this._onAfterRenderObserver = this.onAfterRenderObservable.add(callback);\n }\n /**\n * Set a clear callback in the texture.\n * This has been kept for backward compatibility and use of onClearObservable is recommended.\n */\n set onClear(callback) {\n if (this._onClearObserver) {\n this.onClearObservable.remove(this._onClearObserver);\n }\n this._onClearObserver = this.onClearObservable.add(callback);\n }\n /** @internal */\n get _waitingRenderList() {\n return this._objectRenderer._waitingRenderList;\n }\n /** @internal */\n set _waitingRenderList(value) {\n this._objectRenderer._waitingRenderList = value;\n }\n /**\n * Current render pass id of the render target texture. Note it can change over the rendering as there's a separate id for each face of a cube / each layer of an array layer!\n */\n get renderPassId() {\n return this._objectRenderer.renderPassId;\n }\n /**\n * Gets the render pass ids used by the render target texture. For a single render target the array length will be 1, for a cube texture it will be 6 and for\n * a 2D texture array it will return an array of ids the size of the 2D texture array\n */\n get renderPassIds() {\n return this._objectRenderer.renderPassIds;\n }\n /**\n * Gets the current value of the refreshId counter\n */\n get currentRefreshId() {\n return this._objectRenderer.currentRefreshId;\n }\n /**\n * Sets a specific material to be used to render a mesh/a list of meshes in this render target texture\n * @param mesh mesh or array of meshes\n * @param material material or array of materials to use for this render pass. If undefined is passed, no specific material will be used but the regular material instead (mesh.material). It's possible to provide an array of materials to use a different material for each rendering in the case of a cube texture (6 rendering) and a 2D texture array (as many rendering as the length of the array)\n */\n setMaterialForRendering(mesh, material) {\n this._objectRenderer.setMaterialForRendering(mesh, material);\n }\n /**\n * Define if the texture has multiple draw buffers or if false a single draw buffer.\n */\n get isMulti() {\n var _this$_renderTarget$i, _this$_renderTarget;\n return (_this$_renderTarget$i = (_this$_renderTarget = this._renderTarget) === null || _this$_renderTarget === void 0 ? void 0 : _this$_renderTarget.isMulti) !== null && _this$_renderTarget$i !== void 0 ? _this$_renderTarget$i : false;\n }\n /**\n * Gets render target creation options that were used.\n */\n get renderTargetOptions() {\n return this._renderTargetOptions;\n }\n /**\n * Gets the render target wrapper associated with this render target\n */\n get renderTarget() {\n return this._renderTarget;\n }\n _onRatioRescale() {\n if (this._sizeRatio) {\n this.resize(this._initialSizeParameter);\n }\n }\n /**\n * Gets or sets the size of the bounding box associated with the texture (when in cube mode)\n * When defined, the cubemap will switch to local mode\n * @see https://community.arm.com/graphics/b/blog/posts/reflections-based-on-local-cubemaps-in-unity\n * @example https://www.babylonjs-playground.com/#RNASML\n */\n set boundingBoxSize(value) {\n if (this._boundingBoxSize && this._boundingBoxSize.equals(value)) {\n return;\n }\n this._boundingBoxSize = value;\n const scene = this.getScene();\n if (scene) {\n scene.markAllMaterialsAsDirty(1);\n }\n }\n get boundingBoxSize() {\n return this._boundingBoxSize;\n }\n /**\n * In case the RTT has been created with a depth texture, get the associated\n * depth texture.\n * Otherwise, return null.\n */\n get depthStencilTexture() {\n var _this$_renderTarget$_, _this$_renderTarget2;\n return (_this$_renderTarget$_ = (_this$_renderTarget2 = this._renderTarget) === null || _this$_renderTarget2 === void 0 ? void 0 : _this$_renderTarget2._depthStencilTexture) !== null && _this$_renderTarget$_ !== void 0 ? _this$_renderTarget$_ : null;\n }\n /** @internal */\n constructor(name, size, scene, generateMipMaps = false, doNotChangeAspectRatio = true, type = 0, isCube = false, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, generateDepthBuffer = true, generateStencilBuffer = false, isMulti = false, format = 5, delayAllocation = false, samples, creationFlags, noColorAttachment = false, useSRGBBuffer = false) {\n var _this$_format;\n let colorAttachment = undefined;\n let gammaSpace = true;\n if (typeof generateMipMaps === \"object\") {\n var _options$doNotChangeA, _options$type, _options$samplingMode, _options$generateDept, _options$format, _options$gammaSpace;\n const options = generateMipMaps;\n generateMipMaps = !!options.generateMipMaps;\n doNotChangeAspectRatio = (_options$doNotChangeA = options.doNotChangeAspectRatio) !== null && _options$doNotChangeA !== void 0 ? _options$doNotChangeA : true;\n type = (_options$type = options.type) !== null && _options$type !== void 0 ? _options$type : 0;\n isCube = !!options.isCube;\n samplingMode = (_options$samplingMode = options.samplingMode) !== null && _options$samplingMode !== void 0 ? _options$samplingMode : Texture.TRILINEAR_SAMPLINGMODE;\n generateDepthBuffer = (_options$generateDept = options.generateDepthBuffer) !== null && _options$generateDept !== void 0 ? _options$generateDept : true;\n generateStencilBuffer = !!options.generateStencilBuffer;\n isMulti = !!options.isMulti;\n format = (_options$format = options.format) !== null && _options$format !== void 0 ? _options$format : 5;\n delayAllocation = !!options.delayAllocation;\n samples = options.samples;\n creationFlags = options.creationFlags;\n noColorAttachment = !!options.noColorAttachment;\n useSRGBBuffer = !!options.useSRGBBuffer;\n colorAttachment = options.colorAttachment;\n gammaSpace = (_options$gammaSpace = options.gammaSpace) !== null && _options$gammaSpace !== void 0 ? _options$gammaSpace : gammaSpace;\n }\n super(null, scene, !generateMipMaps, undefined, samplingMode, undefined, undefined, undefined, undefined, format);\n /**\n * Define if the camera viewport should be respected while rendering the texture or if the render should be done to the entire texture.\n */\n this.ignoreCameraViewport = false;\n /**\n * An event triggered when the texture is unbind.\n */\n this.onBeforeBindObservable = new Observable();\n /**\n * An event triggered when the texture is unbind.\n */\n this.onAfterUnbindObservable = new Observable();\n /**\n * An event triggered after the texture clear\n */\n this.onClearObservable = new Observable();\n /**\n * An event triggered when the texture is resized.\n */\n this.onResizeObservable = new Observable();\n /** @internal */\n this._cleared = false;\n /**\n * Skip the initial clear of the rtt at the beginning of the frame render loop\n */\n this.skipInitialClear = false;\n this._samples = 1;\n this._canRescale = true;\n this._renderTarget = null;\n /**\n * Gets or sets the center of the bounding box associated with the texture (when in cube mode)\n * It must define where the camera used to render the texture is set\n */\n this.boundingBoxPosition = Vector3.Zero();\n this._dumpToolsLoading = false;\n scene = this.getScene();\n if (!scene) {\n return;\n }\n const engine = this.getScene().getEngine();\n this._gammaSpace = gammaSpace;\n this._coordinatesMode = Texture.PROJECTION_MODE;\n this.name = name;\n this.isRenderTarget = true;\n this._initialSizeParameter = size;\n this._processSizeParameter(size);\n this._objectRenderer = new ObjectRenderer(name, scene, {\n numPasses: isCube ? 6 : this.getRenderLayers() || 1,\n doNotChangeAspectRatio\n });\n this._objectRenderer.onBeforeRenderingManagerRenderObservable.add(() => {\n // Before clear\n for (const step of this._scene._beforeRenderTargetClearStage) {\n step.action(this, this._currentFaceIndex, this._currentLayer);\n }\n // Clear\n if (this.onClearObservable.hasObservers()) {\n this.onClearObservable.notifyObservers(engine);\n } else if (!this.skipInitialClear) {\n engine.clear(this.clearColor || this._scene.clearColor, true, true, true);\n }\n if (!this._doNotChangeAspectRatio) {\n this._scene.updateTransformMatrix(true);\n }\n // Before Camera Draw\n for (const step of this._scene._beforeRenderTargetDrawStage) {\n step.action(this, this._currentFaceIndex, this._currentLayer);\n }\n });\n this._objectRenderer.onAfterRenderingManagerRenderObservable.add(() => {\n var _this$_texture$genera, _this$_texture;\n // After Camera Draw\n for (const step of this._scene._afterRenderTargetDrawStage) {\n step.action(this, this._currentFaceIndex, this._currentLayer);\n }\n const saveGenerateMipMaps = (_this$_texture$genera = (_this$_texture = this._texture) === null || _this$_texture === void 0 ? void 0 : _this$_texture.generateMipMaps) !== null && _this$_texture$genera !== void 0 ? _this$_texture$genera : false;\n if (this._texture) {\n this._texture.generateMipMaps = false; // if left true, the mipmaps will be generated (if this._texture.generateMipMaps = true) when the first post process binds its own RTT: by doing so it will unbind the current RTT,\n // which will trigger a mipmap generation. We don't want this because it's a wasted work, we will do an unbind of the current RTT at the end of the process (see unbindFrameBuffer) which will\n // trigger the generation of the final mipmaps\n }\n if (this._postProcessManager) {\n var _this$_renderTarget3;\n this._postProcessManager._finalizeFrame(false, (_this$_renderTarget3 = this._renderTarget) !== null && _this$_renderTarget3 !== void 0 ? _this$_renderTarget3 : undefined, this._currentFaceIndex, this._postProcesses, this.ignoreCameraViewport);\n } else if (this._currentUseCameraPostProcess) {\n var _this$_renderTarget4;\n this._scene.postProcessManager._finalizeFrame(false, (_this$_renderTarget4 = this._renderTarget) !== null && _this$_renderTarget4 !== void 0 ? _this$_renderTarget4 : undefined, this._currentFaceIndex);\n }\n for (const step of this._scene._afterRenderTargetPostProcessStage) {\n step.action(this, this._currentFaceIndex, this._currentLayer);\n }\n if (this._texture) {\n this._texture.generateMipMaps = saveGenerateMipMaps;\n }\n if (!this._doNotChangeAspectRatio) {\n this._scene.updateTransformMatrix(true);\n }\n // Dump ?\n if (this._currentDumpForDebug) {\n if (!this._dumpTools) {\n Logger.Error(\"dumpTools module is still being loaded. To speed up the process import dump tools directly in your project\");\n } else {\n this._dumpTools.DumpFramebuffer(this.getRenderWidth(), this.getRenderHeight(), engine);\n }\n }\n });\n this._objectRenderer.onFastPathRenderObservable.add(() => {\n if (this.onClearObservable.hasObservers()) {\n this.onClearObservable.notifyObservers(engine);\n } else {\n if (!this.skipInitialClear) {\n engine.clear(this.clearColor || this._scene.clearColor, true, true, true);\n }\n }\n });\n this._resizeObserver = engine.onResizeObservable.add(() => {});\n this._generateMipMaps = generateMipMaps ? true : false;\n this._doNotChangeAspectRatio = doNotChangeAspectRatio;\n if (isMulti) {\n return;\n }\n this._renderTargetOptions = {\n generateMipMaps: generateMipMaps,\n type: type,\n format: (_this$_format = this._format) !== null && _this$_format !== void 0 ? _this$_format : undefined,\n samplingMode: this.samplingMode,\n generateDepthBuffer: generateDepthBuffer,\n generateStencilBuffer: generateStencilBuffer,\n samples,\n creationFlags,\n noColorAttachment: noColorAttachment,\n useSRGBBuffer,\n colorAttachment: colorAttachment,\n label: this.name\n };\n if (this.samplingMode === Texture.NEAREST_SAMPLINGMODE) {\n this.wrapU = Texture.CLAMP_ADDRESSMODE;\n this.wrapV = Texture.CLAMP_ADDRESSMODE;\n }\n if (!delayAllocation) {\n if (isCube) {\n this._renderTarget = scene.getEngine().createRenderTargetCubeTexture(this.getRenderSize(), this._renderTargetOptions);\n this.coordinatesMode = Texture.INVCUBIC_MODE;\n this._textureMatrix = Matrix.Identity();\n } else {\n this._renderTarget = scene.getEngine().createRenderTargetTexture(this._size, this._renderTargetOptions);\n }\n this._texture = this._renderTarget.texture;\n if (samples !== undefined) {\n this.samples = samples;\n }\n }\n }\n /**\n * Creates a depth stencil texture.\n * This is only available in WebGL 2 or with the depth texture extension available.\n * @param comparisonFunction Specifies the comparison function to set on the texture. If 0 or undefined, the texture is not in comparison mode (default: 0)\n * @param bilinearFiltering Specifies whether or not bilinear filtering is enable on the texture (default: true)\n * @param generateStencil Specifies whether or not a stencil should be allocated in the texture (default: false)\n * @param samples sample count of the depth/stencil texture (default: 1)\n * @param format format of the depth texture (default: 14)\n * @param label defines the label of the texture (for debugging purpose)\n */\n createDepthStencilTexture(comparisonFunction = 0, bilinearFiltering = true, generateStencil = false, samples = 1, format = 14, label) {\n var _this$_renderTarget5;\n (_this$_renderTarget5 = this._renderTarget) === null || _this$_renderTarget5 === void 0 || _this$_renderTarget5.createDepthStencilTexture(comparisonFunction, bilinearFiltering, generateStencil, samples, format, label);\n }\n _processSizeParameter(size) {\n if (size.ratio) {\n this._sizeRatio = size.ratio;\n const engine = this._getEngine();\n this._size = {\n width: this._bestReflectionRenderTargetDimension(engine.getRenderWidth(), this._sizeRatio),\n height: this._bestReflectionRenderTargetDimension(engine.getRenderHeight(), this._sizeRatio)\n };\n } else {\n this._size = size;\n }\n }\n /**\n * Define the number of samples to use in case of MSAA.\n * It defaults to one meaning no MSAA has been enabled.\n */\n get samples() {\n var _this$_renderTarget$s, _this$_renderTarget6;\n return (_this$_renderTarget$s = (_this$_renderTarget6 = this._renderTarget) === null || _this$_renderTarget6 === void 0 ? void 0 : _this$_renderTarget6.samples) !== null && _this$_renderTarget$s !== void 0 ? _this$_renderTarget$s : this._samples;\n }\n set samples(value) {\n if (this._renderTarget) {\n this._samples = this._renderTarget.setSamples(value);\n }\n }\n /**\n * Adds a post process to the render target rendering passes.\n * @param postProcess define the post process to add\n */\n addPostProcess(postProcess) {\n if (!this._postProcessManager) {\n const scene = this.getScene();\n if (!scene) {\n return;\n }\n this._postProcessManager = new PostProcessManager(scene);\n this._postProcesses = new Array();\n }\n this._postProcesses.push(postProcess);\n this._postProcesses[0].autoClear = false;\n }\n /**\n * Clear all the post processes attached to the render target\n * @param dispose define if the cleared post processes should also be disposed (false by default)\n */\n clearPostProcesses(dispose = false) {\n if (!this._postProcesses) {\n return;\n }\n if (dispose) {\n for (const postProcess of this._postProcesses) {\n postProcess.dispose();\n }\n }\n this._postProcesses = [];\n }\n /**\n * Remove one of the post process from the list of attached post processes to the texture\n * @param postProcess define the post process to remove from the list\n */\n removePostProcess(postProcess) {\n if (!this._postProcesses) {\n return;\n }\n const index = this._postProcesses.indexOf(postProcess);\n if (index === -1) {\n return;\n }\n this._postProcesses.splice(index, 1);\n if (this._postProcesses.length > 0) {\n this._postProcesses[0].autoClear = false;\n }\n }\n /**\n * Resets the refresh counter of the texture and start bak from scratch.\n * Could be useful to regenerate the texture if it is setup to render only once.\n */\n resetRefreshCounter() {\n this._objectRenderer.resetRefreshCounter();\n }\n /**\n * Define the refresh rate of the texture or the rendering frequency.\n * Use 0 to render just once, 1 to render on every frame, 2 to render every two frames and so on...\n */\n get refreshRate() {\n return this._objectRenderer.refreshRate;\n }\n set refreshRate(value) {\n this._objectRenderer.refreshRate = value;\n }\n /** @internal */\n _shouldRender() {\n return this._objectRenderer.shouldRender();\n }\n /**\n * Gets the actual render size of the texture.\n * @returns the width of the render size\n */\n getRenderSize() {\n return this.getRenderWidth();\n }\n /**\n * Gets the actual render width of the texture.\n * @returns the width of the render size\n */\n getRenderWidth() {\n if (this._size.width) {\n return this._size.width;\n }\n return this._size;\n }\n /**\n * Gets the actual render height of the texture.\n * @returns the height of the render size\n */\n getRenderHeight() {\n if (this._size.width) {\n return this._size.height;\n }\n return this._size;\n }\n /**\n * Gets the actual number of layers of the texture or, in the case of a 3D texture, return the depth.\n * @returns the number of layers\n */\n getRenderLayers() {\n const layers = this._size.layers;\n if (layers) {\n return layers;\n }\n const depth = this._size.depth;\n if (depth) {\n return depth;\n }\n return 0;\n }\n /**\n * Don't allow this render target texture to rescale. Mainly used to prevent rescaling by the scene optimizer.\n */\n disableRescaling() {\n this._canRescale = false;\n }\n /**\n * Get if the texture can be rescaled or not.\n */\n get canRescale() {\n return this._canRescale;\n }\n /**\n * Resize the texture using a ratio.\n * @param ratio the ratio to apply to the texture size in order to compute the new target size\n */\n scale(ratio) {\n const newSize = Math.max(1, this.getRenderSize() * ratio);\n this.resize(newSize);\n }\n /**\n * Get the texture reflection matrix used to rotate/transform the reflection.\n * @returns the reflection matrix\n */\n getReflectionTextureMatrix() {\n if (this.isCube) {\n return this._textureMatrix;\n }\n return super.getReflectionTextureMatrix();\n }\n /**\n * Resize the texture to a new desired size.\n * Be careful as it will recreate all the data in the new texture.\n * @param size Define the new size. It can be:\n * - a number for squared texture,\n * - an object containing { width: number, height: number }\n * - or an object containing a ratio { ratio: number }\n */\n resize(size) {\n var _this$_renderTarget7;\n const wasCube = this.isCube;\n (_this$_renderTarget7 = this._renderTarget) === null || _this$_renderTarget7 === void 0 || _this$_renderTarget7.dispose();\n this._renderTarget = null;\n const scene = this.getScene();\n if (!scene) {\n return;\n }\n this._processSizeParameter(size);\n if (wasCube) {\n this._renderTarget = scene.getEngine().createRenderTargetCubeTexture(this.getRenderSize(), this._renderTargetOptions);\n } else {\n this._renderTarget = scene.getEngine().createRenderTargetTexture(this._size, this._renderTargetOptions);\n }\n this._texture = this._renderTarget.texture;\n if (this._renderTargetOptions.samples !== undefined) {\n this.samples = this._renderTargetOptions.samples;\n }\n if (this.onResizeObservable.hasObservers()) {\n this.onResizeObservable.notifyObservers(this);\n }\n }\n /**\n * Renders all the objects from the render list into the texture.\n * @param useCameraPostProcess Define if camera post processes should be used during the rendering\n * @param dumpForDebug Define if the rendering result should be dumped (copied) for debugging purpose\n */\n render(useCameraPostProcess = false, dumpForDebug = false) {\n this._render(useCameraPostProcess, dumpForDebug);\n }\n /**\n * This function will check if the render target texture can be rendered (textures are loaded, shaders are compiled)\n * @returns true if all required resources are ready\n */\n isReadyForRendering() {\n if (!this._dumpToolsLoading) {\n this._dumpToolsLoading = true;\n // avoid a static import to allow ignoring the import in some cases\n import(\"../../Misc/dumpTools.js\").then(module => this._dumpTools = module);\n }\n this._objectRenderer.prepareRenderList();\n this.onBeforeBindObservable.notifyObservers(this);\n this._objectRenderer.initRender(this.getRenderWidth(), this.getRenderHeight());\n const isReady = this._objectRenderer._checkReadiness();\n this.onAfterUnbindObservable.notifyObservers(this);\n this._objectRenderer.finishRender();\n return isReady;\n }\n _render(useCameraPostProcess = false, dumpForDebug = false) {\n const scene = this.getScene();\n if (!scene) {\n return;\n }\n if (this.useCameraPostProcesses !== undefined) {\n useCameraPostProcess = this.useCameraPostProcesses;\n }\n this._objectRenderer.prepareRenderList();\n this.onBeforeBindObservable.notifyObservers(this);\n this._objectRenderer.initRender(this.getRenderWidth(), this.getRenderHeight());\n if ((this.is2DArray || this.is3D) && !this.isMulti) {\n for (let layer = 0; layer < this.getRenderLayers(); layer++) {\n this._renderToTarget(0, useCameraPostProcess, dumpForDebug, layer);\n scene.incrementRenderId();\n scene.resetCachedMaterial();\n }\n } else if (this.isCube && !this.isMulti) {\n for (let face = 0; face < 6; face++) {\n this._renderToTarget(face, useCameraPostProcess, dumpForDebug);\n scene.incrementRenderId();\n scene.resetCachedMaterial();\n }\n } else {\n this._renderToTarget(0, useCameraPostProcess, dumpForDebug);\n }\n this.onAfterUnbindObservable.notifyObservers(this);\n this._objectRenderer.finishRender();\n }\n _bestReflectionRenderTargetDimension(renderDimension, scale) {\n const minimum = 128;\n const x = renderDimension * scale;\n const curved = NearestPOT(x + minimum * minimum / (minimum + x));\n // Ensure we don't exceed the render dimension (while staying POT)\n return Math.min(FloorPOT(renderDimension), curved);\n }\n /**\n * @internal\n * @param faceIndex face index to bind to if this is a cubetexture\n * @param layer defines the index of the texture to bind in the array\n */\n _bindFrameBuffer(faceIndex = 0, layer = 0) {\n const scene = this.getScene();\n if (!scene) {\n return;\n }\n const engine = scene.getEngine();\n if (this._renderTarget) {\n engine.bindFramebuffer(this._renderTarget, this.isCube ? faceIndex : undefined, undefined, undefined, this.ignoreCameraViewport, 0, layer);\n }\n }\n _unbindFrameBuffer(engine, faceIndex) {\n if (!this._renderTarget) {\n return;\n }\n engine.unBindFramebuffer(this._renderTarget, this.isCube, () => {\n this.onAfterRenderObservable.notifyObservers(faceIndex);\n });\n }\n /**\n * @internal\n */\n _prepareFrame(scene, faceIndex, layer, useCameraPostProcess) {\n if (this._postProcessManager) {\n if (!this._prePassEnabled) {\n this._postProcessManager._prepareFrame(this._texture, this._postProcesses);\n }\n } else if (!useCameraPostProcess || !scene.postProcessManager._prepareFrame(this._texture)) {\n this._bindFrameBuffer(faceIndex, layer);\n }\n }\n _renderToTarget(faceIndex, useCameraPostProcess, dumpForDebug, layer = 0) {\n var _engine$_debugPushGro, _engine$_debugPopGrou;\n const scene = this.getScene();\n if (!scene) {\n return;\n }\n const engine = scene.getEngine();\n this._currentFaceIndex = faceIndex;\n this._currentLayer = layer;\n this._currentUseCameraPostProcess = useCameraPostProcess;\n this._currentDumpForDebug = dumpForDebug;\n this._prepareFrame(scene, faceIndex, layer, useCameraPostProcess);\n (_engine$_debugPushGro = engine._debugPushGroup) === null || _engine$_debugPushGro === void 0 || _engine$_debugPushGro.call(engine, `render to face #${faceIndex} layer #${layer}`, 2);\n this._objectRenderer.render(faceIndex + layer, true); // only faceIndex or layer (if any) will be different from 0 (we don't support array of cubes), so it's safe to add them to get the pass index\n (_engine$_debugPopGrou = engine._debugPopGroup) === null || _engine$_debugPopGrou === void 0 || _engine$_debugPopGrou.call(engine, 2);\n this._unbindFrameBuffer(engine, faceIndex);\n if (this._texture && this.isCube && faceIndex === 5) {\n engine.generateMipMapsForCubemap(this._texture, true);\n }\n }\n /**\n * Overrides the default sort function applied in the rendering group to prepare the meshes.\n * This allowed control for front to back rendering or reversely depending of the special needs.\n *\n * @param renderingGroupId The rendering group id corresponding to its index\n * @param opaqueSortCompareFn The opaque queue comparison function use to sort.\n * @param alphaTestSortCompareFn The alpha test queue comparison function use to sort.\n * @param transparentSortCompareFn The transparent queue comparison function use to sort.\n */\n setRenderingOrder(renderingGroupId, opaqueSortCompareFn = null, alphaTestSortCompareFn = null, transparentSortCompareFn = null) {\n this._objectRenderer.setRenderingOrder(renderingGroupId, opaqueSortCompareFn, alphaTestSortCompareFn, transparentSortCompareFn);\n }\n /**\n * Specifies whether or not the stencil and depth buffer are cleared between two rendering groups.\n *\n * @param renderingGroupId The rendering group id corresponding to its index\n * @param autoClearDepthStencil Automatically clears depth and stencil between groups if true.\n */\n setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil) {\n this._objectRenderer.setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil);\n }\n /**\n * Clones the texture.\n * @returns the cloned texture\n */\n clone() {\n const textureSize = this.getSize();\n const newTexture = new RenderTargetTexture(this.name, textureSize, this.getScene(), this._renderTargetOptions.generateMipMaps, this._doNotChangeAspectRatio, this._renderTargetOptions.type, this.isCube, this._renderTargetOptions.samplingMode, this._renderTargetOptions.generateDepthBuffer, this._renderTargetOptions.generateStencilBuffer, undefined, this._renderTargetOptions.format, undefined, this._renderTargetOptions.samples);\n // Base texture\n newTexture.hasAlpha = this.hasAlpha;\n newTexture.level = this.level;\n // RenderTarget Texture\n newTexture.coordinatesMode = this.coordinatesMode;\n if (this.renderList) {\n newTexture.renderList = this.renderList.slice(0);\n }\n return newTexture;\n }\n /**\n * Serialize the texture to a JSON representation we can easily use in the respective Parse function.\n * @returns The JSON representation of the texture\n */\n serialize() {\n if (!this.name) {\n return null;\n }\n const serializationObject = super.serialize();\n serializationObject.renderTargetSize = this.getRenderSize();\n serializationObject.renderList = [];\n if (this.renderList) {\n for (let index = 0; index < this.renderList.length; index++) {\n serializationObject.renderList.push(this.renderList[index].id);\n }\n }\n return serializationObject;\n }\n /**\n * This will remove the attached framebuffer objects. The texture will not be able to be used as render target anymore\n */\n disposeFramebufferObjects() {\n var _this$_renderTarget8;\n (_this$_renderTarget8 = this._renderTarget) === null || _this$_renderTarget8 === void 0 || _this$_renderTarget8.dispose(true);\n }\n /**\n * Release and destroy the underlying lower level texture aka internalTexture.\n */\n releaseInternalTexture() {\n var _this$_renderTarget9;\n (_this$_renderTarget9 = this._renderTarget) === null || _this$_renderTarget9 === void 0 || _this$_renderTarget9.releaseTextures();\n this._texture = null;\n }\n /**\n * Dispose the texture and release its associated resources.\n */\n dispose() {\n var _this$_renderTarget10;\n this.onResizeObservable.clear();\n this.onClearObservable.clear();\n this.onAfterUnbindObservable.clear();\n this.onBeforeBindObservable.clear();\n if (this._postProcessManager) {\n this._postProcessManager.dispose();\n this._postProcessManager = null;\n }\n if (this._prePassRenderTarget) {\n this._prePassRenderTarget.dispose();\n }\n this._objectRenderer.dispose();\n this.clearPostProcesses(true);\n if (this._resizeObserver) {\n this.getScene().getEngine().onResizeObservable.remove(this._resizeObserver);\n this._resizeObserver = null;\n }\n // Remove from custom render targets\n const scene = this.getScene();\n if (!scene) {\n return;\n }\n let index = scene.customRenderTargets.indexOf(this);\n if (index >= 0) {\n scene.customRenderTargets.splice(index, 1);\n }\n for (const camera of scene.cameras) {\n index = camera.customRenderTargets.indexOf(this);\n if (index >= 0) {\n camera.customRenderTargets.splice(index, 1);\n }\n }\n (_this$_renderTarget10 = this._renderTarget) === null || _this$_renderTarget10 === void 0 || _this$_renderTarget10.dispose();\n this._renderTarget = null;\n this._texture = null;\n super.dispose();\n }\n /** @internal */\n _rebuild() {\n this._objectRenderer._rebuild();\n if (this._postProcessManager) {\n this._postProcessManager._rebuild();\n }\n }\n /**\n * Clear the info related to rendering groups preventing retention point in material dispose.\n */\n freeRenderingGroups() {\n this._objectRenderer.freeRenderingGroups();\n }\n /**\n * Gets the number of views the corresponding to the texture (eg. a MultiviewRenderTarget will have > 1)\n * @returns the view count\n */\n getViewCount() {\n return 1;\n }\n}\n/**\n * The texture will only be rendered once which can be useful to improve performance if everything in your render is static for instance.\n */\nRenderTargetTexture.REFRESHRATE_RENDER_ONCE = ObjectRenderer.REFRESHRATE_RENDER_ONCE;\n/**\n * The texture will be rendered every frame and is recommended for dynamic contents.\n */\nRenderTargetTexture.REFRESHRATE_RENDER_ONEVERYFRAME = ObjectRenderer.REFRESHRATE_RENDER_ONEVERYFRAME;\n/**\n * The texture will be rendered every 2 frames which could be enough if your dynamic objects are not\n * the central point of your effect and can save a lot of performances.\n */\nRenderTargetTexture.REFRESHRATE_RENDER_ONEVERYTWOFRAMES = ObjectRenderer.REFRESHRATE_RENDER_ONEVERYTWOFRAMES;\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nTexture._CreateRenderTargetTexture = (name, renderTargetSize, scene, generateMipMaps, creationFlags) => {\n return new RenderTargetTexture(name, renderTargetSize, scene, generateMipMaps);\n};","map":{"version":3,"names":["Observable","Matrix","Vector3","Texture","PostProcessManager","FloorPOT","NearestPOT","Effect","Logger","ObjectRenderer","prototype","setDepthStencilTexture","channel","texture","_engine","_samplers","_uniforms","RenderTargetTexture","renderListPredicate","_objectRenderer","value","renderList","particleSystemList","getCustomRenderList","renderParticles","renderSprites","forceLayerMaskCheck","activeCamera","customIsReadyFunction","customRenderFunction","postProcesses","_postProcesses","_prePassEnabled","_prePassRenderTarget","enabled","onAfterUnbind","callback","_onAfterUnbindObserver","onAfterUnbindObservable","remove","add","onBeforeRenderObservable","onBeforeRender","_onBeforeRenderObserver","onAfterRenderObservable","onAfterRender","_onAfterRenderObserver","onClear","_onClearObserver","onClearObservable","_waitingRenderList","renderPassId","renderPassIds","currentRefreshId","setMaterialForRendering","mesh","material","isMulti","_this$_renderTarget$i","_this$_renderTarget","_renderTarget","renderTargetOptions","_renderTargetOptions","renderTarget","_onRatioRescale","_sizeRatio","resize","_initialSizeParameter","boundingBoxSize","_boundingBoxSize","equals","scene","getScene","markAllMaterialsAsDirty","depthStencilTexture","_this$_renderTarget$_","_this$_renderTarget2","_depthStencilTexture","constructor","name","size","generateMipMaps","doNotChangeAspectRatio","type","isCube","samplingMode","TRILINEAR_SAMPLINGMODE","generateDepthBuffer","generateStencilBuffer","format","delayAllocation","samples","creationFlags","noColorAttachment","useSRGBBuffer","_this$_format","colorAttachment","undefined","gammaSpace","_options$doNotChangeA","_options$type","_options$samplingMode","_options$generateDept","_options$format","_options$gammaSpace","options","ignoreCameraViewport","onBeforeBindObservable","onResizeObservable","_cleared","skipInitialClear","_samples","_canRescale","boundingBoxPosition","Zero","_dumpToolsLoading","engine","getEngine","_gammaSpace","_coordinatesMode","PROJECTION_MODE","isRenderTarget","_processSizeParameter","numPasses","getRenderLayers","onBeforeRenderingManagerRenderObservable","step","_scene","_beforeRenderTargetClearStage","action","_currentFaceIndex","_currentLayer","hasObservers","notifyObservers","clear","clearColor","_doNotChangeAspectRatio","updateTransformMatrix","_beforeRenderTargetDrawStage","onAfterRenderingManagerRenderObservable","_this$_texture$genera","_this$_texture","_afterRenderTargetDrawStage","saveGenerateMipMaps","_texture","_postProcessManager","_this$_renderTarget3","_finalizeFrame","_currentUseCameraPostProcess","_this$_renderTarget4","postProcessManager","_afterRenderTargetPostProcessStage","_currentDumpForDebug","_dumpTools","Error","DumpFramebuffer","getRenderWidth","getRenderHeight","onFastPathRenderObservable","_resizeObserver","_generateMipMaps","_format","label","NEAREST_SAMPLINGMODE","wrapU","CLAMP_ADDRESSMODE","wrapV","createRenderTargetCubeTexture","getRenderSize","coordinatesMode","INVCUBIC_MODE","_textureMatrix","Identity","createRenderTargetTexture","_size","createDepthStencilTexture","comparisonFunction","bilinearFiltering","generateStencil","_this$_renderTarget5","ratio","_getEngine","width","_bestReflectionRenderTargetDimension","height","_this$_renderTarget$s","_this$_renderTarget6","setSamples","addPostProcess","postProcess","Array","push","autoClear","clearPostProcesses","dispose","removePostProcess","index","indexOf","splice","length","resetRefreshCounter","refreshRate","_shouldRender","shouldRender","layers","depth","disableRescaling","canRescale","scale","newSize","Math","max","getReflectionTextureMatrix","_this$_renderTarget7","wasCube","render","useCameraPostProcess","dumpForDebug","_render","isReadyForRendering","then","module","prepareRenderList","initRender","isReady","_checkReadiness","finishRender","useCameraPostProcesses","is2DArray","is3D","layer","_renderToTarget","incrementRenderId","resetCachedMaterial","face","renderDimension","minimum","x","curved","min","_bindFrameBuffer","faceIndex","bindFramebuffer","_unbindFrameBuffer","unBindFramebuffer","_prepareFrame","_engine$_debugPushGro","_engine$_debugPopGrou","_debugPushGroup","call","_debugPopGroup","generateMipMapsForCubemap","setRenderingOrder","renderingGroupId","opaqueSortCompareFn","alphaTestSortCompareFn","transparentSortCompareFn","setRenderingAutoClearDepthStencil","autoClearDepthStencil","clone","textureSize","getSize","newTexture","hasAlpha","level","slice","serialize","serializationObject","renderTargetSize","id","disposeFramebufferObjects","_this$_renderTarget8","releaseInternalTexture","_this$_renderTarget9","releaseTextures","_this$_renderTarget10","customRenderTargets","camera","cameras","_rebuild","freeRenderingGroups","getViewCount","REFRESHRATE_RENDER_ONCE","REFRESHRATE_RENDER_ONEVERYFRAME","REFRESHRATE_RENDER_ONEVERYTWOFRAMES","_CreateRenderTargetTexture"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Materials/Textures/renderTargetTexture.js"],"sourcesContent":["import { Observable } from \"../../Misc/observable.js\";\nimport { Matrix, Vector3 } from \"../../Maths/math.vector.js\";\nimport { Texture } from \"../../Materials/Textures/texture.js\";\nimport { PostProcessManager } from \"../../PostProcesses/postProcessManager.js\";\n\nimport { FloorPOT, NearestPOT } from \"../../Misc/tools.functions.js\";\nimport { Effect } from \"../effect.js\";\nimport { Logger } from \"../../Misc/logger.js\";\nimport { ObjectRenderer } from \"../../Rendering/objectRenderer.js\";\n/**\n * Sets a depth stencil texture from a render target on the engine to be used in the shader.\n * @param channel Name of the sampler variable.\n * @param texture Texture to set.\n */\nEffect.prototype.setDepthStencilTexture = function (channel, texture) {\n this._engine.setDepthStencilTexture(this._samplers[channel], this._uniforms[channel], texture, channel);\n};\n/**\n * This Helps creating a texture that will be created from a camera in your scene.\n * It is basically a dynamic texture that could be used to create special effects for instance.\n * Actually, It is the base of lot of effects in the framework like post process, shadows, effect layers and rendering pipelines...\n */\nexport class RenderTargetTexture extends Texture {\n /**\n * Use this predicate to dynamically define the list of mesh you want to render.\n * If set, the renderList property will be overwritten.\n */\n get renderListPredicate() {\n return this._objectRenderer.renderListPredicate;\n }\n set renderListPredicate(value) {\n this._objectRenderer.renderListPredicate = value;\n }\n /**\n * Use this list to define the list of mesh you want to render.\n */\n get renderList() {\n return this._objectRenderer.renderList;\n }\n set renderList(value) {\n this._objectRenderer.renderList = value;\n }\n /**\n * Define the list of particle systems to render in the texture. If not provided, will render all the particle systems of the scene.\n * Note that the particle systems are rendered only if renderParticles is set to true.\n */\n get particleSystemList() {\n return this._objectRenderer.particleSystemList;\n }\n set particleSystemList(value) {\n this._objectRenderer.particleSystemList = value;\n }\n /**\n * Use this function to overload the renderList array at rendering time.\n * Return null to render with the current renderList, else return the list of meshes to use for rendering.\n * For 2DArray RTT, layerOrFace is the index of the layer that is going to be rendered, else it is the faceIndex of\n * the cube (if the RTT is a cube, else layerOrFace=0).\n * The renderList passed to the function is the current render list (the one that will be used if the function returns null).\n * The length of this list is passed through renderListLength: don't use renderList.length directly because the array can\n * hold dummy elements!\n */\n get getCustomRenderList() {\n return this._objectRenderer.getCustomRenderList;\n }\n set getCustomRenderList(value) {\n this._objectRenderer.getCustomRenderList = value;\n }\n /**\n * Define if particles should be rendered in your texture (default: true).\n */\n get renderParticles() {\n return this._objectRenderer.renderParticles;\n }\n set renderParticles(value) {\n this._objectRenderer.renderParticles = value;\n }\n /**\n * Define if sprites should be rendered in your texture (default: false).\n */\n get renderSprites() {\n return this._objectRenderer.renderSprites;\n }\n set renderSprites(value) {\n this._objectRenderer.renderSprites = value;\n }\n /**\n * Force checking the layerMask property even if a custom list of meshes is provided (ie. if renderList is not undefined) (default: false).\n */\n get forceLayerMaskCheck() {\n return this._objectRenderer.forceLayerMaskCheck;\n }\n set forceLayerMaskCheck(value) {\n this._objectRenderer.forceLayerMaskCheck = value;\n }\n /**\n * Define the camera used to render the texture.\n */\n get activeCamera() {\n return this._objectRenderer.activeCamera;\n }\n set activeCamera(value) {\n this._objectRenderer.activeCamera = value;\n }\n /**\n * Override the mesh isReady function with your own one.\n */\n get customIsReadyFunction() {\n return this._objectRenderer.customIsReadyFunction;\n }\n set customIsReadyFunction(value) {\n this._objectRenderer.customIsReadyFunction = value;\n }\n /**\n * Override the render function of the texture with your own one.\n */\n get customRenderFunction() {\n return this._objectRenderer.customRenderFunction;\n }\n set customRenderFunction(value) {\n this._objectRenderer.customRenderFunction = value;\n }\n /**\n * Post-processes for this render target\n */\n get postProcesses() {\n return this._postProcesses;\n }\n get _prePassEnabled() {\n return !!this._prePassRenderTarget && this._prePassRenderTarget.enabled;\n }\n /**\n * Set a after unbind callback in the texture.\n * This has been kept for backward compatibility and use of onAfterUnbindObservable is recommended.\n */\n set onAfterUnbind(callback) {\n if (this._onAfterUnbindObserver) {\n this.onAfterUnbindObservable.remove(this._onAfterUnbindObserver);\n }\n this._onAfterUnbindObserver = this.onAfterUnbindObservable.add(callback);\n }\n /**\n * An event triggered before rendering the texture\n */\n get onBeforeRenderObservable() {\n return this._objectRenderer.onBeforeRenderObservable;\n }\n /**\n * Set a before render callback in the texture.\n * This has been kept for backward compatibility and use of onBeforeRenderObservable is recommended.\n */\n set onBeforeRender(callback) {\n if (this._onBeforeRenderObserver) {\n this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver);\n }\n this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(callback);\n }\n /**\n * An event triggered after rendering the texture\n */\n get onAfterRenderObservable() {\n return this._objectRenderer.onAfterRenderObservable;\n }\n /**\n * Set a after render callback in the texture.\n * This has been kept for backward compatibility and use of onAfterRenderObservable is recommended.\n */\n set onAfterRender(callback) {\n if (this._onAfterRenderObserver) {\n this.onAfterRenderObservable.remove(this._onAfterRenderObserver);\n }\n this._onAfterRenderObserver = this.onAfterRenderObservable.add(callback);\n }\n /**\n * Set a clear callback in the texture.\n * This has been kept for backward compatibility and use of onClearObservable is recommended.\n */\n set onClear(callback) {\n if (this._onClearObserver) {\n this.onClearObservable.remove(this._onClearObserver);\n }\n this._onClearObserver = this.onClearObservable.add(callback);\n }\n /** @internal */\n get _waitingRenderList() {\n return this._objectRenderer._waitingRenderList;\n }\n /** @internal */\n set _waitingRenderList(value) {\n this._objectRenderer._waitingRenderList = value;\n }\n /**\n * Current render pass id of the render target texture. Note it can change over the rendering as there's a separate id for each face of a cube / each layer of an array layer!\n */\n get renderPassId() {\n return this._objectRenderer.renderPassId;\n }\n /**\n * Gets the render pass ids used by the render target texture. For a single render target the array length will be 1, for a cube texture it will be 6 and for\n * a 2D texture array it will return an array of ids the size of the 2D texture array\n */\n get renderPassIds() {\n return this._objectRenderer.renderPassIds;\n }\n /**\n * Gets the current value of the refreshId counter\n */\n get currentRefreshId() {\n return this._objectRenderer.currentRefreshId;\n }\n /**\n * Sets a specific material to be used to render a mesh/a list of meshes in this render target texture\n * @param mesh mesh or array of meshes\n * @param material material or array of materials to use for this render pass. If undefined is passed, no specific material will be used but the regular material instead (mesh.material). It's possible to provide an array of materials to use a different material for each rendering in the case of a cube texture (6 rendering) and a 2D texture array (as many rendering as the length of the array)\n */\n setMaterialForRendering(mesh, material) {\n this._objectRenderer.setMaterialForRendering(mesh, material);\n }\n /**\n * Define if the texture has multiple draw buffers or if false a single draw buffer.\n */\n get isMulti() {\n return this._renderTarget?.isMulti ?? false;\n }\n /**\n * Gets render target creation options that were used.\n */\n get renderTargetOptions() {\n return this._renderTargetOptions;\n }\n /**\n * Gets the render target wrapper associated with this render target\n */\n get renderTarget() {\n return this._renderTarget;\n }\n _onRatioRescale() {\n if (this._sizeRatio) {\n this.resize(this._initialSizeParameter);\n }\n }\n /**\n * Gets or sets the size of the bounding box associated with the texture (when in cube mode)\n * When defined, the cubemap will switch to local mode\n * @see https://community.arm.com/graphics/b/blog/posts/reflections-based-on-local-cubemaps-in-unity\n * @example https://www.babylonjs-playground.com/#RNASML\n */\n set boundingBoxSize(value) {\n if (this._boundingBoxSize && this._boundingBoxSize.equals(value)) {\n return;\n }\n this._boundingBoxSize = value;\n const scene = this.getScene();\n if (scene) {\n scene.markAllMaterialsAsDirty(1);\n }\n }\n get boundingBoxSize() {\n return this._boundingBoxSize;\n }\n /**\n * In case the RTT has been created with a depth texture, get the associated\n * depth texture.\n * Otherwise, return null.\n */\n get depthStencilTexture() {\n return this._renderTarget?._depthStencilTexture ?? null;\n }\n /** @internal */\n constructor(name, size, scene, generateMipMaps = false, doNotChangeAspectRatio = true, type = 0, isCube = false, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, generateDepthBuffer = true, generateStencilBuffer = false, isMulti = false, format = 5, delayAllocation = false, samples, creationFlags, noColorAttachment = false, useSRGBBuffer = false) {\n let colorAttachment = undefined;\n let gammaSpace = true;\n if (typeof generateMipMaps === \"object\") {\n const options = generateMipMaps;\n generateMipMaps = !!options.generateMipMaps;\n doNotChangeAspectRatio = options.doNotChangeAspectRatio ?? true;\n type = options.type ?? 0;\n isCube = !!options.isCube;\n samplingMode = options.samplingMode ?? Texture.TRILINEAR_SAMPLINGMODE;\n generateDepthBuffer = options.generateDepthBuffer ?? true;\n generateStencilBuffer = !!options.generateStencilBuffer;\n isMulti = !!options.isMulti;\n format = options.format ?? 5;\n delayAllocation = !!options.delayAllocation;\n samples = options.samples;\n creationFlags = options.creationFlags;\n noColorAttachment = !!options.noColorAttachment;\n useSRGBBuffer = !!options.useSRGBBuffer;\n colorAttachment = options.colorAttachment;\n gammaSpace = options.gammaSpace ?? gammaSpace;\n }\n super(null, scene, !generateMipMaps, undefined, samplingMode, undefined, undefined, undefined, undefined, format);\n /**\n * Define if the camera viewport should be respected while rendering the texture or if the render should be done to the entire texture.\n */\n this.ignoreCameraViewport = false;\n /**\n * An event triggered when the texture is unbind.\n */\n this.onBeforeBindObservable = new Observable();\n /**\n * An event triggered when the texture is unbind.\n */\n this.onAfterUnbindObservable = new Observable();\n /**\n * An event triggered after the texture clear\n */\n this.onClearObservable = new Observable();\n /**\n * An event triggered when the texture is resized.\n */\n this.onResizeObservable = new Observable();\n /** @internal */\n this._cleared = false;\n /**\n * Skip the initial clear of the rtt at the beginning of the frame render loop\n */\n this.skipInitialClear = false;\n this._samples = 1;\n this._canRescale = true;\n this._renderTarget = null;\n /**\n * Gets or sets the center of the bounding box associated with the texture (when in cube mode)\n * It must define where the camera used to render the texture is set\n */\n this.boundingBoxPosition = Vector3.Zero();\n this._dumpToolsLoading = false;\n scene = this.getScene();\n if (!scene) {\n return;\n }\n const engine = this.getScene().getEngine();\n this._gammaSpace = gammaSpace;\n this._coordinatesMode = Texture.PROJECTION_MODE;\n this.name = name;\n this.isRenderTarget = true;\n this._initialSizeParameter = size;\n this._processSizeParameter(size);\n this._objectRenderer = new ObjectRenderer(name, scene, {\n numPasses: isCube ? 6 : this.getRenderLayers() || 1,\n doNotChangeAspectRatio,\n });\n this._objectRenderer.onBeforeRenderingManagerRenderObservable.add(() => {\n // Before clear\n for (const step of this._scene._beforeRenderTargetClearStage) {\n step.action(this, this._currentFaceIndex, this._currentLayer);\n }\n // Clear\n if (this.onClearObservable.hasObservers()) {\n this.onClearObservable.notifyObservers(engine);\n }\n else if (!this.skipInitialClear) {\n engine.clear(this.clearColor || this._scene.clearColor, true, true, true);\n }\n if (!this._doNotChangeAspectRatio) {\n this._scene.updateTransformMatrix(true);\n }\n // Before Camera Draw\n for (const step of this._scene._beforeRenderTargetDrawStage) {\n step.action(this, this._currentFaceIndex, this._currentLayer);\n }\n });\n this._objectRenderer.onAfterRenderingManagerRenderObservable.add(() => {\n // After Camera Draw\n for (const step of this._scene._afterRenderTargetDrawStage) {\n step.action(this, this._currentFaceIndex, this._currentLayer);\n }\n const saveGenerateMipMaps = this._texture?.generateMipMaps ?? false;\n if (this._texture) {\n this._texture.generateMipMaps = false; // if left true, the mipmaps will be generated (if this._texture.generateMipMaps = true) when the first post process binds its own RTT: by doing so it will unbind the current RTT,\n // which will trigger a mipmap generation. We don't want this because it's a wasted work, we will do an unbind of the current RTT at the end of the process (see unbindFrameBuffer) which will\n // trigger the generation of the final mipmaps\n }\n if (this._postProcessManager) {\n this._postProcessManager._finalizeFrame(false, this._renderTarget ?? undefined, this._currentFaceIndex, this._postProcesses, this.ignoreCameraViewport);\n }\n else if (this._currentUseCameraPostProcess) {\n this._scene.postProcessManager._finalizeFrame(false, this._renderTarget ?? undefined, this._currentFaceIndex);\n }\n for (const step of this._scene._afterRenderTargetPostProcessStage) {\n step.action(this, this._currentFaceIndex, this._currentLayer);\n }\n if (this._texture) {\n this._texture.generateMipMaps = saveGenerateMipMaps;\n }\n if (!this._doNotChangeAspectRatio) {\n this._scene.updateTransformMatrix(true);\n }\n // Dump ?\n if (this._currentDumpForDebug) {\n if (!this._dumpTools) {\n Logger.Error(\"dumpTools module is still being loaded. To speed up the process import dump tools directly in your project\");\n }\n else {\n this._dumpTools.DumpFramebuffer(this.getRenderWidth(), this.getRenderHeight(), engine);\n }\n }\n });\n this._objectRenderer.onFastPathRenderObservable.add(() => {\n if (this.onClearObservable.hasObservers()) {\n this.onClearObservable.notifyObservers(engine);\n }\n else {\n if (!this.skipInitialClear) {\n engine.clear(this.clearColor || this._scene.clearColor, true, true, true);\n }\n }\n });\n this._resizeObserver = engine.onResizeObservable.add(() => { });\n this._generateMipMaps = generateMipMaps ? true : false;\n this._doNotChangeAspectRatio = doNotChangeAspectRatio;\n if (isMulti) {\n return;\n }\n this._renderTargetOptions = {\n generateMipMaps: generateMipMaps,\n type: type,\n format: this._format ?? undefined,\n samplingMode: this.samplingMode,\n generateDepthBuffer: generateDepthBuffer,\n generateStencilBuffer: generateStencilBuffer,\n samples,\n creationFlags,\n noColorAttachment: noColorAttachment,\n useSRGBBuffer,\n colorAttachment: colorAttachment,\n label: this.name,\n };\n if (this.samplingMode === Texture.NEAREST_SAMPLINGMODE) {\n this.wrapU = Texture.CLAMP_ADDRESSMODE;\n this.wrapV = Texture.CLAMP_ADDRESSMODE;\n }\n if (!delayAllocation) {\n if (isCube) {\n this._renderTarget = scene.getEngine().createRenderTargetCubeTexture(this.getRenderSize(), this._renderTargetOptions);\n this.coordinatesMode = Texture.INVCUBIC_MODE;\n this._textureMatrix = Matrix.Identity();\n }\n else {\n this._renderTarget = scene.getEngine().createRenderTargetTexture(this._size, this._renderTargetOptions);\n }\n this._texture = this._renderTarget.texture;\n if (samples !== undefined) {\n this.samples = samples;\n }\n }\n }\n /**\n * Creates a depth stencil texture.\n * This is only available in WebGL 2 or with the depth texture extension available.\n * @param comparisonFunction Specifies the comparison function to set on the texture. If 0 or undefined, the texture is not in comparison mode (default: 0)\n * @param bilinearFiltering Specifies whether or not bilinear filtering is enable on the texture (default: true)\n * @param generateStencil Specifies whether or not a stencil should be allocated in the texture (default: false)\n * @param samples sample count of the depth/stencil texture (default: 1)\n * @param format format of the depth texture (default: 14)\n * @param label defines the label of the texture (for debugging purpose)\n */\n createDepthStencilTexture(comparisonFunction = 0, bilinearFiltering = true, generateStencil = false, samples = 1, format = 14, label) {\n this._renderTarget?.createDepthStencilTexture(comparisonFunction, bilinearFiltering, generateStencil, samples, format, label);\n }\n _processSizeParameter(size) {\n if (size.ratio) {\n this._sizeRatio = size.ratio;\n const engine = this._getEngine();\n this._size = {\n width: this._bestReflectionRenderTargetDimension(engine.getRenderWidth(), this._sizeRatio),\n height: this._bestReflectionRenderTargetDimension(engine.getRenderHeight(), this._sizeRatio),\n };\n }\n else {\n this._size = size;\n }\n }\n /**\n * Define the number of samples to use in case of MSAA.\n * It defaults to one meaning no MSAA has been enabled.\n */\n get samples() {\n return this._renderTarget?.samples ?? this._samples;\n }\n set samples(value) {\n if (this._renderTarget) {\n this._samples = this._renderTarget.setSamples(value);\n }\n }\n /**\n * Adds a post process to the render target rendering passes.\n * @param postProcess define the post process to add\n */\n addPostProcess(postProcess) {\n if (!this._postProcessManager) {\n const scene = this.getScene();\n if (!scene) {\n return;\n }\n this._postProcessManager = new PostProcessManager(scene);\n this._postProcesses = new Array();\n }\n this._postProcesses.push(postProcess);\n this._postProcesses[0].autoClear = false;\n }\n /**\n * Clear all the post processes attached to the render target\n * @param dispose define if the cleared post processes should also be disposed (false by default)\n */\n clearPostProcesses(dispose = false) {\n if (!this._postProcesses) {\n return;\n }\n if (dispose) {\n for (const postProcess of this._postProcesses) {\n postProcess.dispose();\n }\n }\n this._postProcesses = [];\n }\n /**\n * Remove one of the post process from the list of attached post processes to the texture\n * @param postProcess define the post process to remove from the list\n */\n removePostProcess(postProcess) {\n if (!this._postProcesses) {\n return;\n }\n const index = this._postProcesses.indexOf(postProcess);\n if (index === -1) {\n return;\n }\n this._postProcesses.splice(index, 1);\n if (this._postProcesses.length > 0) {\n this._postProcesses[0].autoClear = false;\n }\n }\n /**\n * Resets the refresh counter of the texture and start bak from scratch.\n * Could be useful to regenerate the texture if it is setup to render only once.\n */\n resetRefreshCounter() {\n this._objectRenderer.resetRefreshCounter();\n }\n /**\n * Define the refresh rate of the texture or the rendering frequency.\n * Use 0 to render just once, 1 to render on every frame, 2 to render every two frames and so on...\n */\n get refreshRate() {\n return this._objectRenderer.refreshRate;\n }\n set refreshRate(value) {\n this._objectRenderer.refreshRate = value;\n }\n /** @internal */\n _shouldRender() {\n return this._objectRenderer.shouldRender();\n }\n /**\n * Gets the actual render size of the texture.\n * @returns the width of the render size\n */\n getRenderSize() {\n return this.getRenderWidth();\n }\n /**\n * Gets the actual render width of the texture.\n * @returns the width of the render size\n */\n getRenderWidth() {\n if (this._size.width) {\n return this._size.width;\n }\n return this._size;\n }\n /**\n * Gets the actual render height of the texture.\n * @returns the height of the render size\n */\n getRenderHeight() {\n if (this._size.width) {\n return this._size.height;\n }\n return this._size;\n }\n /**\n * Gets the actual number of layers of the texture or, in the case of a 3D texture, return the depth.\n * @returns the number of layers\n */\n getRenderLayers() {\n const layers = this._size.layers;\n if (layers) {\n return layers;\n }\n const depth = this._size.depth;\n if (depth) {\n return depth;\n }\n return 0;\n }\n /**\n * Don't allow this render target texture to rescale. Mainly used to prevent rescaling by the scene optimizer.\n */\n disableRescaling() {\n this._canRescale = false;\n }\n /**\n * Get if the texture can be rescaled or not.\n */\n get canRescale() {\n return this._canRescale;\n }\n /**\n * Resize the texture using a ratio.\n * @param ratio the ratio to apply to the texture size in order to compute the new target size\n */\n scale(ratio) {\n const newSize = Math.max(1, this.getRenderSize() * ratio);\n this.resize(newSize);\n }\n /**\n * Get the texture reflection matrix used to rotate/transform the reflection.\n * @returns the reflection matrix\n */\n getReflectionTextureMatrix() {\n if (this.isCube) {\n return this._textureMatrix;\n }\n return super.getReflectionTextureMatrix();\n }\n /**\n * Resize the texture to a new desired size.\n * Be careful as it will recreate all the data in the new texture.\n * @param size Define the new size. It can be:\n * - a number for squared texture,\n * - an object containing { width: number, height: number }\n * - or an object containing a ratio { ratio: number }\n */\n resize(size) {\n const wasCube = this.isCube;\n this._renderTarget?.dispose();\n this._renderTarget = null;\n const scene = this.getScene();\n if (!scene) {\n return;\n }\n this._processSizeParameter(size);\n if (wasCube) {\n this._renderTarget = scene.getEngine().createRenderTargetCubeTexture(this.getRenderSize(), this._renderTargetOptions);\n }\n else {\n this._renderTarget = scene.getEngine().createRenderTargetTexture(this._size, this._renderTargetOptions);\n }\n this._texture = this._renderTarget.texture;\n if (this._renderTargetOptions.samples !== undefined) {\n this.samples = this._renderTargetOptions.samples;\n }\n if (this.onResizeObservable.hasObservers()) {\n this.onResizeObservable.notifyObservers(this);\n }\n }\n /**\n * Renders all the objects from the render list into the texture.\n * @param useCameraPostProcess Define if camera post processes should be used during the rendering\n * @param dumpForDebug Define if the rendering result should be dumped (copied) for debugging purpose\n */\n render(useCameraPostProcess = false, dumpForDebug = false) {\n this._render(useCameraPostProcess, dumpForDebug);\n }\n /**\n * This function will check if the render target texture can be rendered (textures are loaded, shaders are compiled)\n * @returns true if all required resources are ready\n */\n isReadyForRendering() {\n if (!this._dumpToolsLoading) {\n this._dumpToolsLoading = true;\n // avoid a static import to allow ignoring the import in some cases\n import(\"../../Misc/dumpTools.js\").then((module) => (this._dumpTools = module));\n }\n this._objectRenderer.prepareRenderList();\n this.onBeforeBindObservable.notifyObservers(this);\n this._objectRenderer.initRender(this.getRenderWidth(), this.getRenderHeight());\n const isReady = this._objectRenderer._checkReadiness();\n this.onAfterUnbindObservable.notifyObservers(this);\n this._objectRenderer.finishRender();\n return isReady;\n }\n _render(useCameraPostProcess = false, dumpForDebug = false) {\n const scene = this.getScene();\n if (!scene) {\n return;\n }\n if (this.useCameraPostProcesses !== undefined) {\n useCameraPostProcess = this.useCameraPostProcesses;\n }\n this._objectRenderer.prepareRenderList();\n this.onBeforeBindObservable.notifyObservers(this);\n this._objectRenderer.initRender(this.getRenderWidth(), this.getRenderHeight());\n if ((this.is2DArray || this.is3D) && !this.isMulti) {\n for (let layer = 0; layer < this.getRenderLayers(); layer++) {\n this._renderToTarget(0, useCameraPostProcess, dumpForDebug, layer);\n scene.incrementRenderId();\n scene.resetCachedMaterial();\n }\n }\n else if (this.isCube && !this.isMulti) {\n for (let face = 0; face < 6; face++) {\n this._renderToTarget(face, useCameraPostProcess, dumpForDebug);\n scene.incrementRenderId();\n scene.resetCachedMaterial();\n }\n }\n else {\n this._renderToTarget(0, useCameraPostProcess, dumpForDebug);\n }\n this.onAfterUnbindObservable.notifyObservers(this);\n this._objectRenderer.finishRender();\n }\n _bestReflectionRenderTargetDimension(renderDimension, scale) {\n const minimum = 128;\n const x = renderDimension * scale;\n const curved = NearestPOT(x + (minimum * minimum) / (minimum + x));\n // Ensure we don't exceed the render dimension (while staying POT)\n return Math.min(FloorPOT(renderDimension), curved);\n }\n /**\n * @internal\n * @param faceIndex face index to bind to if this is a cubetexture\n * @param layer defines the index of the texture to bind in the array\n */\n _bindFrameBuffer(faceIndex = 0, layer = 0) {\n const scene = this.getScene();\n if (!scene) {\n return;\n }\n const engine = scene.getEngine();\n if (this._renderTarget) {\n engine.bindFramebuffer(this._renderTarget, this.isCube ? faceIndex : undefined, undefined, undefined, this.ignoreCameraViewport, 0, layer);\n }\n }\n _unbindFrameBuffer(engine, faceIndex) {\n if (!this._renderTarget) {\n return;\n }\n engine.unBindFramebuffer(this._renderTarget, this.isCube, () => {\n this.onAfterRenderObservable.notifyObservers(faceIndex);\n });\n }\n /**\n * @internal\n */\n _prepareFrame(scene, faceIndex, layer, useCameraPostProcess) {\n if (this._postProcessManager) {\n if (!this._prePassEnabled) {\n this._postProcessManager._prepareFrame(this._texture, this._postProcesses);\n }\n }\n else if (!useCameraPostProcess || !scene.postProcessManager._prepareFrame(this._texture)) {\n this._bindFrameBuffer(faceIndex, layer);\n }\n }\n _renderToTarget(faceIndex, useCameraPostProcess, dumpForDebug, layer = 0) {\n const scene = this.getScene();\n if (!scene) {\n return;\n }\n const engine = scene.getEngine();\n this._currentFaceIndex = faceIndex;\n this._currentLayer = layer;\n this._currentUseCameraPostProcess = useCameraPostProcess;\n this._currentDumpForDebug = dumpForDebug;\n this._prepareFrame(scene, faceIndex, layer, useCameraPostProcess);\n engine._debugPushGroup?.(`render to face #${faceIndex} layer #${layer}`, 2);\n this._objectRenderer.render(faceIndex + layer, true); // only faceIndex or layer (if any) will be different from 0 (we don't support array of cubes), so it's safe to add them to get the pass index\n engine._debugPopGroup?.(2);\n this._unbindFrameBuffer(engine, faceIndex);\n if (this._texture && this.isCube && faceIndex === 5) {\n engine.generateMipMapsForCubemap(this._texture, true);\n }\n }\n /**\n * Overrides the default sort function applied in the rendering group to prepare the meshes.\n * This allowed control for front to back rendering or reversely depending of the special needs.\n *\n * @param renderingGroupId The rendering group id corresponding to its index\n * @param opaqueSortCompareFn The opaque queue comparison function use to sort.\n * @param alphaTestSortCompareFn The alpha test queue comparison function use to sort.\n * @param transparentSortCompareFn The transparent queue comparison function use to sort.\n */\n setRenderingOrder(renderingGroupId, opaqueSortCompareFn = null, alphaTestSortCompareFn = null, transparentSortCompareFn = null) {\n this._objectRenderer.setRenderingOrder(renderingGroupId, opaqueSortCompareFn, alphaTestSortCompareFn, transparentSortCompareFn);\n }\n /**\n * Specifies whether or not the stencil and depth buffer are cleared between two rendering groups.\n *\n * @param renderingGroupId The rendering group id corresponding to its index\n * @param autoClearDepthStencil Automatically clears depth and stencil between groups if true.\n */\n setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil) {\n this._objectRenderer.setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil);\n }\n /**\n * Clones the texture.\n * @returns the cloned texture\n */\n clone() {\n const textureSize = this.getSize();\n const newTexture = new RenderTargetTexture(this.name, textureSize, this.getScene(), this._renderTargetOptions.generateMipMaps, this._doNotChangeAspectRatio, this._renderTargetOptions.type, this.isCube, this._renderTargetOptions.samplingMode, this._renderTargetOptions.generateDepthBuffer, this._renderTargetOptions.generateStencilBuffer, undefined, this._renderTargetOptions.format, undefined, this._renderTargetOptions.samples);\n // Base texture\n newTexture.hasAlpha = this.hasAlpha;\n newTexture.level = this.level;\n // RenderTarget Texture\n newTexture.coordinatesMode = this.coordinatesMode;\n if (this.renderList) {\n newTexture.renderList = this.renderList.slice(0);\n }\n return newTexture;\n }\n /**\n * Serialize the texture to a JSON representation we can easily use in the respective Parse function.\n * @returns The JSON representation of the texture\n */\n serialize() {\n if (!this.name) {\n return null;\n }\n const serializationObject = super.serialize();\n serializationObject.renderTargetSize = this.getRenderSize();\n serializationObject.renderList = [];\n if (this.renderList) {\n for (let index = 0; index < this.renderList.length; index++) {\n serializationObject.renderList.push(this.renderList[index].id);\n }\n }\n return serializationObject;\n }\n /**\n * This will remove the attached framebuffer objects. The texture will not be able to be used as render target anymore\n */\n disposeFramebufferObjects() {\n this._renderTarget?.dispose(true);\n }\n /**\n * Release and destroy the underlying lower level texture aka internalTexture.\n */\n releaseInternalTexture() {\n this._renderTarget?.releaseTextures();\n this._texture = null;\n }\n /**\n * Dispose the texture and release its associated resources.\n */\n dispose() {\n this.onResizeObservable.clear();\n this.onClearObservable.clear();\n this.onAfterUnbindObservable.clear();\n this.onBeforeBindObservable.clear();\n if (this._postProcessManager) {\n this._postProcessManager.dispose();\n this._postProcessManager = null;\n }\n if (this._prePassRenderTarget) {\n this._prePassRenderTarget.dispose();\n }\n this._objectRenderer.dispose();\n this.clearPostProcesses(true);\n if (this._resizeObserver) {\n this.getScene().getEngine().onResizeObservable.remove(this._resizeObserver);\n this._resizeObserver = null;\n }\n // Remove from custom render targets\n const scene = this.getScene();\n if (!scene) {\n return;\n }\n let index = scene.customRenderTargets.indexOf(this);\n if (index >= 0) {\n scene.customRenderTargets.splice(index, 1);\n }\n for (const camera of scene.cameras) {\n index = camera.customRenderTargets.indexOf(this);\n if (index >= 0) {\n camera.customRenderTargets.splice(index, 1);\n }\n }\n this._renderTarget?.dispose();\n this._renderTarget = null;\n this._texture = null;\n super.dispose();\n }\n /** @internal */\n _rebuild() {\n this._objectRenderer._rebuild();\n if (this._postProcessManager) {\n this._postProcessManager._rebuild();\n }\n }\n /**\n * Clear the info related to rendering groups preventing retention point in material dispose.\n */\n freeRenderingGroups() {\n this._objectRenderer.freeRenderingGroups();\n }\n /**\n * Gets the number of views the corresponding to the texture (eg. a MultiviewRenderTarget will have > 1)\n * @returns the view count\n */\n getViewCount() {\n return 1;\n }\n}\n/**\n * The texture will only be rendered once which can be useful to improve performance if everything in your render is static for instance.\n */\nRenderTargetTexture.REFRESHRATE_RENDER_ONCE = ObjectRenderer.REFRESHRATE_RENDER_ONCE;\n/**\n * The texture will be rendered every frame and is recommended for dynamic contents.\n */\nRenderTargetTexture.REFRESHRATE_RENDER_ONEVERYFRAME = ObjectRenderer.REFRESHRATE_RENDER_ONEVERYFRAME;\n/**\n * The texture will be rendered every 2 frames which could be enough if your dynamic objects are not\n * the central point of your effect and can save a lot of performances.\n */\nRenderTargetTexture.REFRESHRATE_RENDER_ONEVERYTWOFRAMES = ObjectRenderer.REFRESHRATE_RENDER_ONEVERYTWOFRAMES;\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nTexture._CreateRenderTargetTexture = (name, renderTargetSize, scene, generateMipMaps, creationFlags) => {\n return new RenderTargetTexture(name, renderTargetSize, scene, generateMipMaps);\n};\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,0BAA0B;AACrD,SAASC,MAAM,EAAEC,OAAO,QAAQ,4BAA4B;AAC5D,SAASC,OAAO,QAAQ,qCAAqC;AAC7D,SAASC,kBAAkB,QAAQ,2CAA2C;AAE9E,SAASC,QAAQ,EAAEC,UAAU,QAAQ,+BAA+B;AACpE,SAASC,MAAM,QAAQ,cAAc;AACrC,SAASC,MAAM,QAAQ,sBAAsB;AAC7C,SAASC,cAAc,QAAQ,mCAAmC;AAClE;AACA;AACA;AACA;AACA;AACAF,MAAM,CAACG,SAAS,CAACC,sBAAsB,GAAG,UAAUC,OAAO,EAAEC,OAAO,EAAE;EAClE,IAAI,CAACC,OAAO,CAACH,sBAAsB,CAAC,IAAI,CAACI,SAAS,CAACH,OAAO,CAAC,EAAE,IAAI,CAACI,SAAS,CAACJ,OAAO,CAAC,EAAEC,OAAO,EAAED,OAAO,CAAC;AAC3G,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMK,mBAAmB,SAASd,OAAO,CAAC;EAC7C;AACJ;AACA;AACA;EACI,IAAIe,mBAAmBA,CAAA,EAAG;IACtB,OAAO,IAAI,CAACC,eAAe,CAACD,mBAAmB;EACnD;EACA,IAAIA,mBAAmBA,CAACE,KAAK,EAAE;IAC3B,IAAI,CAACD,eAAe,CAACD,mBAAmB,GAAGE,KAAK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