08336ef96fbe8d3da0573f756312393c7a0b92b54e08a676f97c8eac760a8121.json 39 KB

1
  1. {"ast":null,"code":"import _asyncToGenerator from \"F:/workspace/202226701027/huinongbao-app/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport { Matrix, Vector4 } from \"../../Maths/math.vector.js\";\nimport { PostProcess } from \"../../PostProcesses/postProcess.js\";\nimport { GeometryBufferRenderer } from \"../../Rendering/geometryBufferRenderer.js\";\nimport { ProceduralTexture } from \"../../Materials/Textures/Procedurals/proceduralTexture.js\";\n/**\n * Build cdf maps for IBL importance sampling during IBL shadow computation.\n * This should not be instanciated directly, as it is part of a scene component\n * @internal\n */\nexport class _IblShadowsVoxelTracingPass {\n /**\n * The opacity of the shadow cast from the voxel grid\n */\n get voxelShadowOpacity() {\n return this._voxelShadowOpacity;\n }\n /**\n * The opacity of the shadow cast from the voxel grid\n */\n set voxelShadowOpacity(value) {\n this._voxelShadowOpacity = value;\n }\n /**\n * The opacity of the screen-space shadow\n */\n get ssShadowOpacity() {\n return this._ssShadowOpacity;\n }\n /**\n * The opacity of the screen-space shadow\n */\n set ssShadowOpacity(value) {\n this._ssShadowOpacity = value;\n }\n /**\n * The number of samples used in the screen space shadow pass.\n */\n get sssSamples() {\n return this._sssSamples;\n }\n /**\n * The number of samples used in the screen space shadow pass.\n */\n set sssSamples(value) {\n this._sssSamples = value;\n }\n /**\n * The stride used in the screen space shadow pass. This controls the distance between samples.\n */\n get sssStride() {\n return this._sssStride;\n }\n /**\n * The stride used in the screen space shadow pass. This controls the distance between samples.\n */\n set sssStride(value) {\n this._sssStride = value;\n }\n /**\n * The maximum distance that the screen-space shadow will be able to occlude.\n */\n get sssMaxDist() {\n return this._sssMaxDist;\n }\n /**\n * The maximum distance that the screen-space shadow will be able to occlude.\n */\n set sssMaxDist(value) {\n this._sssMaxDist = value;\n }\n /**\n * The thickness of the screen-space shadow\n */\n get sssThickness() {\n return this._sssThickness;\n }\n /**\n * The thickness of the screen-space shadow\n */\n set sssThickness(value) {\n this._sssThickness = value;\n }\n /**\n * The bias to apply to the voxel sampling in the direction of the surface normal of the geometry.\n */\n get voxelNormalBias() {\n return this._voxelNormalBias;\n }\n set voxelNormalBias(value) {\n this._voxelNormalBias = value;\n }\n /**\n * The bias to apply to the voxel sampling in the direction of the light.\n */\n get voxelDirectionBias() {\n return this._voxelDirectionBias;\n }\n set voxelDirectionBias(value) {\n this._voxelDirectionBias = value;\n }\n /**\n * The number of directions to sample for the voxel tracing.\n */\n get sampleDirections() {\n return this._sampleDirections;\n }\n /**\n * The number of directions to sample for the voxel tracing.\n */\n set sampleDirections(value) {\n this._sampleDirections = value;\n }\n /**\n * The current rotation of the environment map, in radians.\n */\n get envRotation() {\n return this._envRotation;\n }\n /**\n * The current rotation of the environment map, in radians.\n */\n set envRotation(value) {\n this._envRotation = value;\n }\n /**\n * Returns the output texture of the pass.\n * @returns The output texture.\n */\n getOutputTexture() {\n return this._outputTexture;\n }\n /**\n * Gets the debug pass post process. This will create the resources for the pass\n * if they don't already exist.\n * @returns The post process\n */\n getDebugPassPP() {\n if (!this._debugPassPP) {\n this._createDebugPass();\n }\n return this._debugPassPP;\n }\n /**\n * The name of the debug pass\n */\n get debugPassName() {\n return this._debugPassName;\n }\n /**\n * Set the matrix to use for scaling the world space to voxel space\n * @param matrix The matrix to use for scaling the world space to voxel space\n */\n setWorldScaleMatrix(matrix) {\n this._invWorldScaleMatrix = matrix;\n }\n /**\n * Sets params that control the position and scaling of the debug display on the screen.\n * @param x Screen X offset of the debug display (0-1)\n * @param y Screen Y offset of the debug display (0-1)\n * @param widthScale X scale of the debug display (0-1)\n * @param heightScale Y scale of the debug display (0-1)\n */\n setDebugDisplayParams(x, y, widthScale, heightScale) {\n this._debugSizeParams.set(x, y, widthScale, heightScale);\n }\n /**\n * Creates the debug post process effect for this pass\n */\n _createDebugPass() {\n const isWebGPU = this._engine.isWebGPU;\n if (!this._debugPassPP) {\n const debugOptions = {\n width: this._engine.getRenderWidth(),\n height: this._engine.getRenderHeight(),\n uniforms: [\"sizeParams\"],\n samplers: [\"debugSampler\"],\n engine: this._engine,\n reusable: false,\n shaderLanguage: isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */,\n extraInitializations: (useWebGPU, list) => {\n if (useWebGPU) {\n list.push(import(\"../../ShadersWGSL/iblShadowDebug.fragment.js\"));\n } else {\n list.push(import(\"../../Shaders/iblShadowDebug.fragment.js\"));\n }\n }\n };\n this._debugPassPP = new PostProcess(this.debugPassName, \"iblShadowDebug\", debugOptions);\n this._debugPassPP.autoClear = false;\n this._debugPassPP.onApplyObservable.add(effect => {\n // update the caustic texture with what we just rendered.\n effect.setTexture(\"debugSampler\", this._outputTexture);\n effect.setVector4(\"sizeParams\", this._debugSizeParams);\n });\n }\n }\n /**\n * Instantiates the shadow voxel-tracing pass\n * @param scene Scene to attach to\n * @param iblShadowsRenderPipeline The IBL shadows render pipeline\n * @returns The shadow voxel-tracing pass\n */\n constructor(scene, iblShadowsRenderPipeline) {\n this._voxelShadowOpacity = 1.0;\n this._sssSamples = 16;\n this._sssStride = 8;\n this._sssMaxDist = 0.05;\n this._sssThickness = 0.5;\n this._ssShadowOpacity = 1.0;\n this._cameraInvView = Matrix.Identity();\n this._cameraInvProj = Matrix.Identity();\n this._invWorldScaleMatrix = Matrix.Identity();\n this._frameId = 0;\n this._sampleDirections = 4;\n this._shadowParameters = new Vector4(0.0, 0.0, 0.0, 0.0);\n this._sssParameters = new Vector4(0.0, 0.0, 0.0, 0.0);\n this._opacityParameters = new Vector4(0.0, 0.0, 0.0, 0.0);\n this._voxelBiasParameters = new Vector4(0.0, 0.0, 0.0, 0.0);\n this._voxelNormalBias = 1.4;\n this._voxelDirectionBias = 1.75;\n /**\n * Is the effect enabled\n */\n this.enabled = true;\n /** Enable the debug view for this pass */\n this.debugEnabled = false;\n this._debugPassName = \"Voxel Tracing Debug Pass\";\n /** The default rotation of the environment map will align the shadows with the default lighting orientation */\n this._envRotation = 0.0;\n this._debugVoxelMarchEnabled = false;\n this._debugSizeParams = new Vector4(0.0, 0.0, 0.0, 0.0);\n this._scene = scene;\n this._engine = scene.getEngine();\n this._renderPipeline = iblShadowsRenderPipeline;\n this._createTextures();\n }\n _createTextures() {\n let defines = \"\";\n if (this._scene.useRightHandedSystem) {\n defines += \"#define RIGHT_HANDED\\n\";\n }\n if (this._debugVoxelMarchEnabled) {\n defines += \"#define VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION 1u\\n\";\n }\n const isWebGPU = this._engine.isWebGPU;\n const textureOptions = {\n type: 0,\n format: 5,\n samplingMode: 1,\n generateDepthBuffer: false,\n shaderLanguage: isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */,\n extraInitializationsAsync: function () {\n var _ref = _asyncToGenerator(function* () {\n if (isWebGPU) {\n yield Promise.all([import(\"../../ShadersWGSL/iblShadowVoxelTracing.fragment.js\")]);\n } else {\n yield Promise.all([import(\"../../Shaders/iblShadowVoxelTracing.fragment.js\")]);\n }\n });\n return function extraInitializationsAsync() {\n return _ref.apply(this, arguments);\n };\n }()\n };\n this._outputTexture = new ProceduralTexture(\"voxelTracingPass\", {\n width: this._engine.getRenderWidth(),\n height: this._engine.getRenderHeight()\n }, \"iblShadowVoxelTracing\", this._scene, textureOptions);\n this._outputTexture.refreshRate = -1;\n this._outputTexture.autoClear = false;\n this._outputTexture.defines = defines;\n // Need to set all the textures first so that the effect gets created with the proper uniforms.\n this._setBindings(this._scene.activeCamera);\n let counter = 0;\n this._scene.onBeforeRenderObservable.add(() => {\n counter = 0;\n });\n this._scene.onAfterRenderTargetsRenderObservable.add(() => {\n if (++counter == 2) {\n if (this.enabled && this._outputTexture.isReady()) {\n this._setBindings(this._scene.activeCamera);\n this._outputTexture.render();\n }\n }\n });\n }\n _setBindings(camera) {\n if (this._scene.useRightHandedSystem) {\n this._outputTexture.defines = \"#define RIGHT_HANDED\\n\";\n }\n this._outputTexture.setMatrix(\"viewMtx\", camera.getViewMatrix());\n this._outputTexture.setMatrix(\"projMtx\", camera.getProjectionMatrix());\n camera.getProjectionMatrix().invertToRef(this._cameraInvProj);\n camera.getViewMatrix().invertToRef(this._cameraInvView);\n this._outputTexture.setMatrix(\"invProjMtx\", this._cameraInvProj);\n this._outputTexture.setMatrix(\"invViewMtx\", this._cameraInvView);\n this._outputTexture.setMatrix(\"wsNormalizationMtx\", this._invWorldScaleMatrix);\n this._frameId++;\n let rotation = this._scene.useRightHandedSystem ? -(this._envRotation + 0.5 * Math.PI) : this._envRotation - 0.5 * Math.PI;\n rotation = rotation % (2.0 * Math.PI);\n this._shadowParameters.set(this._sampleDirections, this._frameId, 1.0, rotation);\n this._outputTexture.setVector4(\"shadowParameters\", this._shadowParameters);\n const voxelGrid = this._renderPipeline._getVoxelGridTexture();\n const highestMip = Math.floor(Math.log2(voxelGrid.getSize().width));\n this._voxelBiasParameters.set(this._voxelNormalBias, this._voxelDirectionBias, highestMip, 0.0);\n this._outputTexture.setVector4(\"voxelBiasParameters\", this._voxelBiasParameters);\n // SSS Options.\n this._sssParameters.set(this._sssSamples, this._sssStride, this._sssMaxDist, this._sssThickness);\n this._outputTexture.setVector4(\"sssParameters\", this._sssParameters);\n this._opacityParameters.set(this._voxelShadowOpacity, this._ssShadowOpacity, 0.0, 0.0);\n this._outputTexture.setVector4(\"shadowOpacity\", this._opacityParameters);\n this._outputTexture.setTexture(\"voxelGridSampler\", voxelGrid);\n this._outputTexture.setTexture(\"blueNoiseSampler\", this._renderPipeline._getNoiseTexture());\n this._outputTexture.setTexture(\"icdfySampler\", this._renderPipeline._getIcdfyTexture());\n this._outputTexture.setTexture(\"icdfxSampler\", this._renderPipeline._getIcdfxTexture());\n if (this._debugVoxelMarchEnabled) {\n this._outputTexture.defines += \"#define VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION 1u\\n\";\n }\n const geometryBufferRenderer = this._scene.geometryBufferRenderer;\n if (!geometryBufferRenderer) {\n return;\n }\n const depthIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.SCREENSPACE_DEPTH_TEXTURE_TYPE);\n this._outputTexture.setTexture(\"depthSampler\", geometryBufferRenderer.getGBuffer().textures[depthIndex]);\n const wnormalIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.NORMAL_TEXTURE_TYPE);\n this._outputTexture.setTexture(\"worldNormalSampler\", geometryBufferRenderer.getGBuffer().textures[wnormalIndex]);\n }\n /**\n * Called by render pipeline when canvas resized.\n * @param scaleFactor The factor by which to scale the canvas size.\n */\n resize(scaleFactor = 1.0) {\n const newSize = {\n width: Math.max(1.0, Math.floor(this._engine.getRenderWidth() * scaleFactor)),\n height: Math.max(1.0, Math.floor(this._engine.getRenderHeight() * scaleFactor))\n };\n this._outputTexture.resize(newSize, false);\n }\n /**\n * Checks if the pass is ready\n * @returns true if the pass is ready\n */\n isReady() {\n return this._outputTexture.isReady() && !(this._debugPassPP && !this._debugPassPP.isReady()) && this._renderPipeline._getIcdfyTexture().isReady() && this._renderPipeline._getIcdfxTexture().isReady() && this._renderPipeline._getVoxelGridTexture().isReady();\n }\n /**\n * Disposes the associated resources\n */\n dispose() {\n this._outputTexture.dispose();\n if (this._debugPassPP) {\n this._debugPassPP.dispose();\n }\n }\n}","map":{"version":3,"names":["Matrix","Vector4","PostProcess","GeometryBufferRenderer","ProceduralTexture","_IblShadowsVoxelTracingPass","voxelShadowOpacity","_voxelShadowOpacity","value","ssShadowOpacity","_ssShadowOpacity","sssSamples","_sssSamples","sssStride","_sssStride","sssMaxDist","_sssMaxDist","sssThickness","_sssThickness","voxelNormalBias","_voxelNormalBias","voxelDirectionBias","_voxelDirectionBias","sampleDirections","_sampleDirections","envRotation","_envRotation","getOutputTexture","_outputTexture","getDebugPassPP","_debugPassPP","_createDebugPass","debugPassName","_debugPassName","setWorldScaleMatrix","matrix","_invWorldScaleMatrix","setDebugDisplayParams","x","y","widthScale","heightScale","_debugSizeParams","set","isWebGPU","_engine","debugOptions","width","getRenderWidth","height","getRenderHeight","uniforms","samplers","engine","reusable","shaderLanguage","extraInitializations","useWebGPU","list","push","autoClear","onApplyObservable","add","effect","setTexture","setVector4","constructor","scene","iblShadowsRenderPipeline","_cameraInvView","Identity","_cameraInvProj","_frameId","_shadowParameters","_sssParameters","_opacityParameters","_voxelBiasParameters","enabled","debugEnabled","_debugVoxelMarchEnabled","_scene","getEngine","_renderPipeline","_createTextures","defines","useRightHandedSystem","textureOptions","type","format","samplingMode","generateDepthBuffer","extraInitializationsAsync","_ref","_asyncToGenerator","Promise","all","apply","arguments","refreshRate","_setBindings","activeCamera","counter","onBeforeRenderObservable","onAfterRenderTargetsRenderObservable","isReady","render","camera","setMatrix","getViewMatrix","getProjectionMatrix","invertToRef","rotation","Math","PI","voxelGrid","_getVoxelGridTexture","highestMip","floor","log2","getSize","_getNoiseTexture","_getIcdfyTexture","_getIcdfxTexture","geometryBufferRenderer","depthIndex","getTextureIndex","SCREENSPACE_DEPTH_TEXTURE_TYPE","getGBuffer","textures","wnormalIndex","NORMAL_TEXTURE_TYPE","resize","scaleFactor","newSize","max","dispose"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js"],"sourcesContent":["\nimport { Matrix, Vector4 } from \"../../Maths/math.vector.js\";\nimport { PostProcess } from \"../../PostProcesses/postProcess.js\";\nimport { GeometryBufferRenderer } from \"../../Rendering/geometryBufferRenderer.js\";\nimport { ProceduralTexture } from \"../../Materials/Textures/Procedurals/proceduralTexture.js\";\n/**\n * Build cdf maps for IBL importance sampling during IBL shadow computation.\n * This should not be instanciated directly, as it is part of a scene component\n * @internal\n */\nexport class _IblShadowsVoxelTracingPass {\n /**\n * The opacity of the shadow cast from the voxel grid\n */\n get voxelShadowOpacity() {\n return this._voxelShadowOpacity;\n }\n /**\n * The opacity of the shadow cast from the voxel grid\n */\n set voxelShadowOpacity(value) {\n this._voxelShadowOpacity = value;\n }\n /**\n * The opacity of the screen-space shadow\n */\n get ssShadowOpacity() {\n return this._ssShadowOpacity;\n }\n /**\n * The opacity of the screen-space shadow\n */\n set ssShadowOpacity(value) {\n this._ssShadowOpacity = value;\n }\n /**\n * The number of samples used in the screen space shadow pass.\n */\n get sssSamples() {\n return this._sssSamples;\n }\n /**\n * The number of samples used in the screen space shadow pass.\n */\n set sssSamples(value) {\n this._sssSamples = value;\n }\n /**\n * The stride used in the screen space shadow pass. This controls the distance between samples.\n */\n get sssStride() {\n return this._sssStride;\n }\n /**\n * The stride used in the screen space shadow pass. This controls the distance between samples.\n */\n set sssStride(value) {\n this._sssStride = value;\n }\n /**\n * The maximum distance that the screen-space shadow will be able to occlude.\n */\n get sssMaxDist() {\n return this._sssMaxDist;\n }\n /**\n * The maximum distance that the screen-space shadow will be able to occlude.\n */\n set sssMaxDist(value) {\n this._sssMaxDist = value;\n }\n /**\n * The thickness of the screen-space shadow\n */\n get sssThickness() {\n return this._sssThickness;\n }\n /**\n * The thickness of the screen-space shadow\n */\n set sssThickness(value) {\n this._sssThickness = value;\n }\n /**\n * The bias to apply to the voxel sampling in the direction of the surface normal of the geometry.\n */\n get voxelNormalBias() {\n return this._voxelNormalBias;\n }\n set voxelNormalBias(value) {\n this._voxelNormalBias = value;\n }\n /**\n * The bias to apply to the voxel sampling in the direction of the light.\n */\n get voxelDirectionBias() {\n return this._voxelDirectionBias;\n }\n set voxelDirectionBias(value) {\n this._voxelDirectionBias = value;\n }\n /**\n * The number of directions to sample for the voxel tracing.\n */\n get sampleDirections() {\n return this._sampleDirections;\n }\n /**\n * The number of directions to sample for the voxel tracing.\n */\n set sampleDirections(value) {\n this._sampleDirections = value;\n }\n /**\n * The current rotation of the environment map, in radians.\n */\n get envRotation() {\n return this._envRotation;\n }\n /**\n * The current rotation of the environment map, in radians.\n */\n set envRotation(value) {\n this._envRotation = value;\n }\n /**\n * Returns the output texture of the pass.\n * @returns The output texture.\n */\n getOutputTexture() {\n return this._outputTexture;\n }\n /**\n * Gets the debug pass post process. This will create the resources for the pass\n * if they don't already exist.\n * @returns The post process\n */\n getDebugPassPP() {\n if (!this._debugPassPP) {\n this._createDebugPass();\n }\n return this._debugPassPP;\n }\n /**\n * The name of the debug pass\n */\n get debugPassName() {\n return this._debugPassName;\n }\n /**\n * Set the matrix to use for scaling the world space to voxel space\n * @param matrix The matrix to use for scaling the world space to voxel space\n */\n setWorldScaleMatrix(matrix) {\n this._invWorldScaleMatrix = matrix;\n }\n /**\n * Sets params that control the position and scaling of the debug display on the screen.\n * @param x Screen X offset of the debug display (0-1)\n * @param y Screen Y offset of the debug display (0-1)\n * @param widthScale X scale of the debug display (0-1)\n * @param heightScale Y scale of the debug display (0-1)\n */\n setDebugDisplayParams(x, y, widthScale, heightScale) {\n this._debugSizeParams.set(x, y, widthScale, heightScale);\n }\n /**\n * Creates the debug post process effect for this pass\n */\n _createDebugPass() {\n const isWebGPU = this._engine.isWebGPU;\n if (!this._debugPassPP) {\n const debugOptions = {\n width: this._engine.getRenderWidth(),\n height: this._engine.getRenderHeight(),\n uniforms: [\"sizeParams\"],\n samplers: [\"debugSampler\"],\n engine: this._engine,\n reusable: false,\n shaderLanguage: isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */,\n extraInitializations: (useWebGPU, list) => {\n if (useWebGPU) {\n list.push(import(\"../../ShadersWGSL/iblShadowDebug.fragment.js\"));\n }\n else {\n list.push(import(\"../../Shaders/iblShadowDebug.fragment.js\"));\n }\n },\n };\n this._debugPassPP = new PostProcess(this.debugPassName, \"iblShadowDebug\", debugOptions);\n this._debugPassPP.autoClear = false;\n this._debugPassPP.onApplyObservable.add((effect) => {\n // update the caustic texture with what we just rendered.\n effect.setTexture(\"debugSampler\", this._outputTexture);\n effect.setVector4(\"sizeParams\", this._debugSizeParams);\n });\n }\n }\n /**\n * Instantiates the shadow voxel-tracing pass\n * @param scene Scene to attach to\n * @param iblShadowsRenderPipeline The IBL shadows render pipeline\n * @returns The shadow voxel-tracing pass\n */\n constructor(scene, iblShadowsRenderPipeline) {\n this._voxelShadowOpacity = 1.0;\n this._sssSamples = 16;\n this._sssStride = 8;\n this._sssMaxDist = 0.05;\n this._sssThickness = 0.5;\n this._ssShadowOpacity = 1.0;\n this._cameraInvView = Matrix.Identity();\n this._cameraInvProj = Matrix.Identity();\n this._invWorldScaleMatrix = Matrix.Identity();\n this._frameId = 0;\n this._sampleDirections = 4;\n this._shadowParameters = new Vector4(0.0, 0.0, 0.0, 0.0);\n this._sssParameters = new Vector4(0.0, 0.0, 0.0, 0.0);\n this._opacityParameters = new Vector4(0.0, 0.0, 0.0, 0.0);\n this._voxelBiasParameters = new Vector4(0.0, 0.0, 0.0, 0.0);\n this._voxelNormalBias = 1.4;\n this._voxelDirectionBias = 1.75;\n /**\n * Is the effect enabled\n */\n this.enabled = true;\n /** Enable the debug view for this pass */\n this.debugEnabled = false;\n this._debugPassName = \"Voxel Tracing Debug Pass\";\n /** The default rotation of the environment map will align the shadows with the default lighting orientation */\n this._envRotation = 0.0;\n this._debugVoxelMarchEnabled = false;\n this._debugSizeParams = new Vector4(0.0, 0.0, 0.0, 0.0);\n this._scene = scene;\n this._engine = scene.getEngine();\n this._renderPipeline = iblShadowsRenderPipeline;\n this._createTextures();\n }\n _createTextures() {\n let defines = \"\";\n if (this._scene.useRightHandedSystem) {\n defines += \"#define RIGHT_HANDED\\n\";\n }\n if (this._debugVoxelMarchEnabled) {\n defines += \"#define VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION 1u\\n\";\n }\n const isWebGPU = this._engine.isWebGPU;\n const textureOptions = {\n type: 0,\n format: 5,\n samplingMode: 1,\n generateDepthBuffer: false,\n shaderLanguage: isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */,\n extraInitializationsAsync: async () => {\n if (isWebGPU) {\n await Promise.all([import(\"../../ShadersWGSL/iblShadowVoxelTracing.fragment.js\")]);\n }\n else {\n await Promise.all([import(\"../../Shaders/iblShadowVoxelTracing.fragment.js\")]);\n }\n },\n };\n this._outputTexture = new ProceduralTexture(\"voxelTracingPass\", {\n width: this._engine.getRenderWidth(),\n height: this._engine.getRenderHeight(),\n }, \"iblShadowVoxelTracing\", this._scene, textureOptions);\n this._outputTexture.refreshRate = -1;\n this._outputTexture.autoClear = false;\n this._outputTexture.defines = defines;\n // Need to set all the textures first so that the effect gets created with the proper uniforms.\n this._setBindings(this._scene.activeCamera);\n let counter = 0;\n this._scene.onBeforeRenderObservable.add(() => {\n counter = 0;\n });\n this._scene.onAfterRenderTargetsRenderObservable.add(() => {\n if (++counter == 2) {\n if (this.enabled && this._outputTexture.isReady()) {\n this._setBindings(this._scene.activeCamera);\n this._outputTexture.render();\n }\n }\n });\n }\n _setBindings(camera) {\n if (this._scene.useRightHandedSystem) {\n this._outputTexture.defines = \"#define RIGHT_HANDED\\n\";\n }\n this._outputTexture.setMatrix(\"viewMtx\", camera.getViewMatrix());\n this._outputTexture.setMatrix(\"projMtx\", camera.getProjectionMatrix());\n camera.getProjectionMatrix().invertToRef(this._cameraInvProj);\n camera.getViewMatrix().invertToRef(this._cameraInvView);\n this._outputTexture.setMatrix(\"invProjMtx\", this._cameraInvProj);\n this._outputTexture.setMatrix(\"invViewMtx\", this._cameraInvView);\n this._outputTexture.setMatrix(\"wsNormalizationMtx\", this._invWorldScaleMatrix);\n this._frameId++;\n let rotation = this._scene.useRightHandedSystem ? -(this._envRotation + 0.5 * Math.PI) : this._envRotation - 0.5 * Math.PI;\n rotation = rotation % (2.0 * Math.PI);\n this._shadowParameters.set(this._sampleDirections, this._frameId, 1.0, rotation);\n this._outputTexture.setVector4(\"shadowParameters\", this._shadowParameters);\n const voxelGrid = this._renderPipeline._getVoxelGridTexture();\n const highestMip = Math.floor(Math.log2(voxelGrid.getSize().width));\n this._voxelBiasParameters.set(this._voxelNormalBias, this._voxelDirectionBias, highestMip, 0.0);\n this._outputTexture.setVector4(\"voxelBiasParameters\", this._voxelBiasParameters);\n // SSS Options.\n this._sssParameters.set(this._sssSamples, this._sssStride, this._sssMaxDist, this._sssThickness);\n this._outputTexture.setVector4(\"sssParameters\", this._sssParameters);\n this._opacityParameters.set(this._voxelShadowOpacity, this._ssShadowOpacity, 0.0, 0.0);\n this._outputTexture.setVector4(\"shadowOpacity\", this._opacityParameters);\n this._outputTexture.setTexture(\"voxelGridSampler\", voxelGrid);\n this._outputTexture.setTexture(\"blueNoiseSampler\", this._renderPipeline._getNoiseTexture());\n this._outputTexture.setTexture(\"icdfySampler\", this._renderPipeline._getIcdfyTexture());\n this._outputTexture.setTexture(\"icdfxSampler\", this._renderPipeline._getIcdfxTexture());\n if (this._debugVoxelMarchEnabled) {\n this._outputTexture.defines += \"#define VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION 1u\\n\";\n }\n const geometryBufferRenderer = this._scene.geometryBufferRenderer;\n if (!geometryBufferRenderer) {\n return;\n }\n const depthIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.SCREENSPACE_DEPTH_TEXTURE_TYPE);\n this._outputTexture.setTexture(\"depthSampler\", geometryBufferRenderer.getGBuffer().textures[depthIndex]);\n const wnormalIndex = geometryBufferRenderer.getTextureIndex(GeometryBufferRenderer.NORMAL_TEXTURE_TYPE);\n this._outputTexture.setTexture(\"worldNormalSampler\", geometryBufferRenderer.getGBuffer().textures[wnormalIndex]);\n }\n /**\n * Called by render pipeline when canvas resized.\n * @param scaleFactor The factor by which to scale the canvas size.\n */\n resize(scaleFactor = 1.0) {\n const newSize = {\n width: Math.max(1.0, Math.floor(this._engine.getRenderWidth() * scaleFactor)),\n height: Math.max(1.0, Math.floor(this._engine.getRenderHeight() * scaleFactor)),\n };\n this._outputTexture.resize(newSize, false);\n }\n /**\n * Checks if the pass is ready\n * @returns true if the pass is ready\n */\n isReady() {\n return (this._outputTexture.isReady() &&\n !(this._debugPassPP && !this._debugPassPP.isReady()) &&\n this._renderPipeline._getIcdfyTexture().isReady() &&\n this._renderPipeline._getIcdfxTexture().isReady() &&\n this._renderPipeline._getVoxelGridTexture().isReady());\n }\n /**\n * Disposes the associated resources\n */\n dispose() {\n this._outputTexture.dispose();\n if (this._debugPassPP) {\n this._debugPassPP.dispose();\n }\n }\n}\n"],"mappings":";AACA,SAASA,MAAM,EAAEC,OAAO,QAAQ,4BAA4B;AAC5D,SAASC,WAAW,QAAQ,oCAAoC;AAChE,SAASC,sBAAsB,QAAQ,2CAA2C;AAClF,SAASC,iBAAiB,QAAQ,2DAA2D;AAC7F;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,2BAA2B,CAAC;EACrC;AACJ;AACA;EACI,IAAIC,kBAAkBA,CAAA,EAAG;IACrB,OAAO,IAAI,CAACC,mBAAmB;EACnC;EACA;AACJ;AACA;EACI,IAAID,kBAAkBA,CAACE,KAAK,EAAE;IAC1B,IAAI,CAACD,mBAAmB,GAAGC,KAAK;EACpC;EACA;AACJ;AACA;EACI,IAAIC,eAAeA,CAAA,EAAG;IAClB,OAAO,IAAI,CAACC,gBAAgB;EAChC;EACA;AACJ;AACA;EACI,IAAID,eAAeA,CAACD,KAAK,EAAE;IACvB,IAAI,CAACE,gBAAgB,GAAGF,KAAK;EACjC;EACA;AACJ;AACA;EACI,IAAIG,UAAUA,CAAA,EAAG;IACb,OAAO,IAAI,CAACC,WAAW;EAC3B;EACA;AACJ;AACA;EACI,IAAID,UAAUA,CAACH,KAAK,EAAE;IAClB,IAAI,CAACI,WAAW,GAAGJ,KAAK;EAC5B;EACA;AACJ;AACA;EACI,IAAIK,SAASA,CAAA,EAAG;IACZ,OAAO,IAAI,CAACC,UAAU;EAC1B;EACA;AACJ;AACA;EACI,IAAID,SAASA,CAACL,KAAK,EAAE;IACjB,IAAI,CAACM,UAAU,GAAGN,KAAK;EAC3B;EACA;AACJ;AACA;EACI,IAAIO,UAAUA,CAAA,EAAG;IACb,OAAO,IAAI,CAACC,WAAW;EAC3B;EACA;AACJ;AACA;EACI,IAAID,UAAUA,CAACP,KAAK,EAAE;IAClB,IAAI,CAACQ,WAA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