{"ast":null,"code":"import { Color3 } from \"../Maths/math.color.js\";\nimport { Texture } from \"../Materials/Textures/texture.js\";\nimport { DrawWrapper } from \"../Materials/drawWrapper.js\";\nimport { VertexBuffer } from \"../Buffers/buffer.js\";\n/**\n * This represents one of the lens effect in a `lensFlareSystem`.\n * It controls one of the individual texture used in the effect.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare\n */\nexport class LensFlare {\n /**\n * Creates a new Lens Flare.\n * This represents one of the lens effect in a `lensFlareSystem`.\n * It controls one of the individual texture used in the effect.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare\n * @param size Define the size of the lens flare (a floating value between 0 and 1)\n * @param position Define the position of the lens flare in the system. (a floating value between -1 and 1). A value of 0 is located on the emitter. A value greater than 0 is beyond the emitter and a value lesser than 0 is behind.\n * @param color Define the lens color\n * @param imgUrl Define the lens texture url\n * @param system Define the `lensFlareSystem` this flare is part of\n * @returns The newly created Lens Flare\n */\n static AddFlare(size, position, color, imgUrl, system) {\n return new LensFlare(size, position, color, imgUrl, system);\n }\n /**\n * Instantiates a new Lens Flare.\n * This represents one of the lens effect in a `lensFlareSystem`.\n * It controls one of the individual texture used in the effect.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare\n * @param size Define the size of the lens flare in the system (a floating value between 0 and 1)\n * @param position Define the position of the lens flare in the system. (a floating value between -1 and 1). A value of 0 is located on the emitter. A value greater than 0 is beyond the emitter and a value lesser than 0 is behind.\n * @param color Define the lens color\n * @param imgUrl Define the lens texture url\n * @param system Define the `lensFlareSystem` this flare is part of\n */\n constructor(\n /**\n * Define the size of the lens flare in the system (a floating value between 0 and 1)\n */\n size,\n /**\n * Define the position of the lens flare in the system. (a floating value between -1 and 1). A value of 0 is located on the emitter. A value greater than 0 is beyond the emitter and a value lesser than 0 is behind.\n */\n position, color, imgUrl, system) {\n this.size = size;\n this.position = position;\n /**\n * Define the alpha mode to render this particular lens.\n */\n this.alphaMode = 6;\n this.color = color || new Color3(1, 1, 1);\n this.texture = imgUrl ? new Texture(imgUrl, system.getScene(), true) : null;\n this._system = system;\n const engine = system.scene.getEngine();\n system._onShadersLoaded.addOnce(() => {\n this._drawWrapper = new DrawWrapper(engine);\n this._drawWrapper.effect = engine.createEffect(\"lensFlare\", [VertexBuffer.PositionKind], [\"color\", \"viewportMatrix\"], [\"textureSampler\"], \"\", undefined, undefined, undefined, undefined, system.shaderLanguage);\n });\n system.lensFlares.push(this);\n }\n /**\n * Dispose and release the lens flare with its associated resources.\n */\n dispose() {\n if (this.texture) {\n this.texture.dispose();\n }\n // Remove from scene\n const index = this._system.lensFlares.indexOf(this);\n this._system.lensFlares.splice(index, 1);\n }\n}","map":{"version":3,"names":["Color3","Texture","DrawWrapper","VertexBuffer","LensFlare","AddFlare","size","position","color","imgUrl","system","constructor","alphaMode","texture","getScene","_system","engine","scene","getEngine","_onShadersLoaded","addOnce","_drawWrapper","effect","createEffect","PositionKind","undefined","shaderLanguage","lensFlares","push","dispose","index","indexOf","splice"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/LensFlares/lensFlare.js"],"sourcesContent":["import { Color3 } from \"../Maths/math.color.js\";\nimport { Texture } from \"../Materials/Textures/texture.js\";\n\nimport { DrawWrapper } from \"../Materials/drawWrapper.js\";\nimport { VertexBuffer } from \"../Buffers/buffer.js\";\n/**\n * This represents one of the lens effect in a `lensFlareSystem`.\n * It controls one of the individual texture used in the effect.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare\n */\nexport class LensFlare {\n /**\n * Creates a new Lens Flare.\n * This represents one of the lens effect in a `lensFlareSystem`.\n * It controls one of the individual texture used in the effect.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare\n * @param size Define the size of the lens flare (a floating value between 0 and 1)\n * @param position Define the position of the lens flare in the system. (a floating value between -1 and 1). A value of 0 is located on the emitter. A value greater than 0 is beyond the emitter and a value lesser than 0 is behind.\n * @param color Define the lens color\n * @param imgUrl Define the lens texture url\n * @param system Define the `lensFlareSystem` this flare is part of\n * @returns The newly created Lens Flare\n */\n static AddFlare(size, position, color, imgUrl, system) {\n return new LensFlare(size, position, color, imgUrl, system);\n }\n /**\n * Instantiates a new Lens Flare.\n * This represents one of the lens effect in a `lensFlareSystem`.\n * It controls one of the individual texture used in the effect.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare\n * @param size Define the size of the lens flare in the system (a floating value between 0 and 1)\n * @param position Define the position of the lens flare in the system. (a floating value between -1 and 1). A value of 0 is located on the emitter. A value greater than 0 is beyond the emitter and a value lesser than 0 is behind.\n * @param color Define the lens color\n * @param imgUrl Define the lens texture url\n * @param system Define the `lensFlareSystem` this flare is part of\n */\n constructor(\n /**\n * Define the size of the lens flare in the system (a floating value between 0 and 1)\n */\n size, \n /**\n * Define the position of the lens flare in the system. (a floating value between -1 and 1). A value of 0 is located on the emitter. A value greater than 0 is beyond the emitter and a value lesser than 0 is behind.\n */\n position, color, imgUrl, system) {\n this.size = size;\n this.position = position;\n /**\n * Define the alpha mode to render this particular lens.\n */\n this.alphaMode = 6;\n this.color = color || new Color3(1, 1, 1);\n this.texture = imgUrl ? new Texture(imgUrl, system.getScene(), true) : null;\n this._system = system;\n const engine = system.scene.getEngine();\n system._onShadersLoaded.addOnce(() => {\n this._drawWrapper = new DrawWrapper(engine);\n this._drawWrapper.effect = engine.createEffect(\"lensFlare\", [VertexBuffer.PositionKind], [\"color\", \"viewportMatrix\"], [\"textureSampler\"], \"\", undefined, undefined, undefined, undefined, system.shaderLanguage);\n });\n system.lensFlares.push(this);\n }\n /**\n * Dispose and release the lens flare with its associated resources.\n */\n dispose() {\n if (this.texture) {\n this.texture.dispose();\n }\n // Remove from scene\n const index = this._system.lensFlares.indexOf(this);\n this._system.lensFlares.splice(index, 1);\n }\n}\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,OAAO,QAAQ,kCAAkC;AAE1D,S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