1 |
- {"ast":null,"code":"import _asyncToGenerator from \"F:/workspace/202226701027/huinongbao-app/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport { Matrix, Vector3, Vector2 } from \"../../Maths/math.vector.js\";\nimport { Color4 } from \"../../Maths/math.color.js\";\nimport { VertexBuffer } from \"../../Buffers/buffer.js\";\nimport { Light } from \"../../Lights/light.js\";\nimport { Texture } from \"../../Materials/Textures/texture.js\";\nimport { RenderTargetTexture } from \"../../Materials/Textures/renderTargetTexture.js\";\nimport { PostProcess } from \"../../PostProcesses/postProcess.js\";\nimport { BlurPostProcess } from \"../../PostProcesses/blurPostProcess.js\";\nimport { Observable } from \"../../Misc/observable.js\";\nimport { _WarnImport } from \"../../Misc/devTools.js\";\nimport { EffectFallbacks } from \"../../Materials/effectFallbacks.js\";\nimport { RenderingManager } from \"../../Rendering/renderingManager.js\";\nimport { DrawWrapper } from \"../../Materials/drawWrapper.js\";\nimport { addClipPlaneUniforms, bindClipPlane, prepareStringDefinesForClipPlanes } from \"../../Materials/clipPlaneMaterialHelper.js\";\nimport { BindMorphTargetParameters, BindSceneUniformBuffer, PrepareAttributesForMorphTargetsInfluencers, PushAttributesForInstances } from \"../../Materials/materialHelper.functions.js\";\n/**\n * Default implementation IShadowGenerator.\n * This is the main object responsible of generating shadows in the framework.\n * Documentation: https://doc.babylonjs.com/features/featuresDeepDive/lights/shadows\n * #IFYDRS#0: WebGL\n * #IFYDRS#835: WebGPU\n */\nexport class ShadowGenerator {\n /**\n * Gets the bias: offset applied on the depth preventing acnea (in light direction).\n */\n get bias() {\n return this._bias;\n }\n /**\n * Sets the bias: offset applied on the depth preventing acnea (in light direction).\n */\n set bias(bias) {\n this._bias = bias;\n }\n /**\n * Gets the normalBias: offset applied on the depth preventing acnea (along side the normal direction and proportional to the light/normal angle).\n */\n get normalBias() {\n return this._normalBias;\n }\n /**\n * Sets the normalBias: offset applied on the depth preventing acnea (along side the normal direction and proportional to the light/normal angle).\n */\n set normalBias(normalBias) {\n this._normalBias = normalBias;\n }\n /**\n * Gets the blur box offset: offset applied during the blur pass.\n * Only useful if useKernelBlur = false\n */\n get blurBoxOffset() {\n return this._blurBoxOffset;\n }\n /**\n * Sets the blur box offset: offset applied during the blur pass.\n * Only useful if useKernelBlur = false\n */\n set blurBoxOffset(value) {\n if (this._blurBoxOffset === value) {\n return;\n }\n this._blurBoxOffset = value;\n this._disposeBlurPostProcesses();\n }\n /**\n * Gets the blur scale: scale of the blurred texture compared to the main shadow map.\n * 2 means half of the size.\n */\n get blurScale() {\n return this._blurScale;\n }\n /**\n * Sets the blur scale: scale of the blurred texture compared to the main shadow map.\n * 2 means half of the size.\n */\n set blurScale(value) {\n if (this._blurScale === value) {\n return;\n }\n this._blurScale = value;\n this._disposeBlurPostProcesses();\n }\n /**\n * Gets the blur kernel: kernel size of the blur pass.\n * Only useful if useKernelBlur = true\n */\n get blurKernel() {\n return this._blurKernel;\n }\n /**\n * Sets the blur kernel: kernel size of the blur pass.\n * Only useful if useKernelBlur = true\n */\n set blurKernel(value) {\n if (this._blurKernel === value) {\n return;\n }\n this._blurKernel = value;\n this._disposeBlurPostProcesses();\n }\n /**\n * Gets whether the blur pass is a kernel blur (if true) or box blur.\n * Only useful in filtered mode (useBlurExponentialShadowMap...)\n */\n get useKernelBlur() {\n return this._useKernelBlur;\n }\n /**\n * Sets whether the blur pass is a kernel blur (if true) or box blur.\n * Only useful in filtered mode (useBlurExponentialShadowMap...)\n */\n set useKernelBlur(value) {\n if (this._useKernelBlur === value) {\n return;\n }\n this._useKernelBlur = value;\n this._disposeBlurPostProcesses();\n }\n /**\n * Gets the depth scale used in ESM mode.\n */\n get depthScale() {\n return this._depthScale !== undefined ? this._depthScale : this._light.getDepthScale();\n }\n /**\n * Sets the depth scale used in ESM mode.\n * This can override the scale stored on the light.\n */\n set depthScale(value) {\n this._depthScale = value;\n }\n _validateFilter(filter) {\n return filter;\n }\n /**\n * Gets the current mode of the shadow generator (normal, PCF, ESM...).\n * The returned value is a number equal to one of the available mode defined in ShadowMap.FILTER_x like _FILTER_NONE\n */\n get filter() {\n return this._filter;\n }\n /**\n * Sets the current mode of the shadow generator (normal, PCF, ESM...).\n * The returned value is a number equal to one of the available mode defined in ShadowMap.FILTER_x like _FILTER_NONE\n */\n set filter(value) {\n value = this._validateFilter(value);\n // Blurring the cubemap is going to be too expensive. Reverting to unblurred version\n if (this._light.needCube()) {\n if (value === ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP) {\n this.useExponentialShadowMap = true;\n return;\n } else if (value === ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP) {\n this.useCloseExponentialShadowMap = true;\n return;\n }\n // PCF on cubemap would also be expensive\n else if (value === ShadowGenerator.FILTER_PCF || value === ShadowGenerator.FILTER_PCSS) {\n this.usePoissonSampling = true;\n return;\n }\n }\n // Weblg1 fallback for PCF.\n if (value === ShadowGenerator.FILTER_PCF || value === ShadowGenerator.FILTER_PCSS) {\n if (!this._scene.getEngine()._features.supportShadowSamplers) {\n this.usePoissonSampling = true;\n return;\n }\n }\n if (this._filter === value) {\n return;\n }\n this._filter = value;\n this._disposeBlurPostProcesses();\n this._applyFilterValues();\n this._light._markMeshesAsLightDirty();\n }\n /**\n * Gets if the current filter is set to Poisson Sampling.\n */\n get usePoissonSampling() {\n return this.filter === ShadowGenerator.FILTER_POISSONSAMPLING;\n }\n /**\n * Sets the current filter to Poisson Sampling.\n */\n set usePoissonSampling(value) {\n const filter = this._validateFilter(ShadowGenerator.FILTER_POISSONSAMPLING);\n if (!value && this.filter !== ShadowGenerator.FILTER_POISSONSAMPLING) {\n return;\n }\n this.filter = value ? filter : ShadowGenerator.FILTER_NONE;\n }\n /**\n * Gets if the current filter is set to ESM.\n */\n get useExponentialShadowMap() {\n return this.filter === ShadowGenerator.FILTER_EXPONENTIALSHADOWMAP;\n }\n /**\n * Sets the current filter is to ESM.\n */\n set useExponentialShadowMap(value) {\n const filter = this._validateFilter(ShadowGenerator.FILTER_EXPONENTIALSHADOWMAP);\n if (!value && this.filter !== ShadowGenerator.FILTER_EXPONENTIALSHADOWMAP) {\n return;\n }\n this.filter = value ? filter : ShadowGenerator.FILTER_NONE;\n }\n /**\n * Gets if the current filter is set to filtered ESM.\n */\n get useBlurExponentialShadowMap() {\n return this.filter === ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP;\n }\n /**\n * Gets if the current filter is set to filtered ESM.\n */\n set useBlurExponentialShadowMap(value) {\n const filter = this._validateFilter(ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP);\n if (!value && this.filter !== ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP) {\n return;\n }\n this.filter = value ? filter : ShadowGenerator.FILTER_NONE;\n }\n /**\n * Gets if the current filter is set to \"close ESM\" (using the inverse of the\n * exponential to prevent steep falloff artifacts).\n */\n get useCloseExponentialShadowMap() {\n return this.filter === ShadowGenerator.FILTER_CLOSEEXPONENTIALSHADOWMAP;\n }\n /**\n * Sets the current filter to \"close ESM\" (using the inverse of the\n * exponential to prevent steep falloff artifacts).\n */\n set useCloseExponentialShadowMap(value) {\n const filter = this._validateFilter(ShadowGenerator.FILTER_CLOSEEXPONENTIALSHADOWMAP);\n if (!value && this.filter !== ShadowGenerator.FILTER_CLOSEEXPONENTIALSHADOWMAP) {\n return;\n }\n this.filter = value ? filter : ShadowGenerator.FILTER_NONE;\n }\n /**\n * Gets if the current filter is set to filtered \"close ESM\" (using the inverse of the\n * exponential to prevent steep falloff artifacts).\n */\n get useBlurCloseExponentialShadowMap() {\n return this.filter === ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP;\n }\n /**\n * Sets the current filter to filtered \"close ESM\" (using the inverse of the\n * exponential to prevent steep falloff artifacts).\n */\n set useBlurCloseExponentialShadowMap(value) {\n const filter = this._validateFilter(ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP);\n if (!value && this.filter !== ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP) {\n return;\n }\n this.filter = value ? filter : ShadowGenerator.FILTER_NONE;\n }\n /**\n * Gets if the current filter is set to \"PCF\" (percentage closer filtering).\n */\n get usePercentageCloserFiltering() {\n return this.filter === ShadowGenerator.FILTER_PCF;\n }\n /**\n * Sets the current filter to \"PCF\" (percentage closer filtering).\n */\n set usePercentageCloserFiltering(value) {\n const filter = this._validateFilter(ShadowGenerator.FILTER_PCF);\n if (!value && this.filter !== ShadowGenerator.FILTER_PCF) {\n return;\n }\n this.filter = value ? filter : ShadowGenerator.FILTER_NONE;\n }\n /**\n * Gets the PCF or PCSS Quality.\n * Only valid if usePercentageCloserFiltering or usePercentageCloserFiltering is true.\n */\n get filteringQuality() {\n return this._filteringQuality;\n }\n /**\n * Sets the PCF or PCSS Quality.\n * Only valid if usePercentageCloserFiltering or usePercentageCloserFiltering is true.\n */\n set filteringQuality(filteringQuality) {\n if (this._filteringQuality === filteringQuality) {\n return;\n }\n this._filteringQuality = filteringQuality;\n this._disposeBlurPostProcesses();\n this._applyFilterValues();\n this._light._markMeshesAsLightDirty();\n }\n /**\n * Gets if the current filter is set to \"PCSS\" (contact hardening).\n */\n get useContactHardeningShadow() {\n return this.filter === ShadowGenerator.FILTER_PCSS;\n }\n /**\n * Sets the current filter to \"PCSS\" (contact hardening).\n */\n set useContactHardeningShadow(value) {\n const filter = this._validateFilter(ShadowGenerator.FILTER_PCSS);\n if (!value && this.filter !== ShadowGenerator.FILTER_PCSS) {\n return;\n }\n this.filter = value ? filter : ShadowGenerator.FILTER_NONE;\n }\n /**\n * Gets the Light Size (in shadow map uv unit) used in PCSS to determine the blocker search area and the penumbra size.\n * Using a ratio helps keeping shape stability independently of the map size.\n *\n * It does not account for the light projection as it was having too much\n * instability during the light setup or during light position changes.\n *\n * Only valid if useContactHardeningShadow is true.\n */\n get contactHardeningLightSizeUVRatio() {\n return this._contactHardeningLightSizeUVRatio;\n }\n /**\n * Sets the Light Size (in shadow map uv unit) used in PCSS to determine the blocker search area and the penumbra size.\n * Using a ratio helps keeping shape stability independently of the map size.\n *\n * It does not account for the light projection as it was having too much\n * instability during the light setup or during light position changes.\n *\n * Only valid if useContactHardeningShadow is true.\n */\n set contactHardeningLightSizeUVRatio(contactHardeningLightSizeUVRatio) {\n this._contactHardeningLightSizeUVRatio = contactHardeningLightSizeUVRatio;\n }\n /** Gets or sets the actual darkness of a shadow */\n get darkness() {\n return this._darkness;\n }\n set darkness(value) {\n this.setDarkness(value);\n }\n /**\n * Returns the darkness value (float). This can only decrease the actual darkness of a shadow.\n * 0 means strongest and 1 would means no shadow.\n * @returns the darkness.\n */\n getDarkness() {\n return this._darkness;\n }\n /**\n * Sets the darkness value (float). This can only decrease the actual darkness of a shadow.\n * @param darkness The darkness value 0 means strongest and 1 would means no shadow.\n * @returns the shadow generator allowing fluent coding.\n */\n setDarkness(darkness) {\n if (darkness >= 1.0) {\n this._darkness = 1.0;\n } else if (darkness <= 0.0) {\n this._darkness = 0.0;\n } else {\n this._darkness = darkness;\n }\n return this;\n }\n /** Gets or sets the ability to have transparent shadow */\n get transparencyShadow() {\n return this._transparencyShadow;\n }\n set transparencyShadow(value) {\n this.setTransparencyShadow(value);\n }\n /**\n * Sets the ability to have transparent shadow (boolean).\n * @param transparent True if transparent else False\n * @returns the shadow generator allowing fluent coding\n */\n setTransparencyShadow(transparent) {\n this._transparencyShadow = transparent;\n return this;\n }\n /**\n * Gets the main RTT containing the shadow map (usually storing depth from the light point of view).\n * @returns The render target texture if present otherwise, null\n */\n getShadowMap() {\n return this._shadowMap;\n }\n /**\n * Gets the RTT used during rendering (can be a blurred version of the shadow map or the shadow map itself).\n * @returns The render target texture if the shadow map is present otherwise, null\n */\n getShadowMapForRendering() {\n if (this._shadowMap2) {\n return this._shadowMap2;\n }\n return this._shadowMap;\n }\n /**\n * Gets the class name of that object\n * @returns \"ShadowGenerator\"\n */\n getClassName() {\n return ShadowGenerator.CLASSNAME;\n }\n /**\n * Helper function to add a mesh and its descendants to the list of shadow casters.\n * @param mesh Mesh to add\n * @param includeDescendants boolean indicating if the descendants should be added. Default to true\n * @returns the Shadow Generator itself\n */\n addShadowCaster(mesh, includeDescendants = true) {\n if (!this._shadowMap) {\n return this;\n }\n if (!this._shadowMap.renderList) {\n this._shadowMap.renderList = [];\n }\n if (this._shadowMap.renderList.indexOf(mesh) === -1) {\n this._shadowMap.renderList.push(mesh);\n }\n if (includeDescendants) {\n for (const childMesh of mesh.getChildMeshes()) {\n if (this._shadowMap.renderList.indexOf(childMesh) === -1) {\n this._shadowMap.renderList.push(childMesh);\n }\n }\n }\n return this;\n }\n /**\n * Helper function to remove a mesh and its descendants from the list of shadow casters\n * @param mesh Mesh to remove\n * @param includeDescendants boolean indicating if the descendants should be removed. Default to true\n * @returns the Shadow Generator itself\n */\n removeShadowCaster(mesh, includeDescendants = true) {\n if (!this._shadowMap || !this._shadowMap.renderList) {\n return this;\n }\n const index = this._shadowMap.renderList.indexOf(mesh);\n if (index !== -1) {\n this._shadowMap.renderList.splice(index, 1);\n }\n if (includeDescendants) {\n for (const child of mesh.getChildren()) {\n this.removeShadowCaster(child);\n }\n }\n return this;\n }\n /**\n * Returns the associated light object.\n * @returns the light generating the shadow\n */\n getLight() {\n return this._light;\n }\n /**\n * Gets the shader language used in this generator.\n */\n get shaderLanguage() {\n return this._shaderLanguage;\n }\n _getCamera() {\n var _this$_camera;\n return (_this$_camera = this._camera) !== null && _this$_camera !== void 0 ? _this$_camera : this._scene.activeCamera;\n }\n /**\n * Gets or sets the size of the texture what stores the shadows\n */\n get mapSize() {\n return this._mapSize;\n }\n set mapSize(size) {\n this._mapSize = size;\n this._light._markMeshesAsLightDirty();\n this.recreateShadowMap();\n }\n /**\n * Creates a ShadowGenerator object.\n * A ShadowGenerator is the required tool to use the shadows.\n * Each light casting shadows needs to use its own ShadowGenerator.\n * Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/shadows\n * @param mapSize The size of the texture what stores the shadows. Example : 1024.\n * @param light The light object generating the shadows.\n * @param usefullFloatFirst By default the generator will try to use half float textures but if you need precision (for self shadowing for instance), you can use this option to enforce full float texture.\n * @param camera Camera associated with this shadow generator (default: null). If null, takes the scene active camera at the time we need to access it\n * @param useRedTextureType Forces the generator to use a Red instead of a RGBA type for the shadow map texture format (default: false)\n * @param forceGLSL defines a boolean indicating if the shader must be compiled in GLSL even if we are using WebGPU\n */\n constructor(mapSize, light, usefullFloatFirst, camera, useRedTextureType, forceGLSL = false) {\n /**\n * Observable triggered before the shadow is rendered. Can be used to update internal effect state\n */\n this.onBeforeShadowMapRenderObservable = new Observable();\n /**\n * Observable triggered after the shadow is rendered. Can be used to restore internal effect state\n */\n this.onAfterShadowMapRenderObservable = new Observable();\n /**\n * Observable triggered before a mesh is rendered in the shadow map.\n * Can be used to update internal effect state (that you can get from the onBeforeShadowMapRenderObservable)\n */\n this.onBeforeShadowMapRenderMeshObservable = new Observable();\n /**\n * Observable triggered after a mesh is rendered in the shadow map.\n * Can be used to update internal effect state (that you can get from the onAfterShadowMapRenderObservable)\n */\n this.onAfterShadowMapRenderMeshObservable = new Observable();\n this._bias = 0.00005;\n this._normalBias = 0;\n this._blurBoxOffset = 1;\n this._blurScale = 2;\n this._blurKernel = 1;\n this._useKernelBlur = false;\n this._filter = ShadowGenerator.FILTER_NONE;\n this._filteringQuality = ShadowGenerator.QUALITY_HIGH;\n this._contactHardeningLightSizeUVRatio = 0.1;\n this._darkness = 0;\n this._transparencyShadow = false;\n /**\n * Enables or disables shadows with varying strength based on the transparency\n * When it is enabled, the strength of the shadow is taken equal to mesh.visibility\n * If you enabled an alpha texture on your material, the alpha value red from the texture is also combined to compute the strength:\n * mesh.visibility * alphaTexture.a\n * The texture used is the diffuse by default, but it can be set to the opacity by setting useOpacityTextureForTransparentShadow\n * Note that by definition transparencyShadow must be set to true for enableSoftTransparentShadow to work!\n */\n this.enableSoftTransparentShadow = false;\n /**\n * If this is true, use the opacity texture's alpha channel for transparent shadows instead of the diffuse one\n */\n this.useOpacityTextureForTransparentShadow = false;\n /**\n * Controls the extent to which the shadows fade out at the edge of the frustum\n */\n this.frustumEdgeFalloff = 0;\n /** Shader language used by the generator */\n this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;\n /**\n * If true the shadow map is generated by rendering the back face of the mesh instead of the front face.\n * This can help with self-shadowing as the geometry making up the back of objects is slightly offset.\n * It might on the other hand introduce peter panning.\n */\n this.forceBackFacesOnly = false;\n this._lightDirection = Vector3.Zero();\n this._viewMatrix = Matrix.Zero();\n this._projectionMatrix = Matrix.Zero();\n this._transformMatrix = Matrix.Zero();\n this._cachedPosition = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\n this._cachedDirection = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\n this._currentFaceIndex = 0;\n this._currentFaceIndexCache = 0;\n this._defaultTextureMatrix = Matrix.Identity();\n this._shadersLoaded = false;\n this._mapSize = mapSize;\n this._light = light;\n this._scene = light.getScene();\n this._camera = camera !== null && camera !== void 0 ? camera : null;\n this._useRedTextureType = !!useRedTextureType;\n this._initShaderSourceAsync(forceGLSL);\n let shadowGenerators = light._shadowGenerators;\n if (!shadowGenerators) {\n shadowGenerators = light._shadowGenerators = new Map();\n }\n shadowGenerators.set(this._camera, this);\n this.id = light.id;\n this._useUBO = this._scene.getEngine().supportsUniformBuffers;\n if (this._useUBO) {\n this._sceneUBOs = [];\n this._sceneUBOs.push(this._scene.createSceneUniformBuffer(`Scene for Shadow Generator (light \"${this._light.name}\")`));\n }\n ShadowGenerator._SceneComponentInitialization(this._scene);\n // Texture type fallback from float to int if not supported.\n const caps = this._scene.getEngine().getCaps();\n if (!usefullFloatFirst) {\n if (caps.textureHalfFloatRender && caps.textureHalfFloatLinearFiltering) {\n this._textureType = 2;\n } else if (caps.textureFloatRender && caps.textureFloatLinearFiltering) {\n this._textureType = 1;\n } else {\n this._textureType = 0;\n }\n } else {\n if (caps.textureFloatRender && caps.textureFloatLinearFiltering) {\n this._textureType = 1;\n } else if (caps.textureHalfFloatRender && caps.textureHalfFloatLinearFiltering) {\n this._textureType = 2;\n } else {\n this._textureType = 0;\n }\n }\n this._initializeGenerator();\n this._applyFilterValues();\n }\n _initializeGenerator() {\n this._light._markMeshesAsLightDirty();\n this._initializeShadowMap();\n }\n _createTargetRenderTexture() {\n const engine = this._scene.getEngine();\n if (engine._features.supportDepthStencilTexture) {\n this._shadowMap = new RenderTargetTexture(this._light.name + \"_shadowMap\", this._mapSize, this._scene, false, true, this._textureType, this._light.needCube(), undefined, false, false, undefined, this._useRedTextureType ? 6 : 5);\n this._shadowMap.createDepthStencilTexture(engine.useReverseDepthBuffer ? 516 : 513, true, undefined, undefined, undefined, `DepthStencilForShadowGenerator-${this._light.name}`);\n } else {\n this._shadowMap = new RenderTargetTexture(this._light.name + \"_shadowMap\", this._mapSize, this._scene, false, true, this._textureType, this._light.needCube());\n }\n this._shadowMap.noPrePassRenderer = true;\n }\n _initializeShadowMap() {\n this._createTargetRenderTexture();\n if (this._shadowMap === null) {\n return;\n }\n this._shadowMap.wrapU = Texture.CLAMP_ADDRESSMODE;\n this._shadowMap.wrapV = Texture.CLAMP_ADDRESSMODE;\n this._shadowMap.anisotropicFilteringLevel = 1;\n this._shadowMap.updateSamplingMode(Texture.BILINEAR_SAMPLINGMODE);\n this._shadowMap.renderParticles = false;\n this._shadowMap.ignoreCameraViewport = true;\n if (this._storedUniqueId) {\n this._shadowMap.uniqueId = this._storedUniqueId;\n }\n // Custom render function.\n this._shadowMap.customRenderFunction = (opaqueSubMeshes, alphaTestSubMeshes, transparentSubMeshes, depthOnlySubMeshes) => this._renderForShadowMap(opaqueSubMeshes, alphaTestSubMeshes, transparentSubMeshes, depthOnlySubMeshes);\n // Force the mesh is ready function to true as we are double checking it\n // in the custom render function. Also it prevents side effects and useless\n // shader variations in DEPTHPREPASS mode.\n this._shadowMap.customIsReadyFunction = () => {\n return true;\n };\n const engine = this._scene.getEngine();\n this._shadowMap.onBeforeBindObservable.add(() => {\n var _engine$_debugPushGro;\n this._currentSceneUBO = this._scene.getSceneUniformBuffer();\n (_engine$_debugPushGro = engine._debugPushGroup) === null || _engine$_debugPushGro === void 0 || _engine$_debugPushGro.call(engine, `shadow map generation for pass id ${engine.currentRenderPassId}`, 1);\n });\n // Record Face Index before render.\n this._shadowMap.onBeforeRenderObservable.add(faceIndex => {\n if (this._sceneUBOs) {\n this._scene.setSceneUniformBuffer(this._sceneUBOs[0]);\n }\n this._currentFaceIndex = faceIndex;\n if (this._filter === ShadowGenerator.FILTER_PCF) {\n engine.setColorWrite(false);\n }\n this.getTransformMatrix(); // generate the view/projection matrix\n this._scene.setTransformMatrix(this._viewMatrix, this._projectionMatrix);\n if (this._useUBO) {\n this._scene.getSceneUniformBuffer().unbindEffect();\n this._scene.finalizeSceneUbo();\n }\n });\n // Blur if required after render.\n this._shadowMap.onAfterUnbindObservable.add(() => {\n var _engine$_debugPopGrou2;\n if (this._sceneUBOs) {\n this._scene.setSceneUniformBuffer(this._currentSceneUBO);\n }\n this._scene.updateTransformMatrix(); // restore the view/projection matrices of the active camera\n if (this._filter === ShadowGenerator.FILTER_PCF) {\n engine.setColorWrite(true);\n }\n if (!this.useBlurExponentialShadowMap && !this.useBlurCloseExponentialShadowMap) {\n var _engine$_debugPopGrou;\n (_engine$_debugPopGrou = engine._debugPopGroup) === null || _engine$_debugPopGrou === void 0 || _engine$_debugPopGrou.call(engine, 1);\n return;\n }\n const shadowMap = this.getShadowMapForRendering();\n if (shadowMap) {\n this._scene.postProcessManager.directRender(this._blurPostProcesses, shadowMap.renderTarget, true);\n engine.unBindFramebuffer(shadowMap.renderTarget, true);\n }\n (_engine$_debugPopGrou2 = engine._debugPopGroup) === null || _engine$_debugPopGrou2 === void 0 || _engine$_debugPopGrou2.call(engine, 1);\n });\n // Clear according to the chosen filter.\n const clearZero = new Color4(0, 0, 0, 0);\n const clearOne = new Color4(1.0, 1.0, 1.0, 1.0);\n this._shadowMap.onClearObservable.add(engine => {\n if (this._filter === ShadowGenerator.FILTER_PCF) {\n engine.clear(clearOne, false, true, false);\n } else if (this.useExponentialShadowMap || this.useBlurExponentialShadowMap) {\n engine.clear(clearZero, true, true, false);\n } else {\n engine.clear(clearOne, true, true, false);\n }\n });\n // Recreate on resize.\n this._shadowMap.onResizeObservable.add(rtt => {\n this._storedUniqueId = this._shadowMap.uniqueId;\n this._mapSize = rtt.getRenderSize();\n this._light._markMeshesAsLightDirty();\n this.recreateShadowMap();\n });\n // Ensures rendering groupids do not erase the depth buffer\n // or we would lose the shadows information.\n for (let i = RenderingManager.MIN_RENDERINGGROUPS; i < RenderingManager.MAX_RENDERINGGROUPS; i++) {\n this._shadowMap.setRenderingAutoClearDepthStencil(i, false);\n }\n }\n _initShaderSourceAsync(forceGLSL = false) {\n var _this = this;\n return _asyncToGenerator(function* () {\n const engine = _this._scene.getEngine();\n if (engine.isWebGPU && !forceGLSL && !ShadowGenerator.ForceGLSL) {\n _this._shaderLanguage = 1 /* ShaderLanguage.WGSL */;\n yield Promise.all([import(\"../../ShadersWGSL/shadowMap.fragment.js\"), import(\"../../ShadersWGSL/shadowMap.vertex.js\"), import(\"../../ShadersWGSL/depthBoxBlur.fragment.js\"), import(\"../../ShadersWGSL/ShadersInclude/shadowMapFragmentSoftTransparentShadow.js\")]);\n } else {\n yield Promise.all([import(\"../../Shaders/shadowMap.fragment.js\"), import(\"../../Shaders/shadowMap.vertex.js\"), import(\"../../Shaders/depthBoxBlur.fragment.js\"), import(\"../../Shaders/ShadersInclude/shadowMapFragmentSoftTransparentShadow.js\")]);\n }\n _this._shadersLoaded = true;\n })();\n }\n _initializeBlurRTTAndPostProcesses() {\n const engine = this._scene.getEngine();\n const targetSize = this._mapSize / this.blurScale;\n if (!this.useKernelBlur || this.blurScale !== 1.0) {\n this._shadowMap2 = new RenderTargetTexture(this._light.name + \"_shadowMap2\", targetSize, this._scene, false, true, this._textureType, undefined, undefined, false);\n this._shadowMap2.wrapU = Texture.CLAMP_ADDRESSMODE;\n this._shadowMap2.wrapV = Texture.CLAMP_ADDRESSMODE;\n this._shadowMap2.updateSamplingMode(Texture.BILINEAR_SAMPLINGMODE);\n }\n if (this.useKernelBlur) {\n this._kernelBlurXPostprocess = new BlurPostProcess(this._light.name + \"KernelBlurX\", new Vector2(1, 0), this.blurKernel, 1.0, null, Texture.BILINEAR_SAMPLINGMODE, engine, false, this._textureType);\n this._kernelBlurXPostprocess.width = targetSize;\n this._kernelBlurXPostprocess.height = targetSize;\n this._kernelBlurXPostprocess.externalTextureSamplerBinding = true;\n this._kernelBlurXPostprocess.onApplyObservable.add(effect => {\n effect.setTexture(\"textureSampler\", this._shadowMap);\n });\n this._kernelBlurYPostprocess = new BlurPostProcess(this._light.name + \"KernelBlurY\", new Vector2(0, 1), this.blurKernel, 1.0, null, Texture.BILINEAR_SAMPLINGMODE, engine, false, this._textureType);\n this._kernelBlurXPostprocess.autoClear = false;\n this._kernelBlurYPostprocess.autoClear = false;\n if (this._textureType === 0) {\n this._kernelBlurXPostprocess.packedFloat = true;\n this._kernelBlurYPostprocess.packedFloat = true;\n }\n this._blurPostProcesses = [this._kernelBlurXPostprocess, this._kernelBlurYPostprocess];\n } else {\n this._boxBlurPostprocess = new PostProcess(this._light.name + \"DepthBoxBlur\", \"depthBoxBlur\", [\"screenSize\", \"boxOffset\"], [], 1.0, null, Texture.BILINEAR_SAMPLINGMODE, engine, false, \"#define OFFSET \" + this._blurBoxOffset, this._textureType, undefined, undefined, undefined, undefined, this._shaderLanguage);\n this._boxBlurPostprocess.externalTextureSamplerBinding = true;\n this._boxBlurPostprocess.onApplyObservable.add(effect => {\n effect.setFloat2(\"screenSize\", targetSize, targetSize);\n effect.setTexture(\"textureSampler\", this._shadowMap);\n });\n this._boxBlurPostprocess.autoClear = false;\n this._blurPostProcesses = [this._boxBlurPostprocess];\n }\n }\n _renderForShadowMap(opaqueSubMeshes, alphaTestSubMeshes, transparentSubMeshes, depthOnlySubMeshes) {\n let index;\n if (depthOnlySubMeshes.length) {\n for (index = 0; index < depthOnlySubMeshes.length; index++) {\n this._renderSubMeshForShadowMap(depthOnlySubMeshes.data[index]);\n }\n }\n for (index = 0; index < opaqueSubMeshes.length; index++) {\n this._renderSubMeshForShadowMap(opaqueSubMeshes.data[index]);\n }\n for (index = 0; index < alphaTestSubMeshes.length; index++) {\n this._renderSubMeshForShadowMap(alphaTestSubMeshes.data[index]);\n }\n if (this._transparencyShadow) {\n for (index = 0; index < transparentSubMeshes.length; index++) {\n this._renderSubMeshForShadowMap(transparentSubMeshes.data[index], true);\n }\n } else {\n for (index = 0; index < transparentSubMeshes.length; index++) {\n transparentSubMeshes.data[index].getEffectiveMesh()._internalAbstractMeshDataInfo._isActiveIntermediate = false;\n }\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _bindCustomEffectForRenderSubMeshForShadowMap(subMesh, effect, mesh) {\n effect.setMatrix(\"viewProjection\", this.getTransformMatrix());\n }\n _renderSubMeshForShadowMap(subMesh, isTransparent = false) {\n const renderingMesh = subMesh.getRenderingMesh();\n const effectiveMesh = subMesh.getEffectiveMesh();\n const scene = this._scene;\n const engine = scene.getEngine();\n const material = subMesh.getMaterial();\n effectiveMesh._internalAbstractMeshDataInfo._isActiveIntermediate = false;\n if (!material || subMesh.verticesCount === 0 || subMesh._renderId === scene.getRenderId()) {\n return;\n }\n // Culling\n // Note:\n // In rhs mode, we assume that meshes will be rendered in right-handed space (i.e. with an RHS camera), so the default value of material.sideOrientation is updated accordingly (see material constructor).\n // However, when generating a shadow map, we render from the point of view of the light, whose view/projection matrices are always in lhs mode.\n // We therefore need to \"undo\" the sideOrientation inversion that was previously performed when constructing the material.\n const useRHS = scene.useRightHandedSystem;\n const detNeg = effectiveMesh._getWorldMatrixDeterminant() < 0;\n let sideOrientation = material._getEffectiveOrientation(renderingMesh);\n if (detNeg && !useRHS || !detNeg && useRHS) {\n sideOrientation = sideOrientation === 0 ? 1 : 0;\n }\n const reverseSideOrientation = sideOrientation === 0;\n engine.setState(material.backFaceCulling, undefined, undefined, reverseSideOrientation, material.cullBackFaces);\n // Managing instances\n const batch = renderingMesh._getInstancesRenderList(subMesh._id, !!subMesh.getReplacementMesh());\n if (batch.mustReturn) {\n return;\n }\n const hardwareInstancedRendering = engine.getCaps().instancedArrays && (batch.visibleInstances[subMesh._id] !== null && batch.visibleInstances[subMesh._id] !== undefined || renderingMesh.hasThinInstances);\n if (this.customAllowRendering && !this.customAllowRendering(subMesh)) {\n return;\n }\n if (this.isReady(subMesh, hardwareInstancedRendering, isTransparent)) {\n var _shadowDepthWrapper$g;\n subMesh._renderId = scene.getRenderId();\n const shadowDepthWrapper = material.shadowDepthWrapper;\n const drawWrapper = (_shadowDepthWrapper$g = shadowDepthWrapper === null || shadowDepthWrapper === void 0 ? void 0 : shadowDepthWrapper.getEffect(subMesh, this, engine.currentRenderPassId)) !== null && _shadowDepthWrapper$g !== void 0 ? _shadowDepthWrapper$g : subMesh._getDrawWrapper();\n const effect = DrawWrapper.GetEffect(drawWrapper);\n engine.enableEffect(drawWrapper);\n if (!hardwareInstancedRendering) {\n renderingMesh._bind(subMesh, effect, material.fillMode);\n }\n this.getTransformMatrix(); // make sure _cachedDirection et _cachedPosition are up to date\n effect.setFloat3(\"biasAndScaleSM\", this.bias, this.normalBias, this.depthScale);\n if (this.getLight().getTypeID() === Light.LIGHTTYPEID_DIRECTIONALLIGHT) {\n effect.setVector3(\"lightDataSM\", this._cachedDirection);\n } else {\n effect.setVector3(\"lightDataSM\", this._cachedPosition);\n }\n const camera = this._getCamera();\n if (camera) {\n effect.setFloat2(\"depthValuesSM\", this.getLight().getDepthMinZ(camera), this.getLight().getDepthMinZ(camera) + this.getLight().getDepthMaxZ(camera));\n }\n if (isTransparent && this.enableSoftTransparentShadow) {\n var _this$_opacityTexture;\n effect.setFloat2(\"softTransparentShadowSM\", effectiveMesh.visibility * material.alpha, (_this$_opacityTexture = this._opacityTexture) !== null && _this$_opacityTexture !== void 0 && _this$_opacityTexture.getAlphaFromRGB ? 1 : 0);\n }\n if (shadowDepthWrapper) {\n subMesh._setMainDrawWrapperOverride(drawWrapper);\n if (shadowDepthWrapper.standalone) {\n shadowDepthWrapper.baseMaterial.bindForSubMesh(effectiveMesh.getWorldMatrix(), renderingMesh, subMesh);\n } else {\n material.bindForSubMesh(effectiveMesh.getWorldMatrix(), renderingMesh, subMesh);\n }\n subMesh._setMainDrawWrapperOverride(null);\n } else {\n // Alpha test\n if (this._opacityTexture) {\n effect.setTexture(\"diffuseSampler\", this._opacityTexture);\n effect.setMatrix(\"diffuseMatrix\", this._opacityTexture.getTextureMatrix() || this._defaultTextureMatrix);\n }\n // Bones\n if (renderingMesh.useBones && renderingMesh.computeBonesUsingShaders && renderingMesh.skeleton) {\n const skeleton = renderingMesh.skeleton;\n if (skeleton.isUsingTextureForMatrices) {\n const boneTexture = skeleton.getTransformMatrixTexture(renderingMesh);\n if (!boneTexture) {\n return;\n }\n effect.setTexture(\"boneSampler\", boneTexture);\n effect.setFloat(\"boneTextureWidth\", 4.0 * (skeleton.bones.length + 1));\n } else {\n effect.setMatrices(\"mBones\", skeleton.getTransformMatrices(renderingMesh));\n }\n }\n // Morph targets\n BindMorphTargetParameters(renderingMesh, effect);\n if (renderingMesh.morphTargetManager && renderingMesh.morphTargetManager.isUsingTextureForTargets) {\n renderingMesh.morphTargetManager._bind(effect);\n }\n // Baked vertex animations\n const bvaManager = subMesh.getMesh().bakedVertexAnimationManager;\n if (bvaManager && bvaManager.isEnabled) {\n bvaManager.bind(effect, hardwareInstancedRendering);\n }\n // Clip planes\n bindClipPlane(effect, material, scene);\n }\n if (!this._useUBO && !shadowDepthWrapper) {\n this._bindCustomEffectForRenderSubMeshForShadowMap(subMesh, effect, effectiveMesh);\n }\n BindSceneUniformBuffer(effect, this._scene.getSceneUniformBuffer());\n this._scene.getSceneUniformBuffer().bindUniformBuffer();\n const world = effectiveMesh.getWorldMatrix();\n // In the non hardware instanced mode, the Mesh ubo update is done by the callback passed to renderingMesh._processRendering (see below)\n if (hardwareInstancedRendering) {\n effectiveMesh.getMeshUniformBuffer().bindToEffect(effect, \"Mesh\");\n effectiveMesh.transferToEffect(world);\n }\n if (this.forceBackFacesOnly) {\n engine.setState(true, 0, false, true, material.cullBackFaces);\n }\n // Observables\n this.onBeforeShadowMapRenderMeshObservable.notifyObservers(renderingMesh);\n this.onBeforeShadowMapRenderObservable.notifyObservers(effect);\n // Draw\n renderingMesh._processRendering(effectiveMesh, subMesh, effect, material.fillMode, batch, hardwareInstancedRendering, (isInstance, worldOverride) => {\n if (effectiveMesh !== renderingMesh && !isInstance) {\n renderingMesh.getMeshUniformBuffer().bindToEffect(effect, \"Mesh\");\n renderingMesh.transferToEffect(worldOverride);\n } else {\n effectiveMesh.getMeshUniformBuffer().bindToEffect(effect, \"Mesh\");\n effectiveMesh.transferToEffect(isInstance ? worldOverride : world);\n }\n });\n if (this.forceBackFacesOnly) {\n engine.setState(true, 0, false, false, material.cullBackFaces);\n }\n // Observables\n this.onAfterShadowMapRenderObservable.notifyObservers(effect);\n this.onAfterShadowMapRenderMeshObservable.notifyObservers(renderingMesh);\n } else {\n // Need to reset refresh rate of the shadowMap\n if (this._shadowMap) {\n this._shadowMap.resetRefreshCounter();\n }\n }\n }\n _applyFilterValues() {\n if (!this._shadowMap) {\n return;\n }\n if (this.filter === ShadowGenerator.FILTER_NONE || this.filter === ShadowGenerator.FILTER_PCSS) {\n this._shadowMap.updateSamplingMode(Texture.NEAREST_SAMPLINGMODE);\n } else {\n this._shadowMap.updateSamplingMode(Texture.BILINEAR_SAMPLINGMODE);\n }\n }\n /**\n * Forces all the attached effect to compile to enable rendering only once ready vs. lazily compiling effects.\n * @param onCompiled Callback triggered at the and of the effects compilation\n * @param options Sets of optional options forcing the compilation with different modes\n */\n forceCompilation(onCompiled, options) {\n const localOptions = {\n useInstances: false,\n ...options\n };\n const shadowMap = this.getShadowMap();\n if (!shadowMap) {\n if (onCompiled) {\n onCompiled(this);\n }\n return;\n }\n const renderList = shadowMap.renderList;\n if (!renderList) {\n if (onCompiled) {\n onCompiled(this);\n }\n return;\n }\n const subMeshes = [];\n for (const mesh of renderList) {\n subMeshes.push(...mesh.subMeshes);\n }\n if (subMeshes.length === 0) {\n if (onCompiled) {\n onCompiled(this);\n }\n return;\n }\n let currentIndex = 0;\n const checkReady = () => {\n if (!this._scene || !this._scene.getEngine()) {\n return;\n }\n while (this.isReady(subMeshes[currentIndex], localOptions.useInstances, (_subMeshes$currentInd = (_subMeshes$currentInd2 = subMeshes[currentIndex].getMaterial()) === null || _subMeshes$currentInd2 === void 0 ? void 0 : _subMeshes$currentInd2.needAlphaBlendingForMesh(subMeshes[currentIndex].getMesh())) !== null && _subMeshes$currentInd !== void 0 ? _subMeshes$currentInd : false)) {\n var _subMeshes$currentInd, _subMeshes$currentInd2;\n currentIndex++;\n if (currentIndex >= subMeshes.length) {\n if (onCompiled) {\n onCompiled(this);\n }\n return;\n }\n }\n setTimeout(checkReady, 16);\n };\n checkReady();\n }\n /**\n * Forces all the attached effect to compile to enable rendering only once ready vs. lazily compiling effects.\n * @param options Sets of optional options forcing the compilation with different modes\n * @returns A promise that resolves when the compilation completes\n */\n forceCompilationAsync(options) {\n return new Promise(resolve => {\n this.forceCompilation(() => {\n resolve();\n }, options);\n });\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _isReadyCustomDefines(defines, subMesh, useInstances) {}\n _prepareShadowDefines(subMesh, useInstances, defines, isTransparent) {\n defines.push(\"#define SM_LIGHTTYPE_\" + this._light.getClassName().toUpperCase());\n defines.push(\"#define SM_FLOAT \" + (this._textureType !== 0 ? \"1\" : \"0\"));\n defines.push(\"#define SM_ESM \" + (this.useExponentialShadowMap || this.useBlurExponentialShadowMap ? \"1\" : \"0\"));\n defines.push(\"#define SM_DEPTHTEXTURE \" + (this.usePercentageCloserFiltering || this.useContactHardeningShadow ? \"1\" : \"0\"));\n const mesh = subMesh.getMesh();\n // Normal bias.\n defines.push(\"#define SM_NORMALBIAS \" + (this.normalBias && mesh.isVerticesDataPresent(VertexBuffer.NormalKind) ? \"1\" : \"0\"));\n defines.push(\"#define SM_DIRECTIONINLIGHTDATA \" + (this.getLight().getTypeID() === Light.LIGHTTYPEID_DIRECTIONALLIGHT ? \"1\" : \"0\"));\n // Point light\n defines.push(\"#define SM_USEDISTANCE \" + (this._light.needCube() ? \"1\" : \"0\"));\n // Soft transparent shadows\n defines.push(\"#define SM_SOFTTRANSPARENTSHADOW \" + (this.enableSoftTransparentShadow && isTransparent ? \"1\" : \"0\"));\n this._isReadyCustomDefines(defines, subMesh, useInstances);\n return defines;\n }\n /**\n * Determine whether the shadow generator is ready or not (mainly all effects and related post processes needs to be ready).\n * @param subMesh The submesh we want to render in the shadow map\n * @param useInstances Defines whether will draw in the map using instances\n * @param isTransparent Indicates that isReady is called for a transparent subMesh\n * @returns true if ready otherwise, false\n */\n isReady(subMesh, useInstances, isTransparent) {\n if (!this._shadersLoaded) {\n return false;\n }\n const material = subMesh.getMaterial(),\n shadowDepthWrapper = material === null || material === void 0 ? void 0 : material.shadowDepthWrapper;\n this._opacityTexture = null;\n if (!material) {\n return false;\n }\n const defines = [];\n this._prepareShadowDefines(subMesh, useInstances, defines, isTransparent);\n if (shadowDepthWrapper) {\n if (!shadowDepthWrapper.isReadyForSubMesh(subMesh, defines, this, useInstances, this._scene.getEngine().currentRenderPassId)) {\n return false;\n }\n } else {\n const subMeshEffect = subMesh._getDrawWrapper(undefined, true);\n let effect = subMeshEffect.effect;\n let cachedDefines = subMeshEffect.defines;\n const attribs = [VertexBuffer.PositionKind];\n const mesh = subMesh.getMesh();\n // Normal bias.\n if (this.normalBias && mesh.isVerticesDataPresent(VertexBuffer.NormalKind)) {\n attribs.push(VertexBuffer.NormalKind);\n defines.push(\"#define NORMAL\");\n if (mesh.nonUniformScaling) {\n defines.push(\"#define NONUNIFORMSCALING\");\n }\n }\n // Alpha test\n const needAlphaTesting = material.needAlphaTesting();\n if (needAlphaTesting || material.needAlphaBlending()) {\n if (this.useOpacityTextureForTransparentShadow) {\n this._opacityTexture = material.opacityTexture;\n } else {\n this._opacityTexture = material.getAlphaTestTexture();\n }\n if (this._opacityTexture) {\n var _material$alphaCutOff;\n if (!this._opacityTexture.isReady()) {\n return false;\n }\n const alphaCutOff = (_material$alphaCutOff = material.alphaCutOff) !== null && _material$alphaCutOff !== void 0 ? _material$alphaCutOff : ShadowGenerator.DEFAULT_ALPHA_CUTOFF;\n defines.push(\"#define ALPHATEXTURE\");\n if (needAlphaTesting) {\n defines.push(`#define ALPHATESTVALUE ${alphaCutOff}${alphaCutOff % 1 === 0 ? \".\" : \"\"}`);\n }\n if (mesh.isVerticesDataPresent(VertexBuffer.UVKind)) {\n attribs.push(VertexBuffer.UVKind);\n defines.push(\"#define UV1\");\n }\n if (mesh.isVerticesDataPresent(VertexBuffer.UV2Kind)) {\n if (this._opacityTexture.coordinatesIndex === 1) {\n attribs.push(VertexBuffer.UV2Kind);\n defines.push(\"#define UV2\");\n }\n }\n }\n }\n // Bones\n const fallbacks = new EffectFallbacks();\n if (mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton) {\n attribs.push(VertexBuffer.MatricesIndicesKind);\n attribs.push(VertexBuffer.MatricesWeightsKind);\n if (mesh.numBoneInfluencers > 4) {\n attribs.push(VertexBuffer.MatricesIndicesExtraKind);\n attribs.push(VertexBuffer.MatricesWeightsExtraKind);\n }\n const skeleton = mesh.skeleton;\n defines.push(\"#define NUM_BONE_INFLUENCERS \" + mesh.numBoneInfluencers);\n if (mesh.numBoneInfluencers > 0) {\n fallbacks.addCPUSkinningFallback(0, mesh);\n }\n if (skeleton.isUsingTextureForMatrices) {\n defines.push(\"#define BONETEXTURE\");\n } else {\n defines.push(\"#define BonesPerMesh \" + (skeleton.bones.length + 1));\n }\n } else {\n defines.push(\"#define NUM_BONE_INFLUENCERS 0\");\n }\n // Morph targets\n const manager = mesh.morphTargetManager;\n let morphInfluencers = 0;\n if (manager) {\n morphInfluencers = manager.numMaxInfluencers || manager.numInfluencers;\n if (morphInfluencers > 0) {\n defines.push(\"#define MORPHTARGETS\");\n defines.push(\"#define NUM_MORPH_INFLUENCERS \" + morphInfluencers);\n if (manager.isUsingTextureForTargets) {\n defines.push(\"#define MORPHTARGETS_TEXTURE\");\n }\n PrepareAttributesForMorphTargetsInfluencers(attribs, mesh, morphInfluencers);\n }\n }\n // ClipPlanes\n prepareStringDefinesForClipPlanes(material, this._scene, defines);\n // Instances\n if (useInstances) {\n defines.push(\"#define INSTANCES\");\n PushAttributesForInstances(attribs);\n if (subMesh.getRenderingMesh().hasThinInstances) {\n defines.push(\"#define THIN_INSTANCES\");\n }\n }\n if (this.customShaderOptions) {\n if (this.customShaderOptions.defines) {\n for (const define of this.customShaderOptions.defines) {\n if (defines.indexOf(define) === -1) {\n defines.push(define);\n }\n }\n }\n }\n // Baked vertex animations\n const bvaManager = mesh.bakedVertexAnimationManager;\n if (bvaManager && bvaManager.isEnabled) {\n defines.push(\"#define BAKED_VERTEX_ANIMATION_TEXTURE\");\n if (useInstances) {\n attribs.push(\"bakedVertexAnimationSettingsInstanced\");\n }\n }\n // Get correct effect\n const join = defines.join(\"\\n\");\n if (cachedDefines !== join) {\n cachedDefines = join;\n let shaderName = \"shadowMap\";\n const uniforms = [\"world\", \"mBones\", \"viewProjection\", \"diffuseMatrix\", \"lightDataSM\", \"depthValuesSM\", \"biasAndScaleSM\", \"morphTargetInfluences\", \"morphTargetCount\", \"boneTextureWidth\", \"softTransparentShadowSM\", \"morphTargetTextureInfo\", \"morphTargetTextureIndices\", \"bakedVertexAnimationSettings\", \"bakedVertexAnimationTextureSizeInverted\", \"bakedVertexAnimationTime\", \"bakedVertexAnimationTexture\"];\n const samplers = [\"diffuseSampler\", \"boneSampler\", \"morphTargets\", \"bakedVertexAnimationTexture\"];\n const uniformBuffers = [\"Scene\", \"Mesh\"];\n addClipPlaneUniforms(uniforms);\n // Custom shader?\n if (this.customShaderOptions) {\n shaderName = this.customShaderOptions.shaderName;\n if (this.customShaderOptions.attributes) {\n for (const attrib of this.customShaderOptions.attributes) {\n if (attribs.indexOf(attrib) === -1) {\n attribs.push(attrib);\n }\n }\n }\n if (this.customShaderOptions.uniforms) {\n for (const uniform of this.customShaderOptions.uniforms) {\n if (uniforms.indexOf(uniform) === -1) {\n uniforms.push(uniform);\n }\n }\n }\n if (this.customShaderOptions.samplers) {\n for (const sampler of this.customShaderOptions.samplers) {\n if (samplers.indexOf(sampler) === -1) {\n samplers.push(sampler);\n }\n }\n }\n }\n const engine = this._scene.getEngine();\n effect = engine.createEffect(shaderName, {\n attributes: attribs,\n uniformsNames: uniforms,\n uniformBuffersNames: uniformBuffers,\n samplers: samplers,\n defines: join,\n fallbacks: fallbacks,\n onCompiled: null,\n onError: null,\n indexParameters: {\n maxSimultaneousMorphTargets: morphInfluencers\n },\n shaderLanguage: this._shaderLanguage\n }, engine);\n subMeshEffect.setEffect(effect, cachedDefines);\n }\n if (!effect.isReady()) {\n return false;\n }\n }\n if (this.useBlurExponentialShadowMap || this.useBlurCloseExponentialShadowMap) {\n if (!this._blurPostProcesses || !this._blurPostProcesses.length) {\n this._initializeBlurRTTAndPostProcesses();\n }\n }\n if (this._kernelBlurXPostprocess && !this._kernelBlurXPostprocess.isReady()) {\n return false;\n }\n if (this._kernelBlurYPostprocess && !this._kernelBlurYPostprocess.isReady()) {\n return false;\n }\n if (this._boxBlurPostprocess && !this._boxBlurPostprocess.isReady()) {\n return false;\n }\n return true;\n }\n /**\n * Prepare all the defines in a material relying on a shadow map at the specified light index.\n * @param defines Defines of the material we want to update\n * @param lightIndex Index of the light in the enabled light list of the material\n */\n prepareDefines(defines, lightIndex) {\n const scene = this._scene;\n const light = this._light;\n if (!scene.shadowsEnabled || !light.shadowEnabled) {\n return;\n }\n defines[\"SHADOW\" + lightIndex] = true;\n if (this.useContactHardeningShadow) {\n defines[\"SHADOWPCSS\" + lightIndex] = true;\n if (this._filteringQuality === ShadowGenerator.QUALITY_LOW) {\n defines[\"SHADOWLOWQUALITY\" + lightIndex] = true;\n } else if (this._filteringQuality === ShadowGenerator.QUALITY_MEDIUM) {\n defines[\"SHADOWMEDIUMQUALITY\" + lightIndex] = true;\n }\n // else default to high.\n } else if (this.usePercentageCloserFiltering) {\n defines[\"SHADOWPCF\" + lightIndex] = true;\n if (this._filteringQuality === ShadowGenerator.QUALITY_LOW) {\n defines[\"SHADOWLOWQUALITY\" + lightIndex] = true;\n } else if (this._filteringQuality === ShadowGenerator.QUALITY_MEDIUM) {\n defines[\"SHADOWMEDIUMQUALITY\" + lightIndex] = true;\n }\n // else default to high.\n } else if (this.usePoissonSampling) {\n defines[\"SHADOWPOISSON\" + lightIndex] = true;\n } else if (this.useExponentialShadowMap || this.useBlurExponentialShadowMap) {\n defines[\"SHADOWESM\" + lightIndex] = true;\n } else if (this.useCloseExponentialShadowMap || this.useBlurCloseExponentialShadowMap) {\n defines[\"SHADOWCLOSEESM\" + lightIndex] = true;\n }\n if (light.needCube()) {\n defines[\"SHADOWCUBE\" + lightIndex] = true;\n }\n }\n /**\n * Binds the shadow related information inside of an effect (information like near, far, darkness...\n * defined in the generator but impacting the effect).\n * @param lightIndex Index of the light in the enabled light list of the material owning the effect\n * @param effect The effect we are binding the information for\n */\n bindShadowLight(lightIndex, effect) {\n const light = this._light;\n const scene = this._scene;\n if (!scene.shadowsEnabled || !light.shadowEnabled) {\n return;\n }\n const camera = this._getCamera();\n if (!camera) {\n return;\n }\n const shadowMap = this.getShadowMap();\n if (!shadowMap) {\n return;\n }\n if (!light.needCube()) {\n effect.setMatrix(\"lightMatrix\" + lightIndex, this.getTransformMatrix());\n }\n // Only PCF uses depth stencil texture.\n const shadowMapForRendering = this.getShadowMapForRendering();\n if (this._filter === ShadowGenerator.FILTER_PCF) {\n effect.setDepthStencilTexture(\"shadowTexture\" + lightIndex, shadowMapForRendering);\n light._uniformBuffer.updateFloat4(\"shadowsInfo\", this.getDarkness(), shadowMap.getSize().width, 1 / shadowMap.getSize().width, this.frustumEdgeFalloff, lightIndex);\n } else if (this._filter === ShadowGenerator.FILTER_PCSS) {\n effect.setDepthStencilTexture(\"shadowTexture\" + lightIndex, shadowMapForRendering);\n effect.setTexture(\"depthTexture\" + lightIndex, shadowMapForRendering);\n light._uniformBuffer.updateFloat4(\"shadowsInfo\", this.getDarkness(), 1 / shadowMap.getSize().width, this._contactHardeningLightSizeUVRatio * shadowMap.getSize().width, this.frustumEdgeFalloff, lightIndex);\n } else {\n effect.setTexture(\"shadowTexture\" + lightIndex, shadowMapForRendering);\n light._uniformBuffer.updateFloat4(\"shadowsInfo\", this.getDarkness(), this.blurScale / shadowMap.getSize().width, this.depthScale, this.frustumEdgeFalloff, lightIndex);\n }\n light._uniformBuffer.updateFloat2(\"depthValues\", this.getLight().getDepthMinZ(camera), this.getLight().getDepthMinZ(camera) + this.getLight().getDepthMaxZ(camera), lightIndex);\n }\n /**\n * Gets the view matrix used to render the shadow map.\n */\n get viewMatrix() {\n return this._viewMatrix;\n }\n /**\n * Gets the projection matrix used to render the shadow map.\n */\n get projectionMatrix() {\n return this._projectionMatrix;\n }\n /**\n * Gets the transformation matrix used to project the meshes into the map from the light point of view.\n * (eq to shadow projection matrix * light transform matrix)\n * @returns The transform matrix used to create the shadow map\n */\n getTransformMatrix() {\n const scene = this._scene;\n if (this._currentRenderId === scene.getRenderId() && this._currentFaceIndexCache === this._currentFaceIndex) {\n return this._transformMatrix;\n }\n this._currentRenderId = scene.getRenderId();\n this._currentFaceIndexCache = this._currentFaceIndex;\n let lightPosition = this._light.position;\n if (this._light.computeTransformedInformation()) {\n lightPosition = this._light.transformedPosition;\n }\n Vector3.NormalizeToRef(this._light.getShadowDirection(this._currentFaceIndex), this._lightDirection);\n if (Math.abs(Vector3.Dot(this._lightDirection, Vector3.Up())) === 1.0) {\n this._lightDirection.z = 0.0000000000001; // Required to avoid perfectly perpendicular light\n }\n if (this._light.needProjectionMatrixCompute() || !this._cachedPosition || !this._cachedDirection || !lightPosition.equals(this._cachedPosition) || !this._lightDirection.equals(this._cachedDirection)) {\n this._cachedPosition.copyFrom(lightPosition);\n this._cachedDirection.copyFrom(this._lightDirection);\n Matrix.LookAtLHToRef(lightPosition, lightPosition.add(this._lightDirection), Vector3.Up(), this._viewMatrix);\n const shadowMap = this.getShadowMap();\n if (shadowMap) {\n const renderList = shadowMap.renderList;\n if (renderList) {\n this._light.setShadowProjectionMatrix(this._projectionMatrix, this._viewMatrix, renderList);\n }\n }\n this._viewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix);\n }\n return this._transformMatrix;\n }\n /**\n * Recreates the shadow map dependencies like RTT and post processes. This can be used during the switch between\n * Cube and 2D textures for instance.\n */\n recreateShadowMap() {\n const shadowMap = this._shadowMap;\n if (!shadowMap) {\n return;\n }\n // Track render list.\n const renderList = shadowMap.renderList;\n // Clean up existing data.\n this._disposeRTTandPostProcesses();\n // Reinitializes.\n this._initializeGenerator();\n // Reaffect the filter to ensure a correct fallback if necessary.\n this.filter = this._filter;\n // Reaffect the filter.\n this._applyFilterValues();\n // Reaffect Render List.\n if (renderList) {\n // Note: don't do this._shadowMap!.renderList = renderList;\n // The renderList hooked array is accessing the old RenderTargetTexture (see RenderTargetTexture._hookArray), which is disposed at this point (by the call to _disposeRTTandPostProcesses)\n if (!this._shadowMap.renderList) {\n this._shadowMap.renderList = [];\n }\n for (const mesh of renderList) {\n this._shadowMap.renderList.push(mesh);\n }\n } else {\n this._shadowMap.renderList = null;\n }\n }\n _disposeBlurPostProcesses() {\n if (this._shadowMap2) {\n this._shadowMap2.dispose();\n this._shadowMap2 = null;\n }\n if (this._boxBlurPostprocess) {\n this._boxBlurPostprocess.dispose();\n this._boxBlurPostprocess = null;\n }\n if (this._kernelBlurXPostprocess) {\n this._kernelBlurXPostprocess.dispose();\n this._kernelBlurXPostprocess = null;\n }\n if (this._kernelBlurYPostprocess) {\n this._kernelBlurYPostprocess.dispose();\n this._kernelBlurYPostprocess = null;\n }\n this._blurPostProcesses = [];\n }\n _disposeRTTandPostProcesses() {\n if (this._shadowMap) {\n this._shadowMap.dispose();\n this._shadowMap = null;\n }\n this._disposeBlurPostProcesses();\n }\n _disposeSceneUBOs() {\n if (this._sceneUBOs) {\n for (const ubo of this._sceneUBOs) {\n ubo.dispose();\n }\n this._sceneUBOs = [];\n }\n }\n /**\n * Disposes the ShadowGenerator.\n * Returns nothing.\n */\n dispose() {\n this._disposeRTTandPostProcesses();\n this._disposeSceneUBOs();\n if (this._light) {\n if (this._light._shadowGenerators) {\n const iterator = this._light._shadowGenerators.entries();\n for (let entry = iterator.next(); entry.done !== true; entry = iterator.next()) {\n const [camera, shadowGenerator] = entry.value;\n if (shadowGenerator === this) {\n this._light._shadowGenerators.delete(camera);\n }\n }\n if (this._light._shadowGenerators.size === 0) {\n this._light._shadowGenerators = null;\n }\n }\n this._light._markMeshesAsLightDirty();\n }\n this.onBeforeShadowMapRenderMeshObservable.clear();\n this.onBeforeShadowMapRenderObservable.clear();\n this.onAfterShadowMapRenderMeshObservable.clear();\n this.onAfterShadowMapRenderObservable.clear();\n }\n /**\n * Serializes the shadow generator setup to a json object.\n * @returns The serialized JSON object\n */\n serialize() {\n var _this$_camera2;\n const serializationObject = {};\n const shadowMap = this.getShadowMap();\n if (!shadowMap) {\n return serializationObject;\n }\n serializationObject.className = this.getClassName();\n serializationObject.lightId = this._light.id;\n serializationObject.cameraId = (_this$_camera2 = this._camera) === null || _this$_camera2 === void 0 ? void 0 : _this$_camera2.id;\n serializationObject.id = this.id;\n serializationObject.mapSize = shadowMap.getRenderSize();\n serializationObject.forceBackFacesOnly = this.forceBackFacesOnly;\n serializationObject.darkness = this.getDarkness();\n serializationObject.transparencyShadow = this._transparencyShadow;\n serializationObject.frustumEdgeFalloff = this.frustumEdgeFalloff;\n serializationObject.bias = this.bias;\n serializationObject.normalBias = this.normalBias;\n serializationObject.usePercentageCloserFiltering = this.usePercentageCloserFiltering;\n serializationObject.useContactHardeningShadow = this.useContactHardeningShadow;\n serializationObject.contactHardeningLightSizeUVRatio = this.contactHardeningLightSizeUVRatio;\n serializationObject.filteringQuality = this.filteringQuality;\n serializationObject.useExponentialShadowMap = this.useExponentialShadowMap;\n serializationObject.useBlurExponentialShadowMap = this.useBlurExponentialShadowMap;\n serializationObject.useCloseExponentialShadowMap = this.useBlurExponentialShadowMap;\n serializationObject.useBlurCloseExponentialShadowMap = this.useBlurExponentialShadowMap;\n serializationObject.usePoissonSampling = this.usePoissonSampling;\n serializationObject.depthScale = this.depthScale;\n serializationObject.blurBoxOffset = this.blurBoxOffset;\n serializationObject.blurKernel = this.blurKernel;\n serializationObject.blurScale = this.blurScale;\n serializationObject.useKernelBlur = this.useKernelBlur;\n serializationObject.renderList = [];\n if (shadowMap.renderList) {\n for (let meshIndex = 0; meshIndex < shadowMap.renderList.length; meshIndex++) {\n const mesh = shadowMap.renderList[meshIndex];\n serializationObject.renderList.push(mesh.id);\n }\n }\n return serializationObject;\n }\n /**\n * Parses a serialized ShadowGenerator and returns a new ShadowGenerator.\n * @param parsedShadowGenerator The JSON object to parse\n * @param scene The scene to create the shadow map for\n * @param constr A function that builds a shadow generator or undefined to create an instance of the default shadow generator\n * @returns The parsed shadow generator\n */\n static Parse(parsedShadowGenerator, scene, constr) {\n const light = scene.getLightById(parsedShadowGenerator.lightId);\n const camera = parsedShadowGenerator.cameraId !== undefined ? scene.getCameraById(parsedShadowGenerator.cameraId) : null;\n const shadowGenerator = constr ? constr(parsedShadowGenerator.mapSize, light, camera) : new ShadowGenerator(parsedShadowGenerator.mapSize, light, undefined, camera);\n const shadowMap = shadowGenerator.getShadowMap();\n for (let meshIndex = 0; meshIndex < parsedShadowGenerator.renderList.length; meshIndex++) {\n const meshes = scene.getMeshesById(parsedShadowGenerator.renderList[meshIndex]);\n meshes.forEach(function (mesh) {\n if (!shadowMap) {\n return;\n }\n if (!shadowMap.renderList) {\n shadowMap.renderList = [];\n }\n shadowMap.renderList.push(mesh);\n });\n }\n if (parsedShadowGenerator.id !== undefined) {\n shadowGenerator.id = parsedShadowGenerator.id;\n }\n shadowGenerator.forceBackFacesOnly = !!parsedShadowGenerator.forceBackFacesOnly;\n if (parsedShadowGenerator.darkness !== undefined) {\n shadowGenerator.setDarkness(parsedShadowGenerator.darkness);\n }\n if (parsedShadowGenerator.transparencyShadow) {\n shadowGenerator.setTransparencyShadow(true);\n }\n if (parsedShadowGenerator.frustumEdgeFalloff !== undefined) {\n shadowGenerator.frustumEdgeFalloff = parsedShadowGenerator.frustumEdgeFalloff;\n }\n if (parsedShadowGenerator.bias !== undefined) {\n shadowGenerator.bias = parsedShadowGenerator.bias;\n }\n if (parsedShadowGenerator.normalBias !== undefined) {\n shadowGenerator.normalBias = parsedShadowGenerator.normalBias;\n }\n if (parsedShadowGenerator.usePercentageCloserFiltering) {\n shadowGenerator.usePercentageCloserFiltering = true;\n } else if (parsedShadowGenerator.useContactHardeningShadow) {\n shadowGenerator.useContactHardeningShadow = true;\n } else if (parsedShadowGenerator.usePoissonSampling) {\n shadowGenerator.usePoissonSampling = true;\n } else if (parsedShadowGenerator.useExponentialShadowMap) {\n shadowGenerator.useExponentialShadowMap = true;\n } else if (parsedShadowGenerator.useBlurExponentialShadowMap) {\n shadowGenerator.useBlurExponentialShadowMap = true;\n } else if (parsedShadowGenerator.useCloseExponentialShadowMap) {\n shadowGenerator.useCloseExponentialShadowMap = true;\n } else if (parsedShadowGenerator.useBlurCloseExponentialShadowMap) {\n shadowGenerator.useBlurCloseExponentialShadowMap = true;\n }\n // Backward compat\n else if (parsedShadowGenerator.useVarianceShadowMap) {\n shadowGenerator.useExponentialShadowMap = true;\n } else if (parsedShadowGenerator.useBlurVarianceShadowMap) {\n shadowGenerator.useBlurExponentialShadowMap = true;\n }\n if (parsedShadowGenerator.contactHardeningLightSizeUVRatio !== undefined) {\n shadowGenerator.contactHardeningLightSizeUVRatio = parsedShadowGenerator.contactHardeningLightSizeUVRatio;\n }\n if (parsedShadowGenerator.filteringQuality !== undefined) {\n shadowGenerator.filteringQuality = parsedShadowGenerator.filteringQuality;\n }\n if (parsedShadowGenerator.depthScale) {\n shadowGenerator.depthScale = parsedShadowGenerator.depthScale;\n }\n if (parsedShadowGenerator.blurScale) {\n shadowGenerator.blurScale = parsedShadowGenerator.blurScale;\n }\n if (parsedShadowGenerator.blurBoxOffset) {\n shadowGenerator.blurBoxOffset = parsedShadowGenerator.blurBoxOffset;\n }\n if (parsedShadowGenerator.useKernelBlur) {\n shadowGenerator.useKernelBlur = parsedShadowGenerator.useKernelBlur;\n }\n if (parsedShadowGenerator.blurKernel) {\n shadowGenerator.blurKernel = parsedShadowGenerator.blurKernel;\n }\n return shadowGenerator;\n }\n}\n/**\n * Name of the shadow generator class\n */\nShadowGenerator.CLASSNAME = \"ShadowGenerator\";\n/**\n * Force all the shadow generators to compile to glsl even on WebGPU engines.\n * False by default. This is mostly meant for backward compatibility.\n */\nShadowGenerator.ForceGLSL = false;\n/**\n * Shadow generator mode None: no filtering applied.\n */\nShadowGenerator.FILTER_NONE = 0;\n/**\n * Shadow generator mode ESM: Exponential Shadow Mapping.\n * (http://developer.download.nvidia.com/presentations/2008/GDC/GDC08_SoftShadowMapping.pdf)\n */\nShadowGenerator.FILTER_EXPONENTIALSHADOWMAP = 1;\n/**\n * Shadow generator mode Poisson Sampling: Percentage Closer Filtering.\n * (Multiple Tap around evenly distributed around the pixel are used to evaluate the shadow strength)\n */\nShadowGenerator.FILTER_POISSONSAMPLING = 2;\n/**\n * Shadow generator mode ESM: Blurred Exponential Shadow Mapping.\n * (http://developer.download.nvidia.com/presentations/2008/GDC/GDC08_SoftShadowMapping.pdf)\n */\nShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP = 3;\n/**\n * Shadow generator mode ESM: Exponential Shadow Mapping using the inverse of the exponential preventing\n * edge artifacts on steep falloff.\n * (http://developer.download.nvidia.com/presentations/2008/GDC/GDC08_SoftShadowMapping.pdf)\n */\nShadowGenerator.FILTER_CLOSEEXPONENTIALSHADOWMAP = 4;\n/**\n * Shadow generator mode ESM: Blurred Exponential Shadow Mapping using the inverse of the exponential preventing\n * edge artifacts on steep falloff.\n * (http://developer.download.nvidia.com/presentations/2008/GDC/GDC08_SoftShadowMapping.pdf)\n */\nShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP = 5;\n/**\n * Shadow generator mode PCF: Percentage Closer Filtering\n * benefits from Webgl 2 shadow samplers. Fallback to Poisson Sampling in Webgl 1\n * (https://developer.nvidia.com/gpugems/GPUGems/gpugems_ch11.html)\n */\nShadowGenerator.FILTER_PCF = 6;\n/**\n * Shadow generator mode PCSS: Percentage Closering Soft Shadow.\n * benefits from Webgl 2 shadow samplers. Fallback to Poisson Sampling in Webgl 1\n * Contact Hardening\n */\nShadowGenerator.FILTER_PCSS = 7;\n/**\n * Reserved for PCF and PCSS\n * Highest Quality.\n *\n * Execute PCF on a 5*5 kernel improving a lot the shadow aliasing artifacts.\n *\n * Execute PCSS with 32 taps blocker search and 64 taps PCF.\n */\nShadowGenerator.QUALITY_HIGH = 0;\n/**\n * Reserved for PCF and PCSS\n * Good tradeoff for quality/perf cross devices\n *\n * Execute PCF on a 3*3 kernel.\n *\n * Execute PCSS with 16 taps blocker search and 32 taps PCF.\n */\nShadowGenerator.QUALITY_MEDIUM = 1;\n/**\n * Reserved for PCF and PCSS\n * The lowest quality but the fastest.\n *\n * Execute PCF on a 1*1 kernel.\n *\n * Execute PCSS with 16 taps blocker search and 16 taps PCF.\n */\nShadowGenerator.QUALITY_LOW = 2;\n/**\n * Defines the default alpha cutoff value used for transparent alpha tested materials.\n */\nShadowGenerator.DEFAULT_ALPHA_CUTOFF = 0.5;\n/**\n * @internal\n */\nShadowGenerator._SceneComponentInitialization = _ => {\n throw _WarnImport(\"ShadowGeneratorSceneComponent\");\n};","map":{"version":3,"names":["Matrix","Vector3","Vector2","Color4","VertexBuffer","Light","Texture","RenderTargetTexture","PostProcess","BlurPostProcess","Observable","_WarnImport","EffectFallbacks","RenderingManager","DrawWrapper","addClipPlaneUniforms","bindClipPlane","prepareStringDefinesForClipPlanes","BindMorphTargetParameters","BindSceneUniformBuffer","PrepareAttributesForMorphTargetsInfluencers","PushAttributesForInstances","ShadowGenerator","bias","_bias","normalBias","_normalBias","blurBoxOffset","_blurBoxOffset","value","_disposeBlurPostProcesses","blurScale","_blurScale","blurKernel","_blurKernel","useKernelBlur","_useKernelBlur","depthScale","_depthScale","undefined","_light","getDepthScale","_validateFilter","filter","_filter","needCube","FILTER_BLUREXPONENTIALSHADOWMAP","useExponentialShadowMap","FILTER_BLURCLOSEEXPONENTIALSHADOWMAP","useCloseExponentialShadowMap","FILTER_PCF","FILTER_PCSS","usePoissonSampling","_scene","getEngine","_features","supportShadowSamplers","_applyFilterValues","_markMeshesAsLightDirty","FILTER_POISSONSAMPLING","FILTER_NONE","FILTER_EXPONENTIALSHADOWMAP","useBlurExponentialShadowMap","FILTER_CLOSEEXPONENTIALSHADOWMAP","useBlurCloseExponentialShadowMap","usePercentageCloserFiltering","filteringQuality","_filteringQuality","useContactHardeningShadow","contactHardeningLightSizeUVRatio","_contactHardeningLightSizeUVRatio","darkness","_darkness","setDarkness","getDarkness","transparencyShadow","_transparencyShadow","setTransparencyShadow","transparent","getShadowMap","_shadowMap","getShadowMapForRendering","_shadowMap2","getClassName","CLASSNAME","addShadowCaster","mesh","includeDescendants","renderList","indexOf","push","childMesh","getChildMeshes","removeShadowCaster","index","splice","child","getChildren","getLight","shaderLanguage","_shaderLanguage","_getCamera","_this$_camera","_camera","activeCamera","mapSize","_mapSize","size","recreateShadowMap","constructor","light","usefullFloatFirst","camera","useRedTextureType","forceGLSL","onBeforeShadowMapRenderObservable","onAfterShadowMapRenderObservable","onBeforeShadowMapRenderMeshObservable","onAfterShadowMapRenderMeshObservable","QUALITY_HIGH","enableSoftTransparentShadow","useOpacityTextureForTransparentShadow","frustumEdgeFalloff","forceBackFacesOnly","_lightDirection","Zero","_viewMatrix","_projectionMatrix","_transformMatrix","_cachedPosition","Number","MAX_VALUE","_cachedDirection","_currentFaceIndex","_currentFaceIndexCache","_defaultTextureMatrix","Identity","_shadersLoaded","getScene","_useRedTextureType","_initShaderSourceAsync","shadowGenerators","_shadowGenerators","Map","set","id","_useUBO","supportsUniformBuffers","_sceneUBOs","createSceneUniformBuffer","name","_SceneComponentInitialization","caps","getCaps","textureHalfFloatRender","textureHalfFloatLinearFiltering","_textureType","textureFloatRender","textureFloatLinearFiltering","_initializeGenerator","_initializeShadowMap","_createTargetRenderTexture","engine","supportDepthStencilTexture","createDepthStencilTexture","useReverseDepthBuffer","noPrePassRenderer","wrapU","CLAMP_ADDRESSMODE","wrapV","anisotropicFilteringLevel","updateSamplingMode","BILINEAR_SAMPLINGMODE","renderParticles","ignoreCameraViewport","_storedUniqueId","uniqueId","customRenderFunction","opaqueSubMeshes","alphaTestSubMeshes","transparentSubMeshes","depthOnlySubMeshes","_renderForShadowMap","customIsReadyFunction","onBeforeBindObservable","add","_engine$_debugPushGro","_currentSceneUBO","getSceneUniformBuffer","_debugPushGroup","call","currentRenderPassId","onBeforeRenderObservable","faceIndex","setSceneUniformBuffer","setColorWrite","getTransformMatrix","setTransformMatrix","unbindEffect","finalizeSceneUbo","onAfterUnbindObservable","_engine$_debugPopGrou2","updateTransformMatrix","_engine$_debugPopGrou","_debugPopGroup","shadowMap","postProcessManager","directRender","_blurPostProcesses","renderTarget","unBindFramebuffer","clearZero","clearOne","onClearObservable","clear","onResizeObservable","rtt","getRenderSize","i","MIN_RENDERINGGROUPS","MAX_RENDERINGGROUPS","setRenderingAutoClearDepthStencil","_this","_asyncToGenerator","isWebGPU","ForceGLSL","Promise","all","_initializeBlurRTTAndPostProcesses","targetSize","_kernelBlurXPostprocess","width","height","externalTextureSamplerBinding","onApplyObservable","effect","setTexture","_kernelBlurYPostprocess","autoClear","packedFloat","_boxBlurPostprocess","setFloat2","length","_renderSubMeshForShadowMap","data","getEffectiveMesh","_internalAbstractMeshDataInfo","_isActiveIntermediate","_bindCustomEffectForRenderSubMeshForShadowMap","subMesh","setMatrix","isTransparent","renderingMesh","getRenderingMesh","effectiveMesh","scene","material","getMaterial","verticesCount","_renderId","getRenderId","useRHS","useRightHandedSystem","detNeg","_getWorldMatrixDeterminant","sideOrientation","_getEffectiveOrientation","reverseSideOrientation","setState","backFaceCulling","cullBackFaces","batch","_getInstancesRenderList","_id","getReplacementMesh","mustReturn","hardwareInstancedRendering","instancedArrays","visibleInstances","hasThinInstances","customAllowRendering","isReady","_shadowDepthWrapper$g","shadowDepthWrapper","drawWrapper","getEffect","_getDrawWrapper","GetEffect","enableEffect","_bind","fillMode","setFloat3","getTypeID","LIGHTTYPEID_DIRECTIONALLIGHT","setVector3","getDepthMinZ","getDepthMaxZ","_this$_opacityTexture","visibility","alpha","_opacityTexture","getAlphaFromRGB","_setMainDrawWrapperOverride","standalone","baseMaterial","bindForSubMesh","getWorldMatrix","getTextureMatrix","useBones","computeBonesUsingShaders","skeleton","isUsingTextureForMatrices","boneTexture","getTransformMatrixTexture","setFloat","bones","setMatrices","getTransformMatrices","morphTargetManager","isUsingTextureForTargets","bvaManager","getMesh","bakedVertexAnimationManager","isEnabled","bind","bindUniformBuffer","world","getMeshUniformBuffer","bindToEffect","transferToEffect","notifyObservers","_processRendering","isInstance","worldOverride","resetRefreshCounter","NEAREST_SAMPLINGMODE","forceCompilation","onCompiled","options","localOptions","useInstances","subMeshes","currentIndex","checkReady","_subMeshes$currentInd","_subMeshes$currentInd2","needAlphaBlendingForMesh","setTimeout","forceCompilationAsync","resolve","_isReadyCustomDefines","defines","_prepareShadowDefines","toUpperCase","isVerticesDataPresent","NormalKind","isReadyForSubMesh","subMeshEffect","cachedDefines","attribs","PositionKind","nonUniformScaling","needAlphaTesting","needAlphaBlending","opacityTexture","getAlphaTestTexture","_material$alphaCutOff","alphaCutOff","DEFAULT_ALPHA_CUTOFF","UVKind","UV2Kind","coordinatesIndex","fallbacks","MatricesIndicesKind","MatricesWeightsKind","numBoneInfluencers","MatricesIndicesExtraKind","MatricesWeightsExtraKind","addCPUSkinningFallback","manager","morphInfluencers","numMaxInfluencers","numInfluencers","customShaderOptions","define","join","shaderName","uniforms","samplers","uniformBuffers","attributes","attrib","uniform","sampler","createEffect","uniformsNames","uniformBuffersNames","onError","indexParameters","maxSimultaneousMorphTargets","setEffect","prepareDefines","lightIndex","shadowsEnabled","shadowEnabled","QUALITY_LOW","QUALITY_MEDIUM","bindShadowLight","shadowMapForRendering","setDepthStencilTexture","_uniformBuffer","updateFloat4","getSize","updateFloat2","viewMatrix","projectionMatrix","_currentRenderId","lightPosition","position","computeTransformedInformation","transformedPosition","NormalizeToRef","getShadowDirection","Math","abs","Dot","Up","z","needProjectionMatrixCompute","equals","copyFrom","LookAtLHToRef","setShadowProjectionMatrix","multiplyToRef","_disposeRTTandPostProcesses","dispose","_disposeSceneUBOs","ubo","iterator","entries","entry","next","done","shadowGenerator","delete","serialize","_this$_camera2","serializationObject","className","lightId","cameraId","meshIndex","Parse","parsedShadowGenerator","constr","getLightById","getCameraById","meshes","getMeshesById","forEach","useVarianceShadowMap","useBlurVarianceShadowMap","_"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Lights/Shadows/shadowGenerator.js"],"sourcesContent":["import { Matrix, Vector3, Vector2 } from \"../../Maths/math.vector.js\";\nimport { Color4 } from \"../../Maths/math.color.js\";\nimport { VertexBuffer } from \"../../Buffers/buffer.js\";\nimport { Light } from \"../../Lights/light.js\";\nimport { Texture } from \"../../Materials/Textures/texture.js\";\nimport { RenderTargetTexture } from \"../../Materials/Textures/renderTargetTexture.js\";\nimport { PostProcess } from \"../../PostProcesses/postProcess.js\";\nimport { BlurPostProcess } from \"../../PostProcesses/blurPostProcess.js\";\n\nimport { Observable } from \"../../Misc/observable.js\";\nimport { _WarnImport } from \"../../Misc/devTools.js\";\nimport { EffectFallbacks } from \"../../Materials/effectFallbacks.js\";\nimport { RenderingManager } from \"../../Rendering/renderingManager.js\";\nimport { DrawWrapper } from \"../../Materials/drawWrapper.js\";\nimport { addClipPlaneUniforms, bindClipPlane, prepareStringDefinesForClipPlanes } from \"../../Materials/clipPlaneMaterialHelper.js\";\nimport { BindMorphTargetParameters, BindSceneUniformBuffer, PrepareAttributesForMorphTargetsInfluencers, PushAttributesForInstances, } from \"../../Materials/materialHelper.functions.js\";\n/**\n * Default implementation IShadowGenerator.\n * This is the main object responsible of generating shadows in the framework.\n * Documentation: https://doc.babylonjs.com/features/featuresDeepDive/lights/shadows\n * #IFYDRS#0: WebGL\n * #IFYDRS#835: WebGPU\n */\nexport class ShadowGenerator {\n /**\n * Gets the bias: offset applied on the depth preventing acnea (in light direction).\n */\n get bias() {\n return this._bias;\n }\n /**\n * Sets the bias: offset applied on the depth preventing acnea (in light direction).\n */\n set bias(bias) {\n this._bias = bias;\n }\n /**\n * Gets the normalBias: offset applied on the depth preventing acnea (along side the normal direction and proportional to the light/normal angle).\n */\n get normalBias() {\n return this._normalBias;\n }\n /**\n * Sets the normalBias: offset applied on the depth preventing acnea (along side the normal direction and proportional to the light/normal angle).\n */\n set normalBias(normalBias) {\n this._normalBias = normalBias;\n }\n /**\n * Gets the blur box offset: offset applied during the blur pass.\n * Only useful if useKernelBlur = false\n */\n get blurBoxOffset() {\n return this._blurBoxOffset;\n }\n /**\n * Sets the blur box offset: offset applied during the blur pass.\n * Only useful if useKernelBlur = false\n */\n set blurBoxOffset(value) {\n if (this._blurBoxOffset === value) {\n return;\n }\n this._blurBoxOffset = value;\n this._disposeBlurPostProcesses();\n }\n /**\n * Gets the blur scale: scale of the blurred texture compared to the main shadow map.\n * 2 means half of the size.\n */\n get blurScale() {\n return this._blurScale;\n }\n /**\n * Sets the blur scale: scale of the blurred texture compared to the main shadow map.\n * 2 means half of the size.\n */\n set blurScale(value) {\n if (this._blurScale === value) {\n return;\n }\n this._blurScale = value;\n this._disposeBlurPostProcesses();\n }\n /**\n * Gets the blur kernel: kernel size of the blur pass.\n * Only useful if useKernelBlur = true\n */\n get blurKernel() {\n return this._blurKernel;\n }\n /**\n * Sets the blur kernel: kernel size of the blur pass.\n * Only useful if useKernelBlur = true\n */\n set blurKernel(value) {\n if (this._blurKernel === value) {\n return;\n }\n this._blurKernel = value;\n this._disposeBlurPostProcesses();\n }\n /**\n * Gets whether the blur pass is a kernel blur (if true) or box blur.\n * Only useful in filtered mode (useBlurExponentialShadowMap...)\n */\n get useKernelBlur() {\n return this._useKernelBlur;\n }\n /**\n * Sets whether the blur pass is a kernel blur (if true) or box blur.\n * Only useful in filtered mode (useBlurExponentialShadowMap...)\n */\n set useKernelBlur(value) {\n if (this._useKernelBlur === value) {\n return;\n }\n this._useKernelBlur = value;\n this._disposeBlurPostProcesses();\n }\n /**\n * Gets the depth scale used in ESM mode.\n */\n get depthScale() {\n return this._depthScale !== undefined ? this._depthScale : this._light.getDepthScale();\n }\n /**\n * Sets the depth scale used in ESM mode.\n * This can override the scale stored on the light.\n */\n set depthScale(value) {\n this._depthScale = value;\n }\n _validateFilter(filter) {\n return filter;\n }\n /**\n * Gets the current mode of the shadow generator (normal, PCF, ESM...).\n * The returned value is a number equal to one of the available mode defined in ShadowMap.FILTER_x like _FILTER_NONE\n */\n get filter() {\n return this._filter;\n }\n /**\n * Sets the current mode of the shadow generator (normal, PCF, ESM...).\n * The returned value is a number equal to one of the available mode defined in ShadowMap.FILTER_x like _FILTER_NONE\n */\n set filter(value) {\n value = this._validateFilter(value);\n // Blurring the cubemap is going to be too expensive. Reverting to unblurred version\n if (this._light.needCube()) {\n if (value === ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP) {\n this.useExponentialShadowMap = true;\n return;\n }\n else if (value === ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP) {\n this.useCloseExponentialShadowMap = true;\n return;\n }\n // PCF on cubemap would also be expensive\n else if (value === ShadowGenerator.FILTER_PCF || value === ShadowGenerator.FILTER_PCSS) {\n this.usePoissonSampling = true;\n return;\n }\n }\n // Weblg1 fallback for PCF.\n if (value === ShadowGenerator.FILTER_PCF || value === ShadowGenerator.FILTER_PCSS) {\n if (!this._scene.getEngine()._features.supportShadowSamplers) {\n this.usePoissonSampling = true;\n return;\n }\n }\n if (this._filter === value) {\n return;\n }\n this._filter = value;\n this._disposeBlurPostProcesses();\n this._applyFilterValues();\n this._light._markMeshesAsLightDirty();\n }\n /**\n * Gets if the current filter is set to Poisson Sampling.\n */\n get usePoissonSampling() {\n return this.filter === ShadowGenerator.FILTER_POISSONSAMPLING;\n }\n /**\n * Sets the current filter to Poisson Sampling.\n */\n set usePoissonSampling(value) {\n const filter = this._validateFilter(ShadowGenerator.FILTER_POISSONSAMPLING);\n if (!value && this.filter !== ShadowGenerator.FILTER_POISSONSAMPLING) {\n return;\n }\n this.filter = value ? filter : ShadowGenerator.FILTER_NONE;\n }\n /**\n * Gets if the current filter is set to ESM.\n */\n get useExponentialShadowMap() {\n return this.filter === ShadowGenerator.FILTER_EXPONENTIALSHADOWMAP;\n }\n /**\n * Sets the current filter is to ESM.\n */\n set useExponentialShadowMap(value) {\n const filter = this._validateFilter(ShadowGenerator.FILTER_EXPONENTIALSHADOWMAP);\n if (!value && this.filter !== ShadowGenerator.FILTER_EXPONENTIALSHADOWMAP) {\n return;\n }\n this.filter = value ? filter : ShadowGenerator.FILTER_NONE;\n }\n /**\n * Gets if the current filter is set to filtered ESM.\n */\n get useBlurExponentialShadowMap() {\n return this.filter === ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP;\n }\n /**\n * Gets if the current filter is set to filtered ESM.\n */\n set useBlurExponentialShadowMap(value) {\n const filter = this._validateFilter(ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP);\n if (!value && this.filter !== ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP) {\n return;\n }\n this.filter = value ? filter : ShadowGenerator.FILTER_NONE;\n }\n /**\n * Gets if the current filter is set to \"close ESM\" (using the inverse of the\n * exponential to prevent steep falloff artifacts).\n */\n get useCloseExponentialShadowMap() {\n return this.filter === ShadowGenerator.FILTER_CLOSEEXPONENTIALSHADOWMAP;\n }\n /**\n * Sets the current filter to \"close ESM\" (using the inverse of the\n * exponential to prevent steep falloff artifacts).\n */\n set useCloseExponentialShadowMap(value) {\n const filter = this._validateFilter(ShadowGenerator.FILTER_CLOSEEXPONENTIALSHADOWMAP);\n if (!value && this.filter !== ShadowGenerator.FILTER_CLOSEEXPONENTIALSHADOWMAP) {\n return;\n }\n this.filter = value ? filter : ShadowGenerator.FILTER_NONE;\n }\n /**\n * Gets if the current filter is set to filtered \"close ESM\" (using the inverse of the\n * exponential to prevent steep falloff artifacts).\n */\n get useBlurCloseExponentialShadowMap() {\n return this.filter === ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP;\n }\n /**\n * Sets the current filter to filtered \"close ESM\" (using the inverse of the\n * exponential to prevent steep falloff artifacts).\n */\n set useBlurCloseExponentialShadowMap(value) {\n const filter = this._validateFilter(ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP);\n if (!value && this.filter !== ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP) {\n return;\n }\n this.filter = value ? filter : ShadowGenerator.FILTER_NONE;\n }\n /**\n * Gets if the current filter is set to \"PCF\" (percentage closer filtering).\n */\n get usePercentageCloserFiltering() {\n return this.filter === ShadowGenerator.FILTER_PCF;\n }\n /**\n * Sets the current filter to \"PCF\" (percentage closer filtering).\n */\n set usePercentageCloserFiltering(value) {\n const filter = this._validateFilter(ShadowGenerator.FILTER_PCF);\n if (!value && this.filter !== ShadowGenerator.FILTER_PCF) {\n return;\n }\n this.filter = value ? filter : ShadowGenerator.FILTER_NONE;\n }\n /**\n * Gets the PCF or PCSS Quality.\n * Only valid if usePercentageCloserFiltering or usePercentageCloserFiltering is true.\n */\n get filteringQuality() {\n return this._filteringQuality;\n }\n /**\n * Sets the PCF or PCSS Quality.\n * Only valid if usePercentageCloserFiltering or usePercentageCloserFiltering is true.\n */\n set filteringQuality(filteringQuality) {\n if (this._filteringQuality === filteringQuality) {\n return;\n }\n this._filteringQuality = filteringQuality;\n this._disposeBlurPostProcesses();\n this._applyFilterValues();\n this._light._markMeshesAsLightDirty();\n }\n /**\n * Gets if the current filter is set to \"PCSS\" (contact hardening).\n */\n get useContactHardeningShadow() {\n return this.filter === ShadowGenerator.FILTER_PCSS;\n }\n /**\n * Sets the current filter to \"PCSS\" (contact hardening).\n */\n set useContactHardeningShadow(value) {\n const filter = this._validateFilter(ShadowGenerator.FILTER_PCSS);\n if (!value && this.filter !== ShadowGenerator.FILTER_PCSS) {\n return;\n }\n this.filter = value ? filter : ShadowGenerator.FILTER_NONE;\n }\n /**\n * Gets the Light Size (in shadow map uv unit) used in PCSS to determine the blocker search area and the penumbra size.\n * Using a ratio helps keeping shape stability independently of the map size.\n *\n * It does not account for the light projection as it was having too much\n * instability during the light setup or during light position changes.\n *\n * Only valid if useContactHardeningShadow is true.\n */\n get contactHardeningLightSizeUVRatio() {\n return this._contactHardeningLightSizeUVRatio;\n }\n /**\n * Sets the Light Size (in shadow map uv unit) used in PCSS to determine the blocker search area and the penumbra size.\n * Using a ratio helps keeping shape stability independently of the map size.\n *\n * It does not account for the light projection as it was having too much\n * instability during the light setup or during light position changes.\n *\n * Only valid if useContactHardeningShadow is true.\n */\n set contactHardeningLightSizeUVRatio(contactHardeningLightSizeUVRatio) {\n this._contactHardeningLightSizeUVRatio = contactHardeningLightSizeUVRatio;\n }\n /** Gets or sets the actual darkness of a shadow */\n get darkness() {\n return this._darkness;\n }\n set darkness(value) {\n this.setDarkness(value);\n }\n /**\n * Returns the darkness value (float). This can only decrease the actual darkness of a shadow.\n * 0 means strongest and 1 would means no shadow.\n * @returns the darkness.\n */\n getDarkness() {\n return this._darkness;\n }\n /**\n * Sets the darkness value (float). This can only decrease the actual darkness of a shadow.\n * @param darkness The darkness value 0 means strongest and 1 would means no shadow.\n * @returns the shadow generator allowing fluent coding.\n */\n setDarkness(darkness) {\n if (darkness >= 1.0) {\n this._darkness = 1.0;\n }\n else if (darkness <= 0.0) {\n this._darkness = 0.0;\n }\n else {\n this._darkness = darkness;\n }\n return this;\n }\n /** Gets or sets the ability to have transparent shadow */\n get transparencyShadow() {\n return this._transparencyShadow;\n }\n set transparencyShadow(value) {\n this.setTransparencyShadow(value);\n }\n /**\n * Sets the ability to have transparent shadow (boolean).\n * @param transparent True if transparent else False\n * @returns the shadow generator allowing fluent coding\n */\n setTransparencyShadow(transparent) {\n this._transparencyShadow = transparent;\n return this;\n }\n /**\n * Gets the main RTT containing the shadow map (usually storing depth from the light point of view).\n * @returns The render target texture if present otherwise, null\n */\n getShadowMap() {\n return this._shadowMap;\n }\n /**\n * Gets the RTT used during rendering (can be a blurred version of the shadow map or the shadow map itself).\n * @returns The render target texture if the shadow map is present otherwise, null\n */\n getShadowMapForRendering() {\n if (this._shadowMap2) {\n return this._shadowMap2;\n }\n return this._shadowMap;\n }\n /**\n * Gets the class name of that object\n * @returns \"ShadowGenerator\"\n */\n getClassName() {\n return ShadowGenerator.CLASSNAME;\n }\n /**\n * Helper function to add a mesh and its descendants to the list of shadow casters.\n * @param mesh Mesh to add\n * @param includeDescendants boolean indicating if the descendants should be added. Default to true\n * @returns the Shadow Generator itself\n */\n addShadowCaster(mesh, includeDescendants = true) {\n if (!this._shadowMap) {\n return this;\n }\n if (!this._shadowMap.renderList) {\n this._shadowMap.renderList = [];\n }\n if (this._shadowMap.renderList.indexOf(mesh) === -1) {\n this._shadowMap.renderList.push(mesh);\n }\n if (includeDescendants) {\n for (const childMesh of mesh.getChildMeshes()) {\n if (this._shadowMap.renderList.indexOf(childMesh) === -1) {\n this._shadowMap.renderList.push(childMesh);\n }\n }\n }\n return this;\n }\n /**\n * Helper function to remove a mesh and its descendants from the list of shadow casters\n * @param mesh Mesh to remove\n * @param includeDescendants boolean indicating if the descendants should be removed. Default to true\n * @returns the Shadow Generator itself\n */\n removeShadowCaster(mesh, includeDescendants = true) {\n if (!this._shadowMap || !this._shadowMap.renderList) {\n return this;\n }\n const index = this._shadowMap.renderList.indexOf(mesh);\n if (index !== -1) {\n this._shadowMap.renderList.splice(index, 1);\n }\n if (includeDescendants) {\n for (const child of mesh.getChildren()) {\n this.removeShadowCaster(child);\n }\n }\n return this;\n }\n /**\n * Returns the associated light object.\n * @returns the light generating the shadow\n */\n getLight() {\n return this._light;\n }\n /**\n * Gets the shader language used in this generator.\n */\n get shaderLanguage() {\n return this._shaderLanguage;\n }\n _getCamera() {\n return this._camera ?? this._scene.activeCamera;\n }\n /**\n * Gets or sets the size of the texture what stores the shadows\n */\n get mapSize() {\n return this._mapSize;\n }\n set mapSize(size) {\n this._mapSize = size;\n this._light._markMeshesAsLightDirty();\n this.recreateShadowMap();\n }\n /**\n * Creates a ShadowGenerator object.\n * A ShadowGenerator is the required tool to use the shadows.\n * Each light casting shadows needs to use its own ShadowGenerator.\n * Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/shadows\n * @param mapSize The size of the texture what stores the shadows. Example : 1024.\n * @param light The light object generating the shadows.\n * @param usefullFloatFirst By default the generator will try to use half float textures but if you need precision (for self shadowing for instance), you can use this option to enforce full float texture.\n * @param camera Camera associated with this shadow generator (default: null). If null, takes the scene active camera at the time we need to access it\n * @param useRedTextureType Forces the generator to use a Red instead of a RGBA type for the shadow map texture format (default: false)\n * @param forceGLSL defines a boolean indicating if the shader must be compiled in GLSL even if we are using WebGPU\n */\n constructor(mapSize, light, usefullFloatFirst, camera, useRedTextureType, forceGLSL = false) {\n /**\n * Observable triggered before the shadow is rendered. Can be used to update internal effect state\n */\n this.onBeforeShadowMapRenderObservable = new Observable();\n /**\n * Observable triggered after the shadow is rendered. Can be used to restore internal effect state\n */\n this.onAfterShadowMapRenderObservable = new Observable();\n /**\n * Observable triggered before a mesh is rendered in the shadow map.\n * Can be used to update internal effect state (that you can get from the onBeforeShadowMapRenderObservable)\n */\n this.onBeforeShadowMapRenderMeshObservable = new Observable();\n /**\n * Observable triggered after a mesh is rendered in the shadow map.\n * Can be used to update internal effect state (that you can get from the onAfterShadowMapRenderObservable)\n */\n this.onAfterShadowMapRenderMeshObservable = new Observable();\n this._bias = 0.00005;\n this._normalBias = 0;\n this._blurBoxOffset = 1;\n this._blurScale = 2;\n this._blurKernel = 1;\n this._useKernelBlur = false;\n this._filter = ShadowGenerator.FILTER_NONE;\n this._filteringQuality = ShadowGenerator.QUALITY_HIGH;\n this._contactHardeningLightSizeUVRatio = 0.1;\n this._darkness = 0;\n this._transparencyShadow = false;\n /**\n * Enables or disables shadows with varying strength based on the transparency\n * When it is enabled, the strength of the shadow is taken equal to mesh.visibility\n * If you enabled an alpha texture on your material, the alpha value red from the texture is also combined to compute the strength:\n * mesh.visibility * alphaTexture.a\n * The texture used is the diffuse by default, but it can be set to the opacity by setting useOpacityTextureForTransparentShadow\n * Note that by definition transparencyShadow must be set to true for enableSoftTransparentShadow to work!\n */\n this.enableSoftTransparentShadow = false;\n /**\n * If this is true, use the opacity texture's alpha channel for transparent shadows instead of the diffuse one\n */\n this.useOpacityTextureForTransparentShadow = false;\n /**\n * Controls the extent to which the shadows fade out at the edge of the frustum\n */\n this.frustumEdgeFalloff = 0;\n /** Shader language used by the generator */\n this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;\n /**\n * If true the shadow map is generated by rendering the back face of the mesh instead of the front face.\n * This can help with self-shadowing as the geometry making up the back of objects is slightly offset.\n * It might on the other hand introduce peter panning.\n */\n this.forceBackFacesOnly = false;\n this._lightDirection = Vector3.Zero();\n this._viewMatrix = Matrix.Zero();\n this._projectionMatrix = Matrix.Zero();\n this._transformMatrix = Matrix.Zero();\n this._cachedPosition = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\n this._cachedDirection = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\n this._currentFaceIndex = 0;\n this._currentFaceIndexCache = 0;\n this._defaultTextureMatrix = Matrix.Identity();\n this._shadersLoaded = false;\n this._mapSize = mapSize;\n this._light = light;\n this._scene = light.getScene();\n this._camera = camera ?? null;\n this._useRedTextureType = !!useRedTextureType;\n this._initShaderSourceAsync(forceGLSL);\n let shadowGenerators = light._shadowGenerators;\n if (!shadowGenerators) {\n shadowGenerators = light._shadowGenerators = new Map();\n }\n shadowGenerators.set(this._camera, this);\n this.id = light.id;\n this._useUBO = this._scene.getEngine().supportsUniformBuffers;\n if (this._useUBO) {\n this._sceneUBOs = [];\n this._sceneUBOs.push(this._scene.createSceneUniformBuffer(`Scene for Shadow Generator (light \"${this._light.name}\")`));\n }\n ShadowGenerator._SceneComponentInitialization(this._scene);\n // Texture type fallback from float to int if not supported.\n const caps = this._scene.getEngine().getCaps();\n if (!usefullFloatFirst) {\n if (caps.textureHalfFloatRender && caps.textureHalfFloatLinearFiltering) {\n this._textureType = 2;\n }\n else if (caps.textureFloatRender && caps.textureFloatLinearFiltering) {\n this._textureType = 1;\n }\n else {\n this._textureType = 0;\n }\n }\n else {\n if (caps.textureFloatRender && caps.textureFloatLinearFiltering) {\n this._textureType = 1;\n }\n else if (caps.textureHalfFloatRender && caps.textureHalfFloatLinearFiltering) {\n this._textureType = 2;\n }\n else {\n this._textureType = 0;\n }\n }\n this._initializeGenerator();\n this._applyFilterValues();\n }\n _initializeGenerator() {\n this._light._markMeshesAsLightDirty();\n this._initializeShadowMap();\n }\n _createTargetRenderTexture() {\n const engine = this._scene.getEngine();\n if (engine._features.supportDepthStencilTexture) {\n this._shadowMap = new RenderTargetTexture(this._light.name + \"_shadowMap\", this._mapSize, this._scene, false, true, this._textureType, this._light.needCube(), undefined, false, false, undefined, this._useRedTextureType ? 6 : 5);\n this._shadowMap.createDepthStencilTexture(engine.useReverseDepthBuffer ? 516 : 513, true, undefined, undefined, undefined, `DepthStencilForShadowGenerator-${this._light.name}`);\n }\n else {\n this._shadowMap = new RenderTargetTexture(this._light.name + \"_shadowMap\", this._mapSize, this._scene, false, true, this._textureType, this._light.needCube());\n }\n this._shadowMap.noPrePassRenderer = true;\n }\n _initializeShadowMap() {\n this._createTargetRenderTexture();\n if (this._shadowMap === null) {\n return;\n }\n this._shadowMap.wrapU = Texture.CLAMP_ADDRESSMODE;\n this._shadowMap.wrapV = Texture.CLAMP_ADDRESSMODE;\n this._shadowMap.anisotropicFilteringLevel = 1;\n this._shadowMap.updateSamplingMode(Texture.BILINEAR_SAMPLINGMODE);\n this._shadowMap.renderParticles = false;\n this._shadowMap.ignoreCameraViewport = true;\n if (this._storedUniqueId) {\n this._shadowMap.uniqueId = this._storedUniqueId;\n }\n // Custom render function.\n this._shadowMap.customRenderFunction = (opaqueSubMeshes, alphaTestSubMeshes, transparentSubMeshes, depthOnlySubMeshes) => this._renderForShadowMap(opaqueSubMeshes, alphaTestSubMeshes, transparentSubMeshes, depthOnlySubMeshes);\n // Force the mesh is ready function to true as we are double checking it\n // in the custom render function. Also it prevents side effects and useless\n // shader variations in DEPTHPREPASS mode.\n this._shadowMap.customIsReadyFunction = () => {\n return true;\n };\n const engine = this._scene.getEngine();\n this._shadowMap.onBeforeBindObservable.add(() => {\n this._currentSceneUBO = this._scene.getSceneUniformBuffer();\n engine._debugPushGroup?.(`shadow map generation for pass id ${engine.currentRenderPassId}`, 1);\n });\n // Record Face Index before render.\n this._shadowMap.onBeforeRenderObservable.add((faceIndex) => {\n if (this._sceneUBOs) {\n this._scene.setSceneUniformBuffer(this._sceneUBOs[0]);\n }\n this._currentFaceIndex = faceIndex;\n if (this._filter === ShadowGenerator.FILTER_PCF) {\n engine.setColorWrite(false);\n }\n this.getTransformMatrix(); // generate the view/projection matrix\n this._scene.setTransformMatrix(this._viewMatrix, this._projectionMatrix);\n if (this._useUBO) {\n this._scene.getSceneUniformBuffer().unbindEffect();\n this._scene.finalizeSceneUbo();\n }\n });\n // Blur if required after render.\n this._shadowMap.onAfterUnbindObservable.add(() => {\n if (this._sceneUBOs) {\n this._scene.setSceneUniformBuffer(this._currentSceneUBO);\n }\n this._scene.updateTransformMatrix(); // restore the view/projection matrices of the active camera\n if (this._filter === ShadowGenerator.FILTER_PCF) {\n engine.setColorWrite(true);\n }\n if (!this.useBlurExponentialShadowMap && !this.useBlurCloseExponentialShadowMap) {\n engine._debugPopGroup?.(1);\n return;\n }\n const shadowMap = this.getShadowMapForRendering();\n if (shadowMap) {\n this._scene.postProcessManager.directRender(this._blurPostProcesses, shadowMap.renderTarget, true);\n engine.unBindFramebuffer(shadowMap.renderTarget, true);\n }\n engine._debugPopGroup?.(1);\n });\n // Clear according to the chosen filter.\n const clearZero = new Color4(0, 0, 0, 0);\n const clearOne = new Color4(1.0, 1.0, 1.0, 1.0);\n this._shadowMap.onClearObservable.add((engine) => {\n if (this._filter === ShadowGenerator.FILTER_PCF) {\n engine.clear(clearOne, false, true, false);\n }\n else if (this.useExponentialShadowMap || this.useBlurExponentialShadowMap) {\n engine.clear(clearZero, true, true, false);\n }\n else {\n engine.clear(clearOne, true, true, false);\n }\n });\n // Recreate on resize.\n this._shadowMap.onResizeObservable.add((rtt) => {\n this._storedUniqueId = this._shadowMap.uniqueId;\n this._mapSize = rtt.getRenderSize();\n this._light._markMeshesAsLightDirty();\n this.recreateShadowMap();\n });\n // Ensures rendering groupids do not erase the depth buffer\n // or we would lose the shadows information.\n for (let i = RenderingManager.MIN_RENDERINGGROUPS; i < RenderingManager.MAX_RENDERINGGROUPS; i++) {\n this._shadowMap.setRenderingAutoClearDepthStencil(i, false);\n }\n }\n async _initShaderSourceAsync(forceGLSL = false) {\n const engine = this._scene.getEngine();\n if (engine.isWebGPU && !forceGLSL && !ShadowGenerator.ForceGLSL) {\n this._shaderLanguage = 1 /* ShaderLanguage.WGSL */;\n await Promise.all([\n import(\"../../ShadersWGSL/shadowMap.fragment.js\"),\n import(\"../../ShadersWGSL/shadowMap.vertex.js\"),\n import(\"../../ShadersWGSL/depthBoxBlur.fragment.js\"),\n import(\"../../ShadersWGSL/ShadersInclude/shadowMapFragmentSoftTransparentShadow.js\"),\n ]);\n }\n else {\n await Promise.all([\n import(\"../../Shaders/shadowMap.fragment.js\"),\n import(\"../../Shaders/shadowMap.vertex.js\"),\n import(\"../../Shaders/depthBoxBlur.fragment.js\"),\n import(\"../../Shaders/ShadersInclude/shadowMapFragmentSoftTransparentShadow.js\"),\n ]);\n }\n this._shadersLoaded = true;\n }\n _initializeBlurRTTAndPostProcesses() {\n const engine = this._scene.getEngine();\n const targetSize = this._mapSize / this.blurScale;\n if (!this.useKernelBlur || this.blurScale !== 1.0) {\n this._shadowMap2 = new RenderTargetTexture(this._light.name + \"_shadowMap2\", targetSize, this._scene, false, true, this._textureType, undefined, undefined, false);\n this._shadowMap2.wrapU = Texture.CLAMP_ADDRESSMODE;\n this._shadowMap2.wrapV = Texture.CLAMP_ADDRESSMODE;\n this._shadowMap2.updateSamplingMode(Texture.BILINEAR_SAMPLINGMODE);\n }\n if (this.useKernelBlur) {\n this._kernelBlurXPostprocess = new BlurPostProcess(this._light.name + \"KernelBlurX\", new Vector2(1, 0), this.blurKernel, 1.0, null, Texture.BILINEAR_SAMPLINGMODE, engine, false, this._textureType);\n this._kernelBlurXPostprocess.width = targetSize;\n this._kernelBlurXPostprocess.height = targetSize;\n this._kernelBlurXPostprocess.externalTextureSamplerBinding = true;\n this._kernelBlurXPostprocess.onApplyObservable.add((effect) => {\n effect.setTexture(\"textureSampler\", this._shadowMap);\n });\n this._kernelBlurYPostprocess = new BlurPostProcess(this._light.name + \"KernelBlurY\", new Vector2(0, 1), this.blurKernel, 1.0, null, Texture.BILINEAR_SAMPLINGMODE, engine, false, this._textureType);\n this._kernelBlurXPostprocess.autoClear = false;\n this._kernelBlurYPostprocess.autoClear = false;\n if (this._textureType === 0) {\n this._kernelBlurXPostprocess.packedFloat = true;\n this._kernelBlurYPostprocess.packedFloat = true;\n }\n this._blurPostProcesses = [this._kernelBlurXPostprocess, this._kernelBlurYPostprocess];\n }\n else {\n this._boxBlurPostprocess = new PostProcess(this._light.name + \"DepthBoxBlur\", \"depthBoxBlur\", [\"screenSize\", \"boxOffset\"], [], 1.0, null, Texture.BILINEAR_SAMPLINGMODE, engine, false, \"#define OFFSET \" + this._blurBoxOffset, this._textureType, undefined, undefined, undefined, undefined, this._shaderLanguage);\n this._boxBlurPostprocess.externalTextureSamplerBinding = true;\n this._boxBlurPostprocess.onApplyObservable.add((effect) => {\n effect.setFloat2(\"screenSize\", targetSize, targetSize);\n effect.setTexture(\"textureSampler\", this._shadowMap);\n });\n this._boxBlurPostprocess.autoClear = false;\n this._blurPostProcesses = [this._boxBlurPostprocess];\n }\n }\n _renderForShadowMap(opaqueSubMeshes, alphaTestSubMeshes, transparentSubMeshes, depthOnlySubMeshes) {\n let index;\n if (depthOnlySubMeshes.length) {\n for (index = 0; index < depthOnlySubMeshes.length; index++) {\n this._renderSubMeshForShadowMap(depthOnlySubMeshes.data[index]);\n }\n }\n for (index = 0; index < opaqueSubMeshes.length; index++) {\n this._renderSubMeshForShadowMap(opaqueSubMeshes.data[index]);\n }\n for (index = 0; index < alphaTestSubMeshes.length; index++) {\n this._renderSubMeshForShadowMap(alphaTestSubMeshes.data[index]);\n }\n if (this._transparencyShadow) {\n for (index = 0; index < transparentSubMeshes.length; index++) {\n this._renderSubMeshForShadowMap(transparentSubMeshes.data[index], true);\n }\n }\n else {\n for (index = 0; index < transparentSubMeshes.length; index++) {\n transparentSubMeshes.data[index].getEffectiveMesh()._internalAbstractMeshDataInfo._isActiveIntermediate = false;\n }\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _bindCustomEffectForRenderSubMeshForShadowMap(subMesh, effect, mesh) {\n effect.setMatrix(\"viewProjection\", this.getTransformMatrix());\n }\n _renderSubMeshForShadowMap(subMesh, isTransparent = false) {\n const renderingMesh = subMesh.getRenderingMesh();\n const effectiveMesh = subMesh.getEffectiveMesh();\n const scene = this._scene;\n const engine = scene.getEngine();\n const material = subMesh.getMaterial();\n effectiveMesh._internalAbstractMeshDataInfo._isActiveIntermediate = false;\n if (!material || subMesh.verticesCount === 0 || subMesh._renderId === scene.getRenderId()) {\n return;\n }\n // Culling\n // Note:\n // In rhs mode, we assume that meshes will be rendered in right-handed space (i.e. with an RHS camera), so the default value of material.sideOrientation is updated accordingly (see material constructor).\n // However, when generating a shadow map, we render from the point of view of the light, whose view/projection matrices are always in lhs mode.\n // We therefore need to \"undo\" the sideOrientation inversion that was previously performed when constructing the material.\n const useRHS = scene.useRightHandedSystem;\n const detNeg = effectiveMesh._getWorldMatrixDeterminant() < 0;\n let sideOrientation = material._getEffectiveOrientation(renderingMesh);\n if ((detNeg && !useRHS) || (!detNeg && useRHS)) {\n sideOrientation =\n sideOrientation === 0 ? 1 : 0;\n }\n const reverseSideOrientation = sideOrientation === 0;\n engine.setState(material.backFaceCulling, undefined, undefined, reverseSideOrientation, material.cullBackFaces);\n // Managing instances\n const batch = renderingMesh._getInstancesRenderList(subMesh._id, !!subMesh.getReplacementMesh());\n if (batch.mustReturn) {\n return;\n }\n const hardwareInstancedRendering = engine.getCaps().instancedArrays &&\n ((batch.visibleInstances[subMesh._id] !== null && batch.visibleInstances[subMesh._id] !== undefined) || renderingMesh.hasThinInstances);\n if (this.customAllowRendering && !this.customAllowRendering(subMesh)) {\n return;\n }\n if (this.isReady(subMesh, hardwareInstancedRendering, isTransparent)) {\n subMesh._renderId = scene.getRenderId();\n const shadowDepthWrapper = material.shadowDepthWrapper;\n const drawWrapper = shadowDepthWrapper?.getEffect(subMesh, this, engine.currentRenderPassId) ?? subMesh._getDrawWrapper();\n const effect = DrawWrapper.GetEffect(drawWrapper);\n engine.enableEffect(drawWrapper);\n if (!hardwareInstancedRendering) {\n renderingMesh._bind(subMesh, effect, material.fillMode);\n }\n this.getTransformMatrix(); // make sure _cachedDirection et _cachedPosition are up to date\n effect.setFloat3(\"biasAndScaleSM\", this.bias, this.normalBias, this.depthScale);\n if (this.getLight().getTypeID() === Light.LIGHTTYPEID_DIRECTIONALLIGHT) {\n effect.setVector3(\"lightDataSM\", this._cachedDirection);\n }\n else {\n effect.setVector3(\"lightDataSM\", this._cachedPosition);\n }\n const camera = this._getCamera();\n if (camera) {\n effect.setFloat2(\"depthValuesSM\", this.getLight().getDepthMinZ(camera), this.getLight().getDepthMinZ(camera) + this.getLight().getDepthMaxZ(camera));\n }\n if (isTransparent && this.enableSoftTransparentShadow) {\n effect.setFloat2(\"softTransparentShadowSM\", effectiveMesh.visibility * material.alpha, this._opacityTexture?.getAlphaFromRGB ? 1 : 0);\n }\n if (shadowDepthWrapper) {\n subMesh._setMainDrawWrapperOverride(drawWrapper);\n if (shadowDepthWrapper.standalone) {\n shadowDepthWrapper.baseMaterial.bindForSubMesh(effectiveMesh.getWorldMatrix(), renderingMesh, subMesh);\n }\n else {\n material.bindForSubMesh(effectiveMesh.getWorldMatrix(), renderingMesh, subMesh);\n }\n subMesh._setMainDrawWrapperOverride(null);\n }\n else {\n // Alpha test\n if (this._opacityTexture) {\n effect.setTexture(\"diffuseSampler\", this._opacityTexture);\n effect.setMatrix(\"diffuseMatrix\", this._opacityTexture.getTextureMatrix() || this._defaultTextureMatrix);\n }\n // Bones\n if (renderingMesh.useBones && renderingMesh.computeBonesUsingShaders && renderingMesh.skeleton) {\n const skeleton = renderingMesh.skeleton;\n if (skeleton.isUsingTextureForMatrices) {\n const boneTexture = skeleton.getTransformMatrixTexture(renderingMesh);\n if (!boneTexture) {\n return;\n }\n effect.setTexture(\"boneSampler\", boneTexture);\n effect.setFloat(\"boneTextureWidth\", 4.0 * (skeleton.bones.length + 1));\n }\n else {\n effect.setMatrices(\"mBones\", skeleton.getTransformMatrices(renderingMesh));\n }\n }\n // Morph targets\n BindMorphTargetParameters(renderingMesh, effect);\n if (renderingMesh.morphTargetManager && renderingMesh.morphTargetManager.isUsingTextureForTargets) {\n renderingMesh.morphTargetManager._bind(effect);\n }\n // Baked vertex animations\n const bvaManager = subMesh.getMesh().bakedVertexAnimationManager;\n if (bvaManager && bvaManager.isEnabled) {\n bvaManager.bind(effect, hardwareInstancedRendering);\n }\n // Clip planes\n bindClipPlane(effect, material, scene);\n }\n if (!this._useUBO && !shadowDepthWrapper) {\n this._bindCustomEffectForRenderSubMeshForShadowMap(subMesh, effect, effectiveMesh);\n }\n BindSceneUniformBuffer(effect, this._scene.getSceneUniformBuffer());\n this._scene.getSceneUniformBuffer().bindUniformBuffer();\n const world = effectiveMesh.getWorldMatrix();\n // In the non hardware instanced mode, the Mesh ubo update is done by the callback passed to renderingMesh._processRendering (see below)\n if (hardwareInstancedRendering) {\n effectiveMesh.getMeshUniformBuffer().bindToEffect(effect, \"Mesh\");\n effectiveMesh.transferToEffect(world);\n }\n if (this.forceBackFacesOnly) {\n engine.setState(true, 0, false, true, material.cullBackFaces);\n }\n // Observables\n this.onBeforeShadowMapRenderMeshObservable.notifyObservers(renderingMesh);\n this.onBeforeShadowMapRenderObservable.notifyObservers(effect);\n // Draw\n renderingMesh._processRendering(effectiveMesh, subMesh, effect, material.fillMode, batch, hardwareInstancedRendering, (isInstance, worldOverride) => {\n if (effectiveMesh !== renderingMesh && !isInstance) {\n renderingMesh.getMeshUniformBuffer().bindToEffect(effect, \"Mesh\");\n renderingMesh.transferToEffect(worldOverride);\n }\n else {\n effectiveMesh.getMeshUniformBuffer().bindToEffect(effect, \"Mesh\");\n effectiveMesh.transferToEffect(isInstance ? worldOverride : world);\n }\n });\n if (this.forceBackFacesOnly) {\n engine.setState(true, 0, false, false, material.cullBackFaces);\n }\n // Observables\n this.onAfterShadowMapRenderObservable.notifyObservers(effect);\n this.onAfterShadowMapRenderMeshObservable.notifyObservers(renderingMesh);\n }\n else {\n // Need to reset refresh rate of the shadowMap\n if (this._shadowMap) {\n this._shadowMap.resetRefreshCounter();\n }\n }\n }\n _applyFilterValues() {\n if (!this._shadowMap) {\n return;\n }\n if (this.filter === ShadowGenerator.FILTER_NONE || this.filter === ShadowGenerator.FILTER_PCSS) {\n this._shadowMap.updateSamplingMode(Texture.NEAREST_SAMPLINGMODE);\n }\n else {\n this._shadowMap.updateSamplingMode(Texture.BILINEAR_SAMPLINGMODE);\n }\n }\n /**\n * Forces all the attached effect to compile to enable rendering only once ready vs. lazily compiling effects.\n * @param onCompiled Callback triggered at the and of the effects compilation\n * @param options Sets of optional options forcing the compilation with different modes\n */\n forceCompilation(onCompiled, options) {\n const localOptions = {\n useInstances: false,\n ...options,\n };\n const shadowMap = this.getShadowMap();\n if (!shadowMap) {\n if (onCompiled) {\n onCompiled(this);\n }\n return;\n }\n const renderList = shadowMap.renderList;\n if (!renderList) {\n if (onCompiled) {\n onCompiled(this);\n }\n return;\n }\n const subMeshes = [];\n for (const mesh of renderList) {\n subMeshes.push(...mesh.subMeshes);\n }\n if (subMeshes.length === 0) {\n if (onCompiled) {\n onCompiled(this);\n }\n return;\n }\n let currentIndex = 0;\n const checkReady = () => {\n if (!this._scene || !this._scene.getEngine()) {\n return;\n }\n while (this.isReady(subMeshes[currentIndex], localOptions.useInstances, subMeshes[currentIndex].getMaterial()?.needAlphaBlendingForMesh(subMeshes[currentIndex].getMesh()) ?? false)) {\n currentIndex++;\n if (currentIndex >= subMeshes.length) {\n if (onCompiled) {\n onCompiled(this);\n }\n return;\n }\n }\n setTimeout(checkReady, 16);\n };\n checkReady();\n }\n /**\n * Forces all the attached effect to compile to enable rendering only once ready vs. lazily compiling effects.\n * @param options Sets of optional options forcing the compilation with different modes\n * @returns A promise that resolves when the compilation completes\n */\n forceCompilationAsync(options) {\n return new Promise((resolve) => {\n this.forceCompilation(() => {\n resolve();\n }, options);\n });\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _isReadyCustomDefines(defines, subMesh, useInstances) { }\n _prepareShadowDefines(subMesh, useInstances, defines, isTransparent) {\n defines.push(\"#define SM_LIGHTTYPE_\" + this._light.getClassName().toUpperCase());\n defines.push(\"#define SM_FLOAT \" + (this._textureType !== 0 ? \"1\" : \"0\"));\n defines.push(\"#define SM_ESM \" + (this.useExponentialShadowMap || this.useBlurExponentialShadowMap ? \"1\" : \"0\"));\n defines.push(\"#define SM_DEPTHTEXTURE \" + (this.usePercentageCloserFiltering || this.useContactHardeningShadow ? \"1\" : \"0\"));\n const mesh = subMesh.getMesh();\n // Normal bias.\n defines.push(\"#define SM_NORMALBIAS \" + (this.normalBias && mesh.isVerticesDataPresent(VertexBuffer.NormalKind) ? \"1\" : \"0\"));\n defines.push(\"#define SM_DIRECTIONINLIGHTDATA \" + (this.getLight().getTypeID() === Light.LIGHTTYPEID_DIRECTIONALLIGHT ? \"1\" : \"0\"));\n // Point light\n defines.push(\"#define SM_USEDISTANCE \" + (this._light.needCube() ? \"1\" : \"0\"));\n // Soft transparent shadows\n defines.push(\"#define SM_SOFTTRANSPARENTSHADOW \" + (this.enableSoftTransparentShadow && isTransparent ? \"1\" : \"0\"));\n this._isReadyCustomDefines(defines, subMesh, useInstances);\n return defines;\n }\n /**\n * Determine whether the shadow generator is ready or not (mainly all effects and related post processes needs to be ready).\n * @param subMesh The submesh we want to render in the shadow map\n * @param useInstances Defines whether will draw in the map using instances\n * @param isTransparent Indicates that isReady is called for a transparent subMesh\n * @returns true if ready otherwise, false\n */\n isReady(subMesh, useInstances, isTransparent) {\n if (!this._shadersLoaded) {\n return false;\n }\n const material = subMesh.getMaterial(), shadowDepthWrapper = material?.shadowDepthWrapper;\n this._opacityTexture = null;\n if (!material) {\n return false;\n }\n const defines = [];\n this._prepareShadowDefines(subMesh, useInstances, defines, isTransparent);\n if (shadowDepthWrapper) {\n if (!shadowDepthWrapper.isReadyForSubMesh(subMesh, defines, this, useInstances, this._scene.getEngine().currentRenderPassId)) {\n return false;\n }\n }\n else {\n const subMeshEffect = subMesh._getDrawWrapper(undefined, true);\n let effect = subMeshEffect.effect;\n let cachedDefines = subMeshEffect.defines;\n const attribs = [VertexBuffer.PositionKind];\n const mesh = subMesh.getMesh();\n // Normal bias.\n if (this.normalBias && mesh.isVerticesDataPresent(VertexBuffer.NormalKind)) {\n attribs.push(VertexBuffer.NormalKind);\n defines.push(\"#define NORMAL\");\n if (mesh.nonUniformScaling) {\n defines.push(\"#define NONUNIFORMSCALING\");\n }\n }\n // Alpha test\n const needAlphaTesting = material.needAlphaTesting();\n if (needAlphaTesting || material.needAlphaBlending()) {\n if (this.useOpacityTextureForTransparentShadow) {\n this._opacityTexture = material.opacityTexture;\n }\n else {\n this._opacityTexture = material.getAlphaTestTexture();\n }\n if (this._opacityTexture) {\n if (!this._opacityTexture.isReady()) {\n return false;\n }\n const alphaCutOff = material.alphaCutOff ?? ShadowGenerator.DEFAULT_ALPHA_CUTOFF;\n defines.push(\"#define ALPHATEXTURE\");\n if (needAlphaTesting) {\n defines.push(`#define ALPHATESTVALUE ${alphaCutOff}${alphaCutOff % 1 === 0 ? \".\" : \"\"}`);\n }\n if (mesh.isVerticesDataPresent(VertexBuffer.UVKind)) {\n attribs.push(VertexBuffer.UVKind);\n defines.push(\"#define UV1\");\n }\n if (mesh.isVerticesDataPresent(VertexBuffer.UV2Kind)) {\n if (this._opacityTexture.coordinatesIndex === 1) {\n attribs.push(VertexBuffer.UV2Kind);\n defines.push(\"#define UV2\");\n }\n }\n }\n }\n // Bones\n const fallbacks = new EffectFallbacks();\n if (mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton) {\n attribs.push(VertexBuffer.MatricesIndicesKind);\n attribs.push(VertexBuffer.MatricesWeightsKind);\n if (mesh.numBoneInfluencers > 4) {\n attribs.push(VertexBuffer.MatricesIndicesExtraKind);\n attribs.push(VertexBuffer.MatricesWeightsExtraKind);\n }\n const skeleton = mesh.skeleton;\n defines.push(\"#define NUM_BONE_INFLUENCERS \" + mesh.numBoneInfluencers);\n if (mesh.numBoneInfluencers > 0) {\n fallbacks.addCPUSkinningFallback(0, mesh);\n }\n if (skeleton.isUsingTextureForMatrices) {\n defines.push(\"#define BONETEXTURE\");\n }\n else {\n defines.push(\"#define BonesPerMesh \" + (skeleton.bones.length + 1));\n }\n }\n else {\n defines.push(\"#define NUM_BONE_INFLUENCERS 0\");\n }\n // Morph targets\n const manager = mesh.morphTargetManager;\n let morphInfluencers = 0;\n if (manager) {\n morphInfluencers = manager.numMaxInfluencers || manager.numInfluencers;\n if (morphInfluencers > 0) {\n defines.push(\"#define MORPHTARGETS\");\n defines.push(\"#define NUM_MORPH_INFLUENCERS \" + morphInfluencers);\n if (manager.isUsingTextureForTargets) {\n defines.push(\"#define MORPHTARGETS_TEXTURE\");\n }\n PrepareAttributesForMorphTargetsInfluencers(attribs, mesh, morphInfluencers);\n }\n }\n // ClipPlanes\n prepareStringDefinesForClipPlanes(material, this._scene, defines);\n // Instances\n if (useInstances) {\n defines.push(\"#define INSTANCES\");\n PushAttributesForInstances(attribs);\n if (subMesh.getRenderingMesh().hasThinInstances) {\n defines.push(\"#define THIN_INSTANCES\");\n }\n }\n if (this.customShaderOptions) {\n if (this.customShaderOptions.defines) {\n for (const define of this.customShaderOptions.defines) {\n if (defines.indexOf(define) === -1) {\n defines.push(define);\n }\n }\n }\n }\n // Baked vertex animations\n const bvaManager = mesh.bakedVertexAnimationManager;\n if (bvaManager && bvaManager.isEnabled) {\n defines.push(\"#define BAKED_VERTEX_ANIMATION_TEXTURE\");\n if (useInstances) {\n attribs.push(\"bakedVertexAnimationSettingsInstanced\");\n }\n }\n // Get correct effect\n const join = defines.join(\"\\n\");\n if (cachedDefines !== join) {\n cachedDefines = join;\n let shaderName = \"shadowMap\";\n const uniforms = [\n \"world\",\n \"mBones\",\n \"viewProjection\",\n \"diffuseMatrix\",\n \"lightDataSM\",\n \"depthValuesSM\",\n \"biasAndScaleSM\",\n \"morphTargetInfluences\",\n \"morphTargetCount\",\n \"boneTextureWidth\",\n \"softTransparentShadowSM\",\n \"morphTargetTextureInfo\",\n \"morphTargetTextureIndices\",\n \"bakedVertexAnimationSettings\",\n \"bakedVertexAnimationTextureSizeInverted\",\n \"bakedVertexAnimationTime\",\n \"bakedVertexAnimationTexture\",\n ];\n const samplers = [\"diffuseSampler\", \"boneSampler\", \"morphTargets\", \"bakedVertexAnimationTexture\"];\n const uniformBuffers = [\"Scene\", \"Mesh\"];\n addClipPlaneUniforms(uniforms);\n // Custom shader?\n if (this.customShaderOptions) {\n shaderName = this.customShaderOptions.shaderName;\n if (this.customShaderOptions.attributes) {\n for (const attrib of this.customShaderOptions.attributes) {\n if (attribs.indexOf(attrib) === -1) {\n attribs.push(attrib);\n }\n }\n }\n if (this.customShaderOptions.uniforms) {\n for (const uniform of this.customShaderOptions.uniforms) {\n if (uniforms.indexOf(uniform) === -1) {\n uniforms.push(uniform);\n }\n }\n }\n if (this.customShaderOptions.samplers) {\n for (const sampler of this.customShaderOptions.samplers) {\n if (samplers.indexOf(sampler) === -1) {\n samplers.push(sampler);\n }\n }\n }\n }\n const engine = this._scene.getEngine();\n effect = engine.createEffect(shaderName, {\n attributes: attribs,\n uniformsNames: uniforms,\n uniformBuffersNames: uniformBuffers,\n samplers: samplers,\n defines: join,\n fallbacks: fallbacks,\n onCompiled: null,\n onError: null,\n indexParameters: { maxSimultaneousMorphTargets: morphInfluencers },\n shaderLanguage: this._shaderLanguage,\n }, engine);\n subMeshEffect.setEffect(effect, cachedDefines);\n }\n if (!effect.isReady()) {\n return false;\n }\n }\n if (this.useBlurExponentialShadowMap || this.useBlurCloseExponentialShadowMap) {\n if (!this._blurPostProcesses || !this._blurPostProcesses.length) {\n this._initializeBlurRTTAndPostProcesses();\n }\n }\n if (this._kernelBlurXPostprocess && !this._kernelBlurXPostprocess.isReady()) {\n return false;\n }\n if (this._kernelBlurYPostprocess && !this._kernelBlurYPostprocess.isReady()) {\n return false;\n }\n if (this._boxBlurPostprocess && !this._boxBlurPostprocess.isReady()) {\n return false;\n }\n return true;\n }\n /**\n * Prepare all the defines in a material relying on a shadow map at the specified light index.\n * @param defines Defines of the material we want to update\n * @param lightIndex Index of the light in the enabled light list of the material\n */\n prepareDefines(defines, lightIndex) {\n const scene = this._scene;\n const light = this._light;\n if (!scene.shadowsEnabled || !light.shadowEnabled) {\n return;\n }\n defines[\"SHADOW\" + lightIndex] = true;\n if (this.useContactHardeningShadow) {\n defines[\"SHADOWPCSS\" + lightIndex] = true;\n if (this._filteringQuality === ShadowGenerator.QUALITY_LOW) {\n defines[\"SHADOWLOWQUALITY\" + lightIndex] = true;\n }\n else if (this._filteringQuality === ShadowGenerator.QUALITY_MEDIUM) {\n defines[\"SHADOWMEDIUMQUALITY\" + lightIndex] = true;\n }\n // else default to high.\n }\n else if (this.usePercentageCloserFiltering) {\n defines[\"SHADOWPCF\" + lightIndex] = true;\n if (this._filteringQuality === ShadowGenerator.QUALITY_LOW) {\n defines[\"SHADOWLOWQUALITY\" + lightIndex] = true;\n }\n else if (this._filteringQuality === ShadowGenerator.QUALITY_MEDIUM) {\n defines[\"SHADOWMEDIUMQUALITY\" + lightIndex] = true;\n }\n // else default to high.\n }\n else if (this.usePoissonSampling) {\n defines[\"SHADOWPOISSON\" + lightIndex] = true;\n }\n else if (this.useExponentialShadowMap || this.useBlurExponentialShadowMap) {\n defines[\"SHADOWESM\" + lightIndex] = true;\n }\n else if (this.useCloseExponentialShadowMap || this.useBlurCloseExponentialShadowMap) {\n defines[\"SHADOWCLOSEESM\" + lightIndex] = true;\n }\n if (light.needCube()) {\n defines[\"SHADOWCUBE\" + lightIndex] = true;\n }\n }\n /**\n * Binds the shadow related information inside of an effect (information like near, far, darkness...\n * defined in the generator but impacting the effect).\n * @param lightIndex Index of the light in the enabled light list of the material owning the effect\n * @param effect The effect we are binding the information for\n */\n bindShadowLight(lightIndex, effect) {\n const light = this._light;\n const scene = this._scene;\n if (!scene.shadowsEnabled || !light.shadowEnabled) {\n return;\n }\n const camera = this._getCamera();\n if (!camera) {\n return;\n }\n const shadowMap = this.getShadowMap();\n if (!shadowMap) {\n return;\n }\n if (!light.needCube()) {\n effect.setMatrix(\"lightMatrix\" + lightIndex, this.getTransformMatrix());\n }\n // Only PCF uses depth stencil texture.\n const shadowMapForRendering = this.getShadowMapForRendering();\n if (this._filter === ShadowGenerator.FILTER_PCF) {\n effect.setDepthStencilTexture(\"shadowTexture\" + lightIndex, shadowMapForRendering);\n light._uniformBuffer.updateFloat4(\"shadowsInfo\", this.getDarkness(), shadowMap.getSize().width, 1 / shadowMap.getSize().width, this.frustumEdgeFalloff, lightIndex);\n }\n else if (this._filter === ShadowGenerator.FILTER_PCSS) {\n effect.setDepthStencilTexture(\"shadowTexture\" + lightIndex, shadowMapForRendering);\n effect.setTexture(\"depthTexture\" + lightIndex, shadowMapForRendering);\n light._uniformBuffer.updateFloat4(\"shadowsInfo\", this.getDarkness(), 1 / shadowMap.getSize().width, this._contactHardeningLightSizeUVRatio * shadowMap.getSize().width, this.frustumEdgeFalloff, lightIndex);\n }\n else {\n effect.setTexture(\"shadowTexture\" + lightIndex, shadowMapForRendering);\n light._uniformBuffer.updateFloat4(\"shadowsInfo\", this.getDarkness(), this.blurScale / shadowMap.getSize().width, this.depthScale, this.frustumEdgeFalloff, lightIndex);\n }\n light._uniformBuffer.updateFloat2(\"depthValues\", this.getLight().getDepthMinZ(camera), this.getLight().getDepthMinZ(camera) + this.getLight().getDepthMaxZ(camera), lightIndex);\n }\n /**\n * Gets the view matrix used to render the shadow map.\n */\n get viewMatrix() {\n return this._viewMatrix;\n }\n /**\n * Gets the projection matrix used to render the shadow map.\n */\n get projectionMatrix() {\n return this._projectionMatrix;\n }\n /**\n * Gets the transformation matrix used to project the meshes into the map from the light point of view.\n * (eq to shadow projection matrix * light transform matrix)\n * @returns The transform matrix used to create the shadow map\n */\n getTransformMatrix() {\n const scene = this._scene;\n if (this._currentRenderId === scene.getRenderId() && this._currentFaceIndexCache === this._currentFaceIndex) {\n return this._transformMatrix;\n }\n this._currentRenderId = scene.getRenderId();\n this._currentFaceIndexCache = this._currentFaceIndex;\n let lightPosition = this._light.position;\n if (this._light.computeTransformedInformation()) {\n lightPosition = this._light.transformedPosition;\n }\n Vector3.NormalizeToRef(this._light.getShadowDirection(this._currentFaceIndex), this._lightDirection);\n if (Math.abs(Vector3.Dot(this._lightDirection, Vector3.Up())) === 1.0) {\n this._lightDirection.z = 0.0000000000001; // Required to avoid perfectly perpendicular light\n }\n if (this._light.needProjectionMatrixCompute() ||\n !this._cachedPosition ||\n !this._cachedDirection ||\n !lightPosition.equals(this._cachedPosition) ||\n !this._lightDirection.equals(this._cachedDirection)) {\n this._cachedPosition.copyFrom(lightPosition);\n this._cachedDirection.copyFrom(this._lightDirection);\n Matrix.LookAtLHToRef(lightPosition, lightPosition.add(this._lightDirection), Vector3.Up(), this._viewMatrix);\n const shadowMap = this.getShadowMap();\n if (shadowMap) {\n const renderList = shadowMap.renderList;\n if (renderList) {\n this._light.setShadowProjectionMatrix(this._projectionMatrix, this._viewMatrix, renderList);\n }\n }\n this._viewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix);\n }\n return this._transformMatrix;\n }\n /**\n * Recreates the shadow map dependencies like RTT and post processes. This can be used during the switch between\n * Cube and 2D textures for instance.\n */\n recreateShadowMap() {\n const shadowMap = this._shadowMap;\n if (!shadowMap) {\n return;\n }\n // Track render list.\n const renderList = shadowMap.renderList;\n // Clean up existing data.\n this._disposeRTTandPostProcesses();\n // Reinitializes.\n this._initializeGenerator();\n // Reaffect the filter to ensure a correct fallback if necessary.\n this.filter = this._filter;\n // Reaffect the filter.\n this._applyFilterValues();\n // Reaffect Render List.\n if (renderList) {\n // Note: don't do this._shadowMap!.renderList = renderList;\n // The renderList hooked array is accessing the old RenderTargetTexture (see RenderTargetTexture._hookArray), which is disposed at this point (by the call to _disposeRTTandPostProcesses)\n if (!this._shadowMap.renderList) {\n this._shadowMap.renderList = [];\n }\n for (const mesh of renderList) {\n this._shadowMap.renderList.push(mesh);\n }\n }\n else {\n this._shadowMap.renderList = null;\n }\n }\n _disposeBlurPostProcesses() {\n if (this._shadowMap2) {\n this._shadowMap2.dispose();\n this._shadowMap2 = null;\n }\n if (this._boxBlurPostprocess) {\n this._boxBlurPostprocess.dispose();\n this._boxBlurPostprocess = null;\n }\n if (this._kernelBlurXPostprocess) {\n this._kernelBlurXPostprocess.dispose();\n this._kernelBlurXPostprocess = null;\n }\n if (this._kernelBlurYPostprocess) {\n this._kernelBlurYPostprocess.dispose();\n this._kernelBlurYPostprocess = null;\n }\n this._blurPostProcesses = [];\n }\n _disposeRTTandPostProcesses() {\n if (this._shadowMap) {\n this._shadowMap.dispose();\n this._shadowMap = null;\n }\n this._disposeBlurPostProcesses();\n }\n _disposeSceneUBOs() {\n if (this._sceneUBOs) {\n for (const ubo of this._sceneUBOs) {\n ubo.dispose();\n }\n this._sceneUBOs = [];\n }\n }\n /**\n * Disposes the ShadowGenerator.\n * Returns nothing.\n */\n dispose() {\n this._disposeRTTandPostProcesses();\n this._disposeSceneUBOs();\n if (this._light) {\n if (this._light._shadowGenerators) {\n const iterator = this._light._shadowGenerators.entries();\n for (let entry = iterator.next(); entry.done !== true; entry = iterator.next()) {\n const [camera, shadowGenerator] = entry.value;\n if (shadowGenerator === this) {\n this._light._shadowGenerators.delete(camera);\n }\n }\n if (this._light._shadowGenerators.size === 0) {\n this._light._shadowGenerators = null;\n }\n }\n this._light._markMeshesAsLightDirty();\n }\n this.onBeforeShadowMapRenderMeshObservable.clear();\n this.onBeforeShadowMapRenderObservable.clear();\n this.onAfterShadowMapRenderMeshObservable.clear();\n this.onAfterShadowMapRenderObservable.clear();\n }\n /**\n * Serializes the shadow generator setup to a json object.\n * @returns The serialized JSON object\n */\n serialize() {\n const serializationObject = {};\n const shadowMap = this.getShadowMap();\n if (!shadowMap) {\n return serializationObject;\n }\n serializationObject.className = this.getClassName();\n serializationObject.lightId = this._light.id;\n serializationObject.cameraId = this._camera?.id;\n serializationObject.id = this.id;\n serializationObject.mapSize = shadowMap.getRenderSize();\n serializationObject.forceBackFacesOnly = this.forceBackFacesOnly;\n serializationObject.darkness = this.getDarkness();\n serializationObject.transparencyShadow = this._transparencyShadow;\n serializationObject.frustumEdgeFalloff = this.frustumEdgeFalloff;\n serializationObject.bias = this.bias;\n serializationObject.normalBias = this.normalBias;\n serializationObject.usePercentageCloserFiltering = this.usePercentageCloserFiltering;\n serializationObject.useContactHardeningShadow = this.useContactHardeningShadow;\n serializationObject.contactHardeningLightSizeUVRatio = this.contactHardeningLightSizeUVRatio;\n serializationObject.filteringQuality = this.filteringQuality;\n serializationObject.useExponentialShadowMap = this.useExponentialShadowMap;\n serializationObject.useBlurExponentialShadowMap = this.useBlurExponentialShadowMap;\n serializationObject.useCloseExponentialShadowMap = this.useBlurExponentialShadowMap;\n serializationObject.useBlurCloseExponentialShadowMap = this.useBlurExponentialShadowMap;\n serializationObject.usePoissonSampling = this.usePoissonSampling;\n serializationObject.depthScale = this.depthScale;\n serializationObject.blurBoxOffset = this.blurBoxOffset;\n serializationObject.blurKernel = this.blurKernel;\n serializationObject.blurScale = this.blurScale;\n serializationObject.useKernelBlur = this.useKernelBlur;\n serializationObject.renderList = [];\n if (shadowMap.renderList) {\n for (let meshIndex = 0; meshIndex < shadowMap.renderList.length; meshIndex++) {\n const mesh = shadowMap.renderList[meshIndex];\n serializationObject.renderList.push(mesh.id);\n }\n }\n return serializationObject;\n }\n /**\n * Parses a serialized ShadowGenerator and returns a new ShadowGenerator.\n * @param parsedShadowGenerator The JSON object to parse\n * @param scene The scene to create the shadow map for\n * @param constr A function that builds a shadow generator or undefined to create an instance of the default shadow generator\n * @returns The parsed shadow generator\n */\n static Parse(parsedShadowGenerator, scene, constr) {\n const light = scene.getLightById(parsedShadowGenerator.lightId);\n const camera = parsedShadowGenerator.cameraId !== undefined ? scene.getCameraById(parsedShadowGenerator.cameraId) : null;\n const shadowGenerator = constr ? constr(parsedShadowGenerator.mapSize, light, camera) : new ShadowGenerator(parsedShadowGenerator.mapSize, light, undefined, camera);\n const shadowMap = shadowGenerator.getShadowMap();\n for (let meshIndex = 0; meshIndex < parsedShadowGenerator.renderList.length; meshIndex++) {\n const meshes = scene.getMeshesById(parsedShadowGenerator.renderList[meshIndex]);\n meshes.forEach(function (mesh) {\n if (!shadowMap) {\n return;\n }\n if (!shadowMap.renderList) {\n shadowMap.renderList = [];\n }\n shadowMap.renderList.push(mesh);\n });\n }\n if (parsedShadowGenerator.id !== undefined) {\n shadowGenerator.id = parsedShadowGenerator.id;\n }\n shadowGenerator.forceBackFacesOnly = !!parsedShadowGenerator.forceBackFacesOnly;\n if (parsedShadowGenerator.darkness !== undefined) {\n shadowGenerator.setDarkness(parsedShadowGenerator.darkness);\n }\n if (parsedShadowGenerator.transparencyShadow) {\n shadowGenerator.setTransparencyShadow(true);\n }\n if (parsedShadowGenerator.frustumEdgeFalloff !== undefined) {\n shadowGenerator.frustumEdgeFalloff = parsedShadowGenerator.frustumEdgeFalloff;\n }\n if (parsedShadowGenerator.bias !== undefined) {\n shadowGenerator.bias = parsedShadowGenerator.bias;\n }\n if (parsedShadowGenerator.normalBias !== undefined) {\n shadowGenerator.normalBias = parsedShadowGenerator.normalBias;\n }\n if (parsedShadowGenerator.usePercentageCloserFiltering) {\n shadowGenerator.usePercentageCloserFiltering = true;\n }\n else if (parsedShadowGenerator.useContactHardeningShadow) {\n shadowGenerator.useContactHardeningShadow = true;\n }\n else if (parsedShadowGenerator.usePoissonSampling) {\n shadowGenerator.usePoissonSampling = true;\n }\n else if (parsedShadowGenerator.useExponentialShadowMap) {\n shadowGenerator.useExponentialShadowMap = true;\n }\n else if (parsedShadowGenerator.useBlurExponentialShadowMap) {\n shadowGenerator.useBlurExponentialShadowMap = true;\n }\n else if (parsedShadowGenerator.useCloseExponentialShadowMap) {\n shadowGenerator.useCloseExponentialShadowMap = true;\n }\n else if (parsedShadowGenerator.useBlurCloseExponentialShadowMap) {\n shadowGenerator.useBlurCloseExponentialShadowMap = true;\n }\n // Backward compat\n else if (parsedShadowGenerator.useVarianceShadowMap) {\n shadowGenerator.useExponentialShadowMap = true;\n }\n else if (parsedShadowGenerator.useBlurVarianceShadowMap) {\n shadowGenerator.useBlurExponentialShadowMap = true;\n }\n if (parsedShadowGenerator.contactHardeningLightSizeUVRatio !== undefined) {\n shadowGenerator.contactHardeningLightSizeUVRatio = parsedShadowGenerator.contactHardeningLightSizeUVRatio;\n }\n if (parsedShadowGenerator.filteringQuality !== undefined) {\n shadowGenerator.filteringQuality = parsedShadowGenerator.filteringQuality;\n }\n if (parsedShadowGenerator.depthScale) {\n shadowGenerator.depthScale = parsedShadowGenerator.depthScale;\n }\n if (parsedShadowGenerator.blurScale) {\n shadowGenerator.blurScale = parsedShadowGenerator.blurScale;\n }\n if (parsedShadowGenerator.blurBoxOffset) {\n shadowGenerator.blurBoxOffset = parsedShadowGenerator.blurBoxOffset;\n }\n if (parsedShadowGenerator.useKernelBlur) {\n shadowGenerator.useKernelBlur = parsedShadowGenerator.useKernelBlur;\n }\n if (parsedShadowGenerator.blurKernel) {\n shadowGenerator.blurKernel = parsedShadowGenerator.blurKernel;\n }\n return shadowGenerator;\n }\n}\n/**\n * Name of the shadow generator class\n */\nShadowGenerator.CLASSNAME = \"ShadowGenerator\";\n/**\n * Force all the shadow generators to compile to glsl even on WebGPU engines.\n * False by default. This is mostly meant for backward compatibility.\n */\nShadowGenerator.ForceGLSL = false;\n/**\n * Shadow generator mode None: no filtering applied.\n */\nShadowGenerator.FILTER_NONE = 0;\n/**\n * Shadow generator mode ESM: Exponential Shadow Mapping.\n * (http://developer.download.nvidia.com/presentations/2008/GDC/GDC08_SoftShadowMapping.pdf)\n */\nShadowGenerator.FILTER_EXPONENTIALSHADOWMAP = 1;\n/**\n * Shadow generator mode Poisson Sampling: Percentage Closer Filtering.\n * (Multiple Tap around evenly distributed around the pixel are used to evaluate the shadow strength)\n */\nShadowGenerator.FILTER_POISSONSAMPLING = 2;\n/**\n * Shadow generator mode ESM: Blurred Exponential Shadow Mapping.\n * (http://developer.download.nvidia.com/presentations/2008/GDC/GDC08_SoftShadowMapping.pdf)\n */\nShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP = 3;\n/**\n * Shadow generator mode ESM: Exponential Shadow Mapping using the inverse of the exponential preventing\n * edge artifacts on steep falloff.\n * (http://developer.download.nvidia.com/presentations/2008/GDC/GDC08_SoftShadowMapping.pdf)\n */\nShadowGenerator.FILTER_CLOSEEXPONENTIALSHADOWMAP = 4;\n/**\n * Shadow generator mode ESM: Blurred Exponential Shadow Mapping using the inverse of the exponential preventing\n * edge artifacts on steep falloff.\n * (http://developer.download.nvidia.com/presentations/2008/GDC/GDC08_SoftShadowMapping.pdf)\n */\nShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP = 5;\n/**\n * Shadow generator mode PCF: Percentage Closer Filtering\n * benefits from Webgl 2 shadow samplers. Fallback to Poisson Sampling in Webgl 1\n * (https://developer.nvidia.com/gpugems/GPUGems/gpugems_ch11.html)\n */\nShadowGenerator.FILTER_PCF = 6;\n/**\n * Shadow generator mode PCSS: Percentage Closering Soft Shadow.\n * benefits from Webgl 2 shadow samplers. Fallback to Poisson Sampling in Webgl 1\n * Contact Hardening\n */\nShadowGenerator.FILTER_PCSS = 7;\n/**\n * Reserved for PCF and PCSS\n * Highest Quality.\n *\n * Execute PCF on a 5*5 kernel improving a lot the shadow aliasing artifacts.\n *\n * Execute PCSS with 32 taps blocker search and 64 taps PCF.\n */\nShadowGenerator.QUALITY_HIGH = 0;\n/**\n * Reserved for PCF and PCSS\n * Good tradeoff for quality/perf cross devices\n *\n * Execute PCF on a 3*3 kernel.\n *\n * Execute PCSS with 16 taps blocker search and 32 taps PCF.\n */\nShadowGenerator.QUALITY_MEDIUM = 1;\n/**\n * Reserved for PCF and PCSS\n * The lowest quality but the fastest.\n *\n * Execute PCF on a 1*1 kernel.\n *\n * Execute PCSS with 16 taps blocker search and 16 taps PCF.\n */\nShadowGenerator.QUALITY_LOW = 2;\n/**\n * Defines the default alpha cutoff value used for transparent alpha tested materials.\n */\nShadowGenerator.DEFAULT_ALPHA_CUTOFF = 0.5;\n/**\n * @internal\n */\nShadowGenerator._SceneComponentInitialization = (_) => {\n throw _WarnImport(\"ShadowGeneratorSceneComponent\");\n};\n"],"mappings":";AAAA,SAASA,MAAM,EAAEC,OAAO,EAAEC,OAAO,QAAQ,4BAA4B;AACrE,SAASC,MAAM,QAAQ,2BAA2B;AAClD,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,OAAO,QAAQ,qCAAqC;AAC7D,SAASC,mBAAmB,QAAQ,iDAAiD;AACrF,SAASC,WAAW,QAAQ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AACwB,+BAA+B,GAAG,CAAC;AACnD;AACA;AACA;AACA;AACA;AACAxB,eAAe,CAACyC,gCAAgC,GAAG,CAAC;AACpD;AACA;AACA;AACA;AACA;AACAzC,eAAe,CAAC0B,oCAAoC,GAAG,CAAC;AACxD;AACA;AACA;AACA;AACA;AACA1B,eAAe,CAAC4B,UAAU,GAAG,CAAC;AAC9B;AACA;AACA;AACA;AACA;AACA5B,eAAe,CAAC6B,WAAW,GAAG,CAAC;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA7B,eAAe,CAACiG,YAAY,GAAG,CAAC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAjG,eAAe,CAACgY,cAAc,GAAG,CAAC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAhY,eAAe,CAAC+X,WAAW,GAAG,CAAC;AAC/B;AACA;AACA;AACA/X,eAAe,CAAC0V,oBAAoB,GAAG,GAAG;AAC1C;AACA;AACA;AACA1V,eAAe,CAACiI,6BAA6B,GAAIuT,CAAC,IAAK;EACnD,MAAMnc,WAAW,CAAC,+BAA+B,CAAC;AACtD,CAAC","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|