1 |
- {"ast":null,"code":"import _asyncToGenerator from \"F:/workspace/202226701027/huinongbao-app/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport { Tools } from \"../Misc/tools.js\";\nimport { Matrix, Vector3 } from \"../Maths/math.vector.js\";\nimport { Clamp } from \"../Maths/math.scalar.functions.js\";\nimport { EngineStore } from \"../Engines/engineStore.js\";\nimport { VertexBuffer } from \"../Buffers/buffer.js\";\nimport { Ray } from \"../Culling/ray.js\";\nimport { Material } from \"../Materials/material.js\";\nimport { LensFlare } from \"./lensFlare.js\";\nimport { _WarnImport } from \"../Misc/devTools.js\";\nimport { Color3 } from \"../Maths/math.color.js\";\nimport { Observable } from \"../Misc/observable.js\";\n/**\n * This represents a Lens Flare System or the shiny effect created by the light reflection on the camera lenses.\n * It is usually composed of several `lensFlare`.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare\n */\nexport class LensFlareSystem {\n /** Gets the scene */\n get scene() {\n return this._scene;\n }\n /**\n * Gets the shader language used in this system.\n */\n get shaderLanguage() {\n return this._shaderLanguage;\n }\n /**\n * Instantiates a lens flare system.\n * This represents a Lens Flare System or the shiny effect created by the light reflection on the camera lenses.\n * It is usually composed of several `lensFlare`.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare\n * @param name Define the name of the lens flare system in the scene\n * @param emitter Define the source (the emitter) of the lens flares (it can be a camera, a light or a mesh).\n * @param scene Define the scene the lens flare system belongs to\n */\n constructor(\n /**\n * Define the name of the lens flare system\n */\n name, emitter, scene) {\n this.name = name;\n /**\n * List of lens flares used in this system.\n */\n this.lensFlares = [];\n /**\n * Define a limit from the border the lens flare can be visible.\n */\n this.borderLimit = 300;\n /**\n * Define a viewport border we do not want to see the lens flare in.\n */\n this.viewportBorder = 0;\n /**\n * Restricts the rendering of the effect to only the camera rendering this layer mask.\n */\n this.layerMask = 0x0fffffff;\n /** Shader language used by the system */\n this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;\n this._vertexBuffers = {};\n this._isEnabled = true;\n /** @internal */\n this._onShadersLoaded = new Observable(undefined, true);\n this._shadersLoaded = false;\n this._scene = scene || EngineStore.LastCreatedScene;\n LensFlareSystem._SceneComponentInitialization(this._scene);\n this._emitter = emitter;\n this.id = name;\n scene.lensFlareSystems.push(this);\n this.meshesSelectionPredicate = m => scene.activeCamera && m.material && m.isVisible && m.isEnabled() && m.isBlocker && (m.layerMask & scene.activeCamera.layerMask) != 0;\n const engine = scene.getEngine();\n // VBO\n const vertices = [];\n vertices.push(1, 1);\n vertices.push(-1, 1);\n vertices.push(-1, -1);\n vertices.push(1, -1);\n this._vertexBuffers[VertexBuffer.PositionKind] = new VertexBuffer(engine, vertices, VertexBuffer.PositionKind, false, false, 2);\n // Indices\n this._createIndexBuffer();\n this._initShaderSourceAsync();\n }\n _initShaderSourceAsync() {\n var _this = this;\n return _asyncToGenerator(function* () {\n const engine = _this._scene.getEngine();\n if (engine.isWebGPU && !LensFlareSystem.ForceGLSL) {\n _this._shaderLanguage = 1 /* ShaderLanguage.WGSL */;\n yield Promise.all([import(\"../ShadersWGSL/lensFlare.fragment.js\"), import(\"../ShadersWGSL/lensFlare.vertex.js\")]);\n } else {\n yield Promise.all([import(\"../Shaders/lensFlare.fragment.js\"), import(\"../Shaders/lensFlare.vertex.js\")]);\n }\n _this._shadersLoaded = true;\n _this._onShadersLoaded.notifyObservers();\n })();\n }\n _createIndexBuffer() {\n const indices = [];\n indices.push(0);\n indices.push(1);\n indices.push(2);\n indices.push(0);\n indices.push(2);\n indices.push(3);\n this._indexBuffer = this._scene.getEngine().createIndexBuffer(indices);\n }\n /**\n * Define if the lens flare system is enabled.\n */\n get isEnabled() {\n return this._isEnabled;\n }\n set isEnabled(value) {\n this._isEnabled = value;\n }\n /**\n * Get the scene the effects belongs to.\n * @returns the scene holding the lens flare system\n */\n getScene() {\n return this._scene;\n }\n /**\n * Get the emitter of the lens flare system.\n * It defines the source of the lens flares (it can be a camera, a light or a mesh).\n * @returns the emitter of the lens flare system\n */\n getEmitter() {\n return this._emitter;\n }\n /**\n * Set the emitter of the lens flare system.\n * It defines the source of the lens flares (it can be a camera, a light or a mesh).\n * @param newEmitter Define the new emitter of the system\n */\n setEmitter(newEmitter) {\n this._emitter = newEmitter;\n }\n /**\n * Get the lens flare system emitter position.\n * The emitter defines the source of the lens flares (it can be a camera, a light or a mesh).\n * @returns the position\n */\n getEmitterPosition() {\n return this._emitter.getAbsolutePosition ? this._emitter.getAbsolutePosition() : this._emitter.position;\n }\n /**\n * @internal\n */\n computeEffectivePosition(globalViewport) {\n let position = this.getEmitterPosition();\n position = Vector3.Project(position, Matrix.Identity(), this._scene.getTransformMatrix(), globalViewport);\n this._positionX = position.x;\n this._positionY = position.y;\n position = Vector3.TransformCoordinates(this.getEmitterPosition(), this._scene.getViewMatrix());\n if (this.viewportBorder > 0) {\n globalViewport.x -= this.viewportBorder;\n globalViewport.y -= this.viewportBorder;\n globalViewport.width += this.viewportBorder * 2;\n globalViewport.height += this.viewportBorder * 2;\n position.x += this.viewportBorder;\n position.y += this.viewportBorder;\n this._positionX += this.viewportBorder;\n this._positionY += this.viewportBorder;\n }\n const rhs = this._scene.useRightHandedSystem;\n const okZ = position.z > 0 && !rhs || position.z < 0 && rhs;\n if (okZ) {\n if (this._positionX > globalViewport.x && this._positionX < globalViewport.x + globalViewport.width) {\n if (this._positionY > globalViewport.y && this._positionY < globalViewport.y + globalViewport.height) {\n return true;\n }\n }\n return true;\n }\n return false;\n }\n /** @internal */\n _isVisible() {\n if (!this._isEnabled || !this._scene.activeCamera) {\n return false;\n }\n const emitterPosition = this.getEmitterPosition();\n const direction = emitterPosition.subtract(this._scene.activeCamera.globalPosition);\n const distance = direction.length();\n direction.normalize();\n const ray = new Ray(this._scene.activeCamera.globalPosition, direction);\n const pickInfo = this._scene.pickWithRay(ray, this.meshesSelectionPredicate, true);\n return !pickInfo || !pickInfo.hit || pickInfo.distance > distance;\n }\n /**\n * @internal\n */\n render() {\n if (!this._scene.activeCamera || !this._shadersLoaded) {\n return false;\n }\n const engine = this._scene.getEngine();\n const viewport = this._scene.activeCamera.viewport;\n const globalViewport = viewport.toGlobal(engine.getRenderWidth(true), engine.getRenderHeight(true));\n // Position\n if (!this.computeEffectivePosition(globalViewport)) {\n return false;\n }\n // Visibility\n if (!this._isVisible()) {\n return false;\n }\n // Intensity\n let awayX;\n let awayY;\n if (this._positionX < this.borderLimit + globalViewport.x) {\n awayX = this.borderLimit + globalViewport.x - this._positionX;\n } else if (this._positionX > globalViewport.x + globalViewport.width - this.borderLimit) {\n awayX = this._positionX - globalViewport.x - globalViewport.width + this.borderLimit;\n } else {\n awayX = 0;\n }\n if (this._positionY < this.borderLimit + globalViewport.y) {\n awayY = this.borderLimit + globalViewport.y - this._positionY;\n } else if (this._positionY > globalViewport.y + globalViewport.height - this.borderLimit) {\n awayY = this._positionY - globalViewport.y - globalViewport.height + this.borderLimit;\n } else {\n awayY = 0;\n }\n let away = awayX > awayY ? awayX : awayY;\n away -= this.viewportBorder;\n if (away > this.borderLimit) {\n away = this.borderLimit;\n }\n let intensity = 1.0 - Clamp(away / this.borderLimit, 0, 1);\n if (intensity < 0) {\n return false;\n }\n if (intensity > 1.0) {\n intensity = 1.0;\n }\n if (this.viewportBorder > 0) {\n globalViewport.x += this.viewportBorder;\n globalViewport.y += this.viewportBorder;\n globalViewport.width -= this.viewportBorder * 2;\n globalViewport.height -= this.viewportBorder * 2;\n this._positionX -= this.viewportBorder;\n this._positionY -= this.viewportBorder;\n }\n // Position\n const centerX = globalViewport.x + globalViewport.width / 2;\n const centerY = globalViewport.y + globalViewport.height / 2;\n const distX = centerX - this._positionX;\n const distY = centerY - this._positionY;\n // Effects\n engine.setState(false);\n engine.setDepthBuffer(false);\n // Flares\n for (let index = 0; index < this.lensFlares.length; index++) {\n const flare = this.lensFlares[index];\n if (!flare._drawWrapper.effect.isReady() || flare.texture && !flare.texture.isReady()) {\n continue;\n }\n engine.enableEffect(flare._drawWrapper);\n engine.bindBuffers(this._vertexBuffers, this._indexBuffer, flare._drawWrapper.effect);\n engine.setAlphaMode(flare.alphaMode);\n const x = centerX - distX * flare.position;\n const y = centerY - distY * flare.position;\n const cw = flare.size;\n const ch = flare.size * engine.getAspectRatio(this._scene.activeCamera, true);\n const cx = 2 * ((x - globalViewport.x) / globalViewport.width) - 1.0;\n const cy = 1.0 - 2 * ((y - globalViewport.y) / globalViewport.height);\n const viewportMatrix = Matrix.FromValues(cw / 2, 0, 0, 0, 0, ch / 2, 0, 0, 0, 0, 1, 0, cx, cy, 0, 1);\n flare._drawWrapper.effect.setMatrix(\"viewportMatrix\", viewportMatrix);\n // Texture\n flare._drawWrapper.effect.setTexture(\"textureSampler\", flare.texture);\n // Color\n flare._drawWrapper.effect.setFloat4(\"color\", flare.color.r * intensity, flare.color.g * intensity, flare.color.b * intensity, 1.0);\n // Draw order\n engine.drawElementsType(Material.TriangleFillMode, 0, 6);\n }\n engine.setDepthBuffer(true);\n engine.setAlphaMode(0);\n return true;\n }\n /**\n * Rebuilds the lens flare system\n */\n rebuild() {\n this._createIndexBuffer();\n for (const key in this._vertexBuffers) {\n var _this$_vertexBuffers$;\n (_this$_vertexBuffers$ = this._vertexBuffers[key]) === null || _this$_vertexBuffers$ === void 0 || _this$_vertexBuffers$._rebuild();\n }\n }\n /**\n * Dispose and release the lens flare with its associated resources.\n */\n dispose() {\n this._onShadersLoaded.clear();\n const vertexBuffer = this._vertexBuffers[VertexBuffer.PositionKind];\n if (vertexBuffer) {\n vertexBuffer.dispose();\n this._vertexBuffers[VertexBuffer.PositionKind] = null;\n }\n if (this._indexBuffer) {\n this._scene.getEngine()._releaseBuffer(this._indexBuffer);\n this._indexBuffer = null;\n }\n while (this.lensFlares.length) {\n this.lensFlares[0].dispose();\n }\n // Remove from scene\n const index = this._scene.lensFlareSystems.indexOf(this);\n this._scene.lensFlareSystems.splice(index, 1);\n }\n /**\n * Parse a lens flare system from a JSON representation\n * @param parsedLensFlareSystem Define the JSON to parse\n * @param scene Define the scene the parsed system should be instantiated in\n * @param rootUrl Define the rootUrl of the load sequence to easily find a load relative dependencies such as textures\n * @returns the parsed system\n */\n static Parse(parsedLensFlareSystem, scene, rootUrl) {\n const emitter = scene.getLastEntryById(parsedLensFlareSystem.emitterId);\n const name = parsedLensFlareSystem.name || \"lensFlareSystem#\" + parsedLensFlareSystem.emitterId;\n const lensFlareSystem = new LensFlareSystem(name, emitter, scene);\n lensFlareSystem.id = parsedLensFlareSystem.id || name;\n lensFlareSystem.borderLimit = parsedLensFlareSystem.borderLimit;\n for (let index = 0; index < parsedLensFlareSystem.flares.length; index++) {\n const parsedFlare = parsedLensFlareSystem.flares[index];\n LensFlare.AddFlare(parsedFlare.size, parsedFlare.position, Color3.FromArray(parsedFlare.color), parsedFlare.textureName ? rootUrl + parsedFlare.textureName : \"\", lensFlareSystem);\n }\n return lensFlareSystem;\n }\n /**\n * Serialize the current Lens Flare System into a JSON representation.\n * @returns the serialized JSON\n */\n serialize() {\n const serializationObject = {};\n serializationObject.id = this.id;\n serializationObject.name = this.name;\n serializationObject.emitterId = this.getEmitter().id;\n serializationObject.borderLimit = this.borderLimit;\n serializationObject.flares = [];\n for (let index = 0; index < this.lensFlares.length; index++) {\n const flare = this.lensFlares[index];\n serializationObject.flares.push({\n size: flare.size,\n position: flare.position,\n color: flare.color.asArray(),\n textureName: Tools.GetFilename(flare.texture ? flare.texture.name : \"\")\n });\n }\n return serializationObject;\n }\n}\n/**\n * Force all the lens flare systems to compile to glsl even on WebGPU engines.\n * False by default. This is mostly meant for backward compatibility.\n */\nLensFlareSystem.ForceGLSL = false;\n/**\n * @internal\n */\nLensFlareSystem._SceneComponentInitialization = _ => {\n throw _WarnImport(\"LensFlareSystemSceneComponent\");\n};","map":{"version":3,"names":["Tools","Matrix","Vector3","Clamp","EngineStore","VertexBuffer","Ray","Material","LensFlare","_WarnImport","Color3","Observable","LensFlareSystem","scene","_scene","shaderLanguage","_shaderLanguage","constructor","name","emitter","lensFlares","borderLimit","viewportBorder","layerMask","_vertexBuffers","_isEnabled","_onShadersLoaded","undefined","_shadersLoaded","LastCreatedScene","_SceneComponentInitialization","_emitter","id","lensFlareSystems","push","meshesSelectionPredicate","m","activeCamera","material","isVisible","isEnabled","isBlocker","engine","getEngine","vertices","PositionKind","_createIndexBuffer","_initShaderSourceAsync","_this","_asyncToGenerator","isWebGPU","ForceGLSL","Promise","all","notifyObservers","indices","_indexBuffer","createIndexBuffer","value","getScene","getEmitter","setEmitter","newEmitter","getEmitterPosition","getAbsolutePosition","position","computeEffectivePosition","globalViewport","Project","Identity","getTransformMatrix","_positionX","x","_positionY","y","TransformCoordinates","getViewMatrix","width","height","rhs","useRightHandedSystem","okZ","z","_isVisible","emitterPosition","direction","subtract","globalPosition","distance","length","normalize","ray","pickInfo","pickWithRay","hit","render","viewport","toGlobal","getRenderWidth","getRenderHeight","awayX","awayY","away","intensity","centerX","centerY","distX","distY","setState","setDepthBuffer","index","flare","_drawWrapper","effect","isReady","texture","enableEffect","bindBuffers","setAlphaMode","alphaMode","cw","size","ch","getAspectRatio","cx","cy","viewportMatrix","FromValues","setMatrix","setTexture","setFloat4","color","r","g","b","drawElementsType","TriangleFillMode","rebuild","key","_this$_vertexBuffers$","_rebuild","dispose","clear","vertexBuffer","_releaseBuffer","indexOf","splice","Parse","parsedLensFlareSystem","rootUrl","getLastEntryById","emitterId","lensFlareSystem","flares","parsedFlare","AddFlare","FromArray","textureName","serialize","serializationObject","asArray","GetFilename","_"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/LensFlares/lensFlareSystem.js"],"sourcesContent":["import { Tools } from \"../Misc/tools.js\";\nimport { Matrix, Vector3 } from \"../Maths/math.vector.js\";\nimport { Clamp } from \"../Maths/math.scalar.functions.js\";\nimport { EngineStore } from \"../Engines/engineStore.js\";\nimport { VertexBuffer } from \"../Buffers/buffer.js\";\nimport { Ray } from \"../Culling/ray.js\";\nimport { Material } from \"../Materials/material.js\";\nimport { LensFlare } from \"./lensFlare.js\";\n\nimport { _WarnImport } from \"../Misc/devTools.js\";\nimport { Color3 } from \"../Maths/math.color.js\";\nimport { Observable } from \"../Misc/observable.js\";\n/**\n * This represents a Lens Flare System or the shiny effect created by the light reflection on the camera lenses.\n * It is usually composed of several `lensFlare`.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare\n */\nexport class LensFlareSystem {\n /** Gets the scene */\n get scene() {\n return this._scene;\n }\n /**\n * Gets the shader language used in this system.\n */\n get shaderLanguage() {\n return this._shaderLanguage;\n }\n /**\n * Instantiates a lens flare system.\n * This represents a Lens Flare System or the shiny effect created by the light reflection on the camera lenses.\n * It is usually composed of several `lensFlare`.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare\n * @param name Define the name of the lens flare system in the scene\n * @param emitter Define the source (the emitter) of the lens flares (it can be a camera, a light or a mesh).\n * @param scene Define the scene the lens flare system belongs to\n */\n constructor(\n /**\n * Define the name of the lens flare system\n */\n name, emitter, scene) {\n this.name = name;\n /**\n * List of lens flares used in this system.\n */\n this.lensFlares = [];\n /**\n * Define a limit from the border the lens flare can be visible.\n */\n this.borderLimit = 300;\n /**\n * Define a viewport border we do not want to see the lens flare in.\n */\n this.viewportBorder = 0;\n /**\n * Restricts the rendering of the effect to only the camera rendering this layer mask.\n */\n this.layerMask = 0x0fffffff;\n /** Shader language used by the system */\n this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;\n this._vertexBuffers = {};\n this._isEnabled = true;\n /** @internal */\n this._onShadersLoaded = new Observable(undefined, true);\n this._shadersLoaded = false;\n this._scene = scene || EngineStore.LastCreatedScene;\n LensFlareSystem._SceneComponentInitialization(this._scene);\n this._emitter = emitter;\n this.id = name;\n scene.lensFlareSystems.push(this);\n this.meshesSelectionPredicate = (m) => (scene.activeCamera && m.material && m.isVisible && m.isEnabled() && m.isBlocker && (m.layerMask & scene.activeCamera.layerMask) != 0);\n const engine = scene.getEngine();\n // VBO\n const vertices = [];\n vertices.push(1, 1);\n vertices.push(-1, 1);\n vertices.push(-1, -1);\n vertices.push(1, -1);\n this._vertexBuffers[VertexBuffer.PositionKind] = new VertexBuffer(engine, vertices, VertexBuffer.PositionKind, false, false, 2);\n // Indices\n this._createIndexBuffer();\n this._initShaderSourceAsync();\n }\n async _initShaderSourceAsync() {\n const engine = this._scene.getEngine();\n if (engine.isWebGPU && !LensFlareSystem.ForceGLSL) {\n this._shaderLanguage = 1 /* ShaderLanguage.WGSL */;\n await Promise.all([import(\"../ShadersWGSL/lensFlare.fragment.js\"), import(\"../ShadersWGSL/lensFlare.vertex.js\")]);\n }\n else {\n await Promise.all([import(\"../Shaders/lensFlare.fragment.js\"), import(\"../Shaders/lensFlare.vertex.js\")]);\n }\n this._shadersLoaded = true;\n this._onShadersLoaded.notifyObservers();\n }\n _createIndexBuffer() {\n const indices = [];\n indices.push(0);\n indices.push(1);\n indices.push(2);\n indices.push(0);\n indices.push(2);\n indices.push(3);\n this._indexBuffer = this._scene.getEngine().createIndexBuffer(indices);\n }\n /**\n * Define if the lens flare system is enabled.\n */\n get isEnabled() {\n return this._isEnabled;\n }\n set isEnabled(value) {\n this._isEnabled = value;\n }\n /**\n * Get the scene the effects belongs to.\n * @returns the scene holding the lens flare system\n */\n getScene() {\n return this._scene;\n }\n /**\n * Get the emitter of the lens flare system.\n * It defines the source of the lens flares (it can be a camera, a light or a mesh).\n * @returns the emitter of the lens flare system\n */\n getEmitter() {\n return this._emitter;\n }\n /**\n * Set the emitter of the lens flare system.\n * It defines the source of the lens flares (it can be a camera, a light or a mesh).\n * @param newEmitter Define the new emitter of the system\n */\n setEmitter(newEmitter) {\n this._emitter = newEmitter;\n }\n /**\n * Get the lens flare system emitter position.\n * The emitter defines the source of the lens flares (it can be a camera, a light or a mesh).\n * @returns the position\n */\n getEmitterPosition() {\n return this._emitter.getAbsolutePosition ? this._emitter.getAbsolutePosition() : this._emitter.position;\n }\n /**\n * @internal\n */\n computeEffectivePosition(globalViewport) {\n let position = this.getEmitterPosition();\n position = Vector3.Project(position, Matrix.Identity(), this._scene.getTransformMatrix(), globalViewport);\n this._positionX = position.x;\n this._positionY = position.y;\n position = Vector3.TransformCoordinates(this.getEmitterPosition(), this._scene.getViewMatrix());\n if (this.viewportBorder > 0) {\n globalViewport.x -= this.viewportBorder;\n globalViewport.y -= this.viewportBorder;\n globalViewport.width += this.viewportBorder * 2;\n globalViewport.height += this.viewportBorder * 2;\n position.x += this.viewportBorder;\n position.y += this.viewportBorder;\n this._positionX += this.viewportBorder;\n this._positionY += this.viewportBorder;\n }\n const rhs = this._scene.useRightHandedSystem;\n const okZ = (position.z > 0 && !rhs) || (position.z < 0 && rhs);\n if (okZ) {\n if (this._positionX > globalViewport.x && this._positionX < globalViewport.x + globalViewport.width) {\n if (this._positionY > globalViewport.y && this._positionY < globalViewport.y + globalViewport.height) {\n return true;\n }\n }\n return true;\n }\n return false;\n }\n /** @internal */\n _isVisible() {\n if (!this._isEnabled || !this._scene.activeCamera) {\n return false;\n }\n const emitterPosition = this.getEmitterPosition();\n const direction = emitterPosition.subtract(this._scene.activeCamera.globalPosition);\n const distance = direction.length();\n direction.normalize();\n const ray = new Ray(this._scene.activeCamera.globalPosition, direction);\n const pickInfo = this._scene.pickWithRay(ray, this.meshesSelectionPredicate, true);\n return !pickInfo || !pickInfo.hit || pickInfo.distance > distance;\n }\n /**\n * @internal\n */\n render() {\n if (!this._scene.activeCamera || !this._shadersLoaded) {\n return false;\n }\n const engine = this._scene.getEngine();\n const viewport = this._scene.activeCamera.viewport;\n const globalViewport = viewport.toGlobal(engine.getRenderWidth(true), engine.getRenderHeight(true));\n // Position\n if (!this.computeEffectivePosition(globalViewport)) {\n return false;\n }\n // Visibility\n if (!this._isVisible()) {\n return false;\n }\n // Intensity\n let awayX;\n let awayY;\n if (this._positionX < this.borderLimit + globalViewport.x) {\n awayX = this.borderLimit + globalViewport.x - this._positionX;\n }\n else if (this._positionX > globalViewport.x + globalViewport.width - this.borderLimit) {\n awayX = this._positionX - globalViewport.x - globalViewport.width + this.borderLimit;\n }\n else {\n awayX = 0;\n }\n if (this._positionY < this.borderLimit + globalViewport.y) {\n awayY = this.borderLimit + globalViewport.y - this._positionY;\n }\n else if (this._positionY > globalViewport.y + globalViewport.height - this.borderLimit) {\n awayY = this._positionY - globalViewport.y - globalViewport.height + this.borderLimit;\n }\n else {\n awayY = 0;\n }\n let away = awayX > awayY ? awayX : awayY;\n away -= this.viewportBorder;\n if (away > this.borderLimit) {\n away = this.borderLimit;\n }\n let intensity = 1.0 - Clamp(away / this.borderLimit, 0, 1);\n if (intensity < 0) {\n return false;\n }\n if (intensity > 1.0) {\n intensity = 1.0;\n }\n if (this.viewportBorder > 0) {\n globalViewport.x += this.viewportBorder;\n globalViewport.y += this.viewportBorder;\n globalViewport.width -= this.viewportBorder * 2;\n globalViewport.height -= this.viewportBorder * 2;\n this._positionX -= this.viewportBorder;\n this._positionY -= this.viewportBorder;\n }\n // Position\n const centerX = globalViewport.x + globalViewport.width / 2;\n const centerY = globalViewport.y + globalViewport.height / 2;\n const distX = centerX - this._positionX;\n const distY = centerY - this._positionY;\n // Effects\n engine.setState(false);\n engine.setDepthBuffer(false);\n // Flares\n for (let index = 0; index < this.lensFlares.length; index++) {\n const flare = this.lensFlares[index];\n if (!flare._drawWrapper.effect.isReady() || (flare.texture && !flare.texture.isReady())) {\n continue;\n }\n engine.enableEffect(flare._drawWrapper);\n engine.bindBuffers(this._vertexBuffers, this._indexBuffer, flare._drawWrapper.effect);\n engine.setAlphaMode(flare.alphaMode);\n const x = centerX - distX * flare.position;\n const y = centerY - distY * flare.position;\n const cw = flare.size;\n const ch = flare.size * engine.getAspectRatio(this._scene.activeCamera, true);\n const cx = 2 * ((x - globalViewport.x) / globalViewport.width) - 1.0;\n const cy = 1.0 - 2 * ((y - globalViewport.y) / globalViewport.height);\n const viewportMatrix = Matrix.FromValues(cw / 2, 0, 0, 0, 0, ch / 2, 0, 0, 0, 0, 1, 0, cx, cy, 0, 1);\n flare._drawWrapper.effect.setMatrix(\"viewportMatrix\", viewportMatrix);\n // Texture\n flare._drawWrapper.effect.setTexture(\"textureSampler\", flare.texture);\n // Color\n flare._drawWrapper.effect.setFloat4(\"color\", flare.color.r * intensity, flare.color.g * intensity, flare.color.b * intensity, 1.0);\n // Draw order\n engine.drawElementsType(Material.TriangleFillMode, 0, 6);\n }\n engine.setDepthBuffer(true);\n engine.setAlphaMode(0);\n return true;\n }\n /**\n * Rebuilds the lens flare system\n */\n rebuild() {\n this._createIndexBuffer();\n for (const key in this._vertexBuffers) {\n this._vertexBuffers[key]?._rebuild();\n }\n }\n /**\n * Dispose and release the lens flare with its associated resources.\n */\n dispose() {\n this._onShadersLoaded.clear();\n const vertexBuffer = this._vertexBuffers[VertexBuffer.PositionKind];\n if (vertexBuffer) {\n vertexBuffer.dispose();\n this._vertexBuffers[VertexBuffer.PositionKind] = null;\n }\n if (this._indexBuffer) {\n this._scene.getEngine()._releaseBuffer(this._indexBuffer);\n this._indexBuffer = null;\n }\n while (this.lensFlares.length) {\n this.lensFlares[0].dispose();\n }\n // Remove from scene\n const index = this._scene.lensFlareSystems.indexOf(this);\n this._scene.lensFlareSystems.splice(index, 1);\n }\n /**\n * Parse a lens flare system from a JSON representation\n * @param parsedLensFlareSystem Define the JSON to parse\n * @param scene Define the scene the parsed system should be instantiated in\n * @param rootUrl Define the rootUrl of the load sequence to easily find a load relative dependencies such as textures\n * @returns the parsed system\n */\n static Parse(parsedLensFlareSystem, scene, rootUrl) {\n const emitter = scene.getLastEntryById(parsedLensFlareSystem.emitterId);\n const name = parsedLensFlareSystem.name || \"lensFlareSystem#\" + parsedLensFlareSystem.emitterId;\n const lensFlareSystem = new LensFlareSystem(name, emitter, scene);\n lensFlareSystem.id = parsedLensFlareSystem.id || name;\n lensFlareSystem.borderLimit = parsedLensFlareSystem.borderLimit;\n for (let index = 0; index < parsedLensFlareSystem.flares.length; index++) {\n const parsedFlare = parsedLensFlareSystem.flares[index];\n LensFlare.AddFlare(parsedFlare.size, parsedFlare.position, Color3.FromArray(parsedFlare.color), parsedFlare.textureName ? rootUrl + parsedFlare.textureName : \"\", lensFlareSystem);\n }\n return lensFlareSystem;\n }\n /**\n * Serialize the current Lens Flare System into a JSON representation.\n * @returns the serialized JSON\n */\n serialize() {\n const serializationObject = {};\n serializationObject.id = this.id;\n serializationObject.name = this.name;\n serializationObject.emitterId = this.getEmitter().id;\n serializationObject.borderLimit = this.borderLimit;\n serializationObject.flares = [];\n for (let index = 0; index < this.lensFlares.length; index++) {\n const flare = this.lensFlares[index];\n serializationObject.flares.push({\n size: flare.size,\n position: flare.position,\n color: flare.color.asArray(),\n textureName: Tools.GetFilename(flare.texture ? flare.texture.name : \"\"),\n });\n }\n return serializationObject;\n }\n}\n/**\n * Force all the lens flare systems to compile to glsl even on WebGPU engines.\n * False by default. This is mostly meant for backward compatibility.\n */\nLensFlareSystem.ForceGLSL = false;\n/**\n * @internal\n */\nLensFlareSystem._SceneComponentInitialization = (_) => {\n throw _WarnImport(\"LensFlareSystemSceneComponent\");\n};\n"],"mappings":";AAAA,SAASA,KAAK,QAAQ,kBAAkB;AACxC,SAASC,MAAM,EAAEC,OAAO,QAAQ,yBAAyB;AACzD,SAASC,KAAK,QAAQ,mCAAmC;AACzD,SAASC,WAAW,QAAQ,2BAA2B;AACvD,SAASC,YAAY,QAAQ,sBAAsB;AACnD,SAASC,GAAG,QAAQ,mBAAmB;AACvC,SAASC,QAAQ,QAAQ,0BAA0B;AACnD,SAASC,SAAS,QAAQ,gBAAgB;AAE1C,SAASC,WAAW,QAAQ,qBAAqB;AACjD,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,UAAU,QAAQ,uBAAuB;AAClD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,CAAC;EACzB;EACA,IAAIC,KAAKA,CAAA,EAAG;IACR,OAAO,IAAI,CAACC,MAAM;EACtB;EACA;AACJ;AACA;EACI,IAAIC,cAAcA,CAAA,EAAG;IACjB,OAAO,IAAI,C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