e06181dd28f9bfb36c56884df208db5fb3de4561329fa9d49559e5cece8b9ae3.json 47 KB

1
  1. {"ast":null,"code":"import { __decorate } from \"../tslib.es6.js\";\nimport { serialize, serializeAsTexture } from \"../Misc/decorators.js\";\nimport { Matrix, Vector3 } from \"../Maths/math.vector.js\";\nimport { Node } from \"../node.js\";\nimport { Light } from \"./light.js\";\nimport { ShadowLight } from \"./shadowLight.js\";\nimport { Texture } from \"../Materials/Textures/texture.js\";\nimport { RegisterClass } from \"../Misc/typeStore.js\";\nNode.AddNodeConstructor(\"Light_Type_2\", (name, scene) => {\n return () => new SpotLight(name, Vector3.Zero(), Vector3.Zero(), 0, 0, scene);\n});\n/**\n * A spot light is defined by a position, a direction, an angle, and an exponent.\n * These values define a cone of light starting from the position, emitting toward the direction.\n * The angle, in radians, defines the size (field of illumination) of the spotlight's conical beam,\n * and the exponent defines the speed of the decay of the light with distance (reach).\n * Documentation: https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction\n */\nexport class SpotLight extends ShadowLight {\n /**\n * Gets the cone angle of the spot light in Radians.\n */\n get angle() {\n return this._angle;\n }\n /**\n * Sets the cone angle of the spot light in Radians.\n */\n set angle(value) {\n this._angle = value;\n this._cosHalfAngle = Math.cos(value * 0.5);\n this._projectionTextureProjectionLightDirty = true;\n this.forceProjectionMatrixCompute();\n this._computeAngleValues();\n }\n /**\n * Only used in gltf falloff mode, this defines the angle where\n * the directional falloff will start before cutting at angle which could be seen\n * as outer angle.\n */\n get innerAngle() {\n return this._innerAngle;\n }\n /**\n * Only used in gltf falloff mode, this defines the angle where\n * the directional falloff will start before cutting at angle which could be seen\n * as outer angle.\n */\n set innerAngle(value) {\n this._innerAngle = value;\n this._computeAngleValues();\n }\n /**\n * Allows scaling the angle of the light for shadow generation only.\n */\n get shadowAngleScale() {\n return this._shadowAngleScale;\n }\n /**\n * Allows scaling the angle of the light for shadow generation only.\n */\n set shadowAngleScale(value) {\n this._shadowAngleScale = value;\n this.forceProjectionMatrixCompute();\n }\n /**\n * Allows reading the projection texture\n */\n get projectionTextureMatrix() {\n return this._projectionTextureMatrix;\n }\n /**\n * Gets the near clip of the Spotlight for texture projection.\n */\n get projectionTextureLightNear() {\n return this._projectionTextureLightNear;\n }\n /**\n * Sets the near clip of the Spotlight for texture projection.\n */\n set projectionTextureLightNear(value) {\n this._projectionTextureLightNear = value;\n this._projectionTextureProjectionLightDirty = true;\n }\n /**\n * Gets the far clip of the Spotlight for texture projection.\n */\n get projectionTextureLightFar() {\n return this._projectionTextureLightFar;\n }\n /**\n * Sets the far clip of the Spotlight for texture projection.\n */\n set projectionTextureLightFar(value) {\n this._projectionTextureLightFar = value;\n this._projectionTextureProjectionLightDirty = true;\n }\n /**\n * Gets the Up vector of the Spotlight for texture projection.\n */\n get projectionTextureUpDirection() {\n return this._projectionTextureUpDirection;\n }\n /**\n * Sets the Up vector of the Spotlight for texture projection.\n */\n set projectionTextureUpDirection(value) {\n this._projectionTextureUpDirection = value;\n this._projectionTextureProjectionLightDirty = true;\n }\n /**\n * Gets the projection texture of the light.\n */\n get projectionTexture() {\n return this._projectionTexture;\n }\n /**\n * Sets the projection texture of the light.\n */\n set projectionTexture(value) {\n if (this._projectionTexture === value) {\n return;\n }\n this._projectionTexture = value;\n this._projectionTextureDirty = true;\n if (this._projectionTexture && !this._projectionTexture.isReady()) {\n if (SpotLight._IsProceduralTexture(this._projectionTexture)) {\n this._projectionTexture.getEffect().executeWhenCompiled(() => {\n this._markMeshesAsLightDirty();\n });\n } else if (SpotLight._IsTexture(this._projectionTexture)) {\n this._projectionTexture.onLoadObservable.addOnce(() => {\n this._markMeshesAsLightDirty();\n });\n }\n }\n }\n static _IsProceduralTexture(texture) {\n return texture.onGeneratedObservable !== undefined;\n }\n static _IsTexture(texture) {\n return texture.onLoadObservable !== undefined;\n }\n /**\n * Gets or sets the light projection matrix as used by the projection texture\n */\n get projectionTextureProjectionLightMatrix() {\n return this._projectionTextureProjectionLightMatrix;\n }\n set projectionTextureProjectionLightMatrix(projection) {\n this._projectionTextureProjectionLightMatrix = projection;\n this._projectionTextureProjectionLightDirty = false;\n this._projectionTextureDirty = true;\n }\n /**\n * Creates a SpotLight object in the scene. A spot light is a simply light oriented cone.\n * It can cast shadows.\n * Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction\n * @param name The light friendly name\n * @param position The position of the spot light in the scene\n * @param direction The direction of the light in the scene\n * @param angle The cone angle of the light in Radians\n * @param exponent The light decay speed with the distance from the emission spot\n * @param scene The scene the lights belongs to\n */\n constructor(name, position, direction, angle, exponent, scene) {\n super(name, scene);\n this._innerAngle = 0;\n this._projectionTextureMatrix = Matrix.Zero();\n this._projectionTextureLightNear = 1e-6;\n this._projectionTextureLightFar = 1000.0;\n this._projectionTextureUpDirection = Vector3.Up();\n this._projectionTextureViewLightDirty = true;\n this._projectionTextureProjectionLightDirty = true;\n this._projectionTextureDirty = true;\n this._projectionTextureViewTargetVector = Vector3.Zero();\n this._projectionTextureViewLightMatrix = Matrix.Zero();\n this._projectionTextureProjectionLightMatrix = Matrix.Zero();\n this._projectionTextureScalingMatrix = Matrix.FromValues(0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.5, 1.0);\n this.position = position;\n this.direction = direction;\n this.angle = angle;\n this.exponent = exponent;\n }\n /**\n * Returns the string \"SpotLight\".\n * @returns the class name\n */\n getClassName() {\n return \"SpotLight\";\n }\n /**\n * Returns the integer 2.\n * @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x\n */\n getTypeID() {\n return Light.LIGHTTYPEID_SPOTLIGHT;\n }\n /**\n * Overrides the direction setter to recompute the projection texture view light Matrix.\n * @param value\n */\n _setDirection(value) {\n super._setDirection(value);\n this._projectionTextureViewLightDirty = true;\n }\n /**\n * Overrides the position setter to recompute the projection texture view light Matrix.\n * @param value\n */\n _setPosition(value) {\n super._setPosition(value);\n this._projectionTextureViewLightDirty = true;\n }\n /**\n * Sets the passed matrix \"matrix\" as perspective projection matrix for the shadows and the passed view matrix with the fov equal to the SpotLight angle and and aspect ratio of 1.0.\n * Returns the SpotLight.\n * @param matrix\n * @param viewMatrix\n * @param renderList\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _setDefaultShadowProjectionMatrix(matrix, viewMatrix, renderList) {\n const activeCamera = this.getScene().activeCamera;\n if (!activeCamera) {\n return;\n }\n this._shadowAngleScale = this._shadowAngleScale || 1;\n const angle = this._shadowAngleScale * this._angle;\n const minZ = this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ;\n const maxZ = this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ;\n const useReverseDepthBuffer = this.getScene().getEngine().useReverseDepthBuffer;\n Matrix.PerspectiveFovLHToRef(angle, 1.0, useReverseDepthBuffer ? maxZ : minZ, useReverseDepthBuffer ? minZ : maxZ, matrix, true, this._scene.getEngine().isNDCHalfZRange, undefined, useReverseDepthBuffer);\n }\n _computeProjectionTextureViewLightMatrix() {\n this._projectionTextureViewLightDirty = false;\n this._projectionTextureDirty = true;\n this.getAbsolutePosition().addToRef(this.getShadowDirection(), this._projectionTextureViewTargetVector);\n Matrix.LookAtLHToRef(this.getAbsolutePosition(), this._projectionTextureViewTargetVector, this._projectionTextureUpDirection, this._projectionTextureViewLightMatrix);\n }\n _computeProjectionTextureProjectionLightMatrix() {\n this._projectionTextureProjectionLightDirty = false;\n this._projectionTextureDirty = true;\n const lightFar = this.projectionTextureLightFar;\n const lightNear = this.projectionTextureLightNear;\n const P = lightFar / (lightFar - lightNear);\n const Q = -P * lightNear;\n const S = 1.0 / Math.tan(this._angle / 2.0);\n const A = 1.0;\n Matrix.FromValuesToRef(S / A, 0.0, 0.0, 0.0, 0.0, S, 0.0, 0.0, 0.0, 0.0, P, 1.0, 0.0, 0.0, Q, 0.0, this._projectionTextureProjectionLightMatrix);\n }\n /**\n * Main function for light texture projection matrix computing.\n */\n _computeProjectionTextureMatrix() {\n this._projectionTextureDirty = false;\n this._projectionTextureViewLightMatrix.multiplyToRef(this._projectionTextureProjectionLightMatrix, this._projectionTextureMatrix);\n if (this._projectionTexture instanceof Texture) {\n const u = this._projectionTexture.uScale / 2.0;\n const v = this._projectionTexture.vScale / 2.0;\n Matrix.FromValuesToRef(u, 0.0, 0.0, 0.0, 0.0, v, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.5, 1.0, this._projectionTextureScalingMatrix);\n }\n this._projectionTextureMatrix.multiplyToRef(this._projectionTextureScalingMatrix, this._projectionTextureMatrix);\n }\n _buildUniformLayout() {\n this._uniformBuffer.addUniform(\"vLightData\", 4);\n this._uniformBuffer.addUniform(\"vLightDiffuse\", 4);\n this._uniformBuffer.addUniform(\"vLightSpecular\", 4);\n this._uniformBuffer.addUniform(\"vLightDirection\", 3);\n this._uniformBuffer.addUniform(\"vLightFalloff\", 4);\n this._uniformBuffer.addUniform(\"shadowsInfo\", 3);\n this._uniformBuffer.addUniform(\"depthValues\", 2);\n this._uniformBuffer.create();\n }\n _computeAngleValues() {\n this._lightAngleScale = 1.0 / Math.max(0.001, Math.cos(this._innerAngle * 0.5) - this._cosHalfAngle);\n this._lightAngleOffset = -this._cosHalfAngle * this._lightAngleScale;\n }\n /**\n * Sets the passed Effect \"effect\" with the Light textures.\n * @param effect The effect to update\n * @param lightIndex The index of the light in the effect to update\n * @returns The light\n */\n transferTexturesToEffect(effect, lightIndex) {\n if (this.projectionTexture && this.projectionTexture.isReady()) {\n if (this._projectionTextureViewLightDirty) {\n this._computeProjectionTextureViewLightMatrix();\n }\n if (this._projectionTextureProjectionLightDirty) {\n this._computeProjectionTextureProjectionLightMatrix();\n }\n if (this._projectionTextureDirty) {\n this._computeProjectionTextureMatrix();\n }\n effect.setMatrix(\"textureProjectionMatrix\" + lightIndex, this._projectionTextureMatrix);\n effect.setTexture(\"projectionLightTexture\" + lightIndex, this.projectionTexture);\n }\n return this;\n }\n /**\n * Sets the passed Effect object with the SpotLight transformed position (or position if not parented) and normalized direction.\n * @param effect The effect to update\n * @param lightIndex The index of the light in the effect to update\n * @returns The spot light\n */\n transferToEffect(effect, lightIndex) {\n let normalizeDirection;\n if (this.computeTransformedInformation()) {\n this._uniformBuffer.updateFloat4(\"vLightData\", this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, this.exponent, lightIndex);\n normalizeDirection = Vector3.Normalize(this.transformedDirection);\n } else {\n this._uniformBuffer.updateFloat4(\"vLightData\", this.position.x, this.position.y, this.position.z, this.exponent, lightIndex);\n normalizeDirection = Vector3.Normalize(this.direction);\n }\n this._uniformBuffer.updateFloat4(\"vLightDirection\", normalizeDirection.x, normalizeDirection.y, normalizeDirection.z, this._cosHalfAngle, lightIndex);\n this._uniformBuffer.updateFloat4(\"vLightFalloff\", this.range, this._inverseSquaredRange, this._lightAngleScale, this._lightAngleOffset, lightIndex);\n return this;\n }\n transferToNodeMaterialEffect(effect, lightDataUniformName) {\n let normalizeDirection;\n if (this.computeTransformedInformation()) {\n normalizeDirection = Vector3.Normalize(this.transformedDirection);\n } else {\n normalizeDirection = Vector3.Normalize(this.direction);\n }\n if (this.getScene().useRightHandedSystem) {\n effect.setFloat3(lightDataUniformName, -normalizeDirection.x, -normalizeDirection.y, -normalizeDirection.z);\n } else {\n effect.setFloat3(lightDataUniformName, normalizeDirection.x, normalizeDirection.y, normalizeDirection.z);\n }\n return this;\n }\n /**\n * Disposes the light and the associated resources.\n */\n dispose() {\n super.dispose();\n if (this._projectionTexture) {\n this._projectionTexture.dispose();\n }\n }\n /**\n * Gets the minZ used for shadow according to both the scene and the light.\n * @param activeCamera The camera we are returning the min for\n * @returns the depth min z\n */\n getDepthMinZ(activeCamera) {\n const engine = this._scene.getEngine();\n const minZ = this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ;\n return engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? minZ : this._scene.getEngine().isNDCHalfZRange ? 0 : minZ;\n }\n /**\n * Gets the maxZ used for shadow according to both the scene and the light.\n * @param activeCamera The camera we are returning the max for\n * @returns the depth max z\n */\n getDepthMaxZ(activeCamera) {\n const engine = this._scene.getEngine();\n const maxZ = this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ;\n return engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : maxZ;\n }\n /**\n * Prepares the list of defines specific to the light type.\n * @param defines the list of defines\n * @param lightIndex defines the index of the light for the effect\n */\n prepareLightSpecificDefines(defines, lightIndex) {\n defines[\"SPOTLIGHT\" + lightIndex] = true;\n defines[\"PROJECTEDLIGHTTEXTURE\" + lightIndex] = this.projectionTexture && this.projectionTexture.isReady() ? true : false;\n }\n}\n__decorate([serialize()], SpotLight.prototype, \"angle\", null);\n__decorate([serialize()], SpotLight.prototype, \"innerAngle\", null);\n__decorate([serialize()], SpotLight.prototype, \"shadowAngleScale\", null);\n__decorate([serialize()], SpotLight.prototype, \"exponent\", void 0);\n__decorate([serialize()], SpotLight.prototype, \"projectionTextureLightNear\", null);\n__decorate([serialize()], SpotLight.prototype, \"projectionTextureLightFar\", null);\n__decorate([serialize()], SpotLight.prototype, \"projectionTextureUpDirection\", null);\n__decorate([serializeAsTexture(\"projectedLightTexture\")], SpotLight.prototype, \"_projectionTexture\", void 0);\n// Register Class Name\nRegisterClass(\"BABYLON.SpotLight\", SpotLight);","map":{"version":3,"names":["__decorate","serialize","serializeAsTexture","Matrix","Vector3","Node","Light","ShadowLight","Texture","RegisterClass","AddNodeConstructor","name","scene","SpotLight","Zero","angle","_angle","value","_cosHalfAngle","Math","cos","_projectionTextureProjectionLightDirty","forceProjectionMatrixCompute","_computeAngleValues","innerAngle","_innerAngle","shadowAngleScale","_shadowAngleScale","projectionTextureMatrix","_projectionTextureMatrix","projectionTextureLightNear","_projectionTextureLightNear","projectionTextureLightFar","_projectionTextureLightFar","projectionTextureUpDirection","_projectionTextureUpDirection","projectionTexture","_projectionTexture","_projectionTextureDirty","isReady","_IsProceduralTexture","getEffect","executeWhenCompiled","_markMeshesAsLightDirty","_IsTexture","onLoadObservable","addOnce","texture","onGeneratedObservable","undefined","projectionTextureProjectionLightMatrix","_projectionTextureProjectionLightMatrix","projection","constructor","position","direction","exponent","Up","_projectionTextureViewLightDirty","_projectionTextureViewTargetVector","_projectionTextureViewLightMatrix","_projectionTextureScalingMatrix","FromValues","getClassName","getTypeID","LIGHTTYPEID_SPOTLIGHT","_setDirection","_setPosition","_setDefaultShadowProjectionMatrix","matrix","viewMatrix","renderList","activeCamera","getScene","minZ","shadowMinZ","maxZ","shadowMaxZ","useReverseDepthBuffer","getEngine","PerspectiveFovLHToRef","_scene","isNDCHalfZRange","_computeProjectionTextureViewLightMatrix","getAbsolutePosition","addToRef","getShadowDirection","LookAtLHToRef","_computeProjectionTextureProjectionLightMatrix","lightFar","lightNear","P","Q","S","tan","A","FromValuesToRef","_computeProjectionTextureMatrix","multiplyToRef","u","uScale","v","vScale","_buildUniformLayout","_uniformBuffer","addUniform","create","_lightAngleScale","max","_lightAngleOffset","transferTexturesToEffect","effect","lightIndex","setMatrix","setTexture","transferToEffect","normalizeDirection","computeTransformedInformation","updateFloat4","transformedPosition","x","y","z","Normalize","transformedDirection","range","_inverseSquaredRange","transferToNodeMaterialEffect","lightDataUniformName","useRightHandedSystem","setFloat3","dispose","getDepthMinZ","engine","getDepthMaxZ","prepareLightSpecificDefines","defines","prototype"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Lights/spotLight.js"],"sourcesContent":["import { __decorate } from \"../tslib.es6.js\";\nimport { serialize, serializeAsTexture } from \"../Misc/decorators.js\";\nimport { Matrix, Vector3 } from \"../Maths/math.vector.js\";\nimport { Node } from \"../node.js\";\nimport { Light } from \"./light.js\";\nimport { ShadowLight } from \"./shadowLight.js\";\nimport { Texture } from \"../Materials/Textures/texture.js\";\nimport { RegisterClass } from \"../Misc/typeStore.js\";\nNode.AddNodeConstructor(\"Light_Type_2\", (name, scene) => {\n return () => new SpotLight(name, Vector3.Zero(), Vector3.Zero(), 0, 0, scene);\n});\n/**\n * A spot light is defined by a position, a direction, an angle, and an exponent.\n * These values define a cone of light starting from the position, emitting toward the direction.\n * The angle, in radians, defines the size (field of illumination) of the spotlight's conical beam,\n * and the exponent defines the speed of the decay of the light with distance (reach).\n * Documentation: https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction\n */\nexport class SpotLight extends ShadowLight {\n /**\n * Gets the cone angle of the spot light in Radians.\n */\n get angle() {\n return this._angle;\n }\n /**\n * Sets the cone angle of the spot light in Radians.\n */\n set angle(value) {\n this._angle = value;\n this._cosHalfAngle = Math.cos(value * 0.5);\n this._projectionTextureProjectionLightDirty = true;\n this.forceProjectionMatrixCompute();\n this._computeAngleValues();\n }\n /**\n * Only used in gltf falloff mode, this defines the angle where\n * the directional falloff will start before cutting at angle which could be seen\n * as outer angle.\n */\n get innerAngle() {\n return this._innerAngle;\n }\n /**\n * Only used in gltf falloff mode, this defines the angle where\n * the directional falloff will start before cutting at angle which could be seen\n * as outer angle.\n */\n set innerAngle(value) {\n this._innerAngle = value;\n this._computeAngleValues();\n }\n /**\n * Allows scaling the angle of the light for shadow generation only.\n */\n get shadowAngleScale() {\n return this._shadowAngleScale;\n }\n /**\n * Allows scaling the angle of the light for shadow generation only.\n */\n set shadowAngleScale(value) {\n this._shadowAngleScale = value;\n this.forceProjectionMatrixCompute();\n }\n /**\n * Allows reading the projection texture\n */\n get projectionTextureMatrix() {\n return this._projectionTextureMatrix;\n }\n /**\n * Gets the near clip of the Spotlight for texture projection.\n */\n get projectionTextureLightNear() {\n return this._projectionTextureLightNear;\n }\n /**\n * Sets the near clip of the Spotlight for texture projection.\n */\n set projectionTextureLightNear(value) {\n this._projectionTextureLightNear = value;\n this._projectionTextureProjectionLightDirty = true;\n }\n /**\n * Gets the far clip of the Spotlight for texture projection.\n */\n get projectionTextureLightFar() {\n return this._projectionTextureLightFar;\n }\n /**\n * Sets the far clip of the Spotlight for texture projection.\n */\n set projectionTextureLightFar(value) {\n this._projectionTextureLightFar = value;\n this._projectionTextureProjectionLightDirty = true;\n }\n /**\n * Gets the Up vector of the Spotlight for texture projection.\n */\n get projectionTextureUpDirection() {\n return this._projectionTextureUpDirection;\n }\n /**\n * Sets the Up vector of the Spotlight for texture projection.\n */\n set projectionTextureUpDirection(value) {\n this._projectionTextureUpDirection = value;\n this._projectionTextureProjectionLightDirty = true;\n }\n /**\n * Gets the projection texture of the light.\n */\n get projectionTexture() {\n return this._projectionTexture;\n }\n /**\n * Sets the projection texture of the light.\n */\n set projectionTexture(value) {\n if (this._projectionTexture === value) {\n return;\n }\n this._projectionTexture = value;\n this._projectionTextureDirty = true;\n if (this._projectionTexture && !this._projectionTexture.isReady()) {\n if (SpotLight._IsProceduralTexture(this._projectionTexture)) {\n this._projectionTexture.getEffect().executeWhenCompiled(() => {\n this._markMeshesAsLightDirty();\n });\n }\n else if (SpotLight._IsTexture(this._projectionTexture)) {\n this._projectionTexture.onLoadObservable.addOnce(() => {\n this._markMeshesAsLightDirty();\n });\n }\n }\n }\n static _IsProceduralTexture(texture) {\n return texture.onGeneratedObservable !== undefined;\n }\n static _IsTexture(texture) {\n return texture.onLoadObservable !== undefined;\n }\n /**\n * Gets or sets the light projection matrix as used by the projection texture\n */\n get projectionTextureProjectionLightMatrix() {\n return this._projectionTextureProjectionLightMatrix;\n }\n set projectionTextureProjectionLightMatrix(projection) {\n this._projectionTextureProjectionLightMatrix = projection;\n this._projectionTextureProjectionLightDirty = false;\n this._projectionTextureDirty = true;\n }\n /**\n * Creates a SpotLight object in the scene. A spot light is a simply light oriented cone.\n * It can cast shadows.\n * Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction\n * @param name The light friendly name\n * @param position The position of the spot light in the scene\n * @param direction The direction of the light in the scene\n * @param angle The cone angle of the light in Radians\n * @param exponent The light decay speed with the distance from the emission spot\n * @param scene The scene the lights belongs to\n */\n constructor(name, position, direction, angle, exponent, scene) {\n super(name, scene);\n this._innerAngle = 0;\n this._projectionTextureMatrix = Matrix.Zero();\n this._projectionTextureLightNear = 1e-6;\n this._projectionTextureLightFar = 1000.0;\n this._projectionTextureUpDirection = Vector3.Up();\n this._projectionTextureViewLightDirty = true;\n this._projectionTextureProjectionLightDirty = true;\n this._projectionTextureDirty = true;\n this._projectionTextureViewTargetVector = Vector3.Zero();\n this._projectionTextureViewLightMatrix = Matrix.Zero();\n this._projectionTextureProjectionLightMatrix = Matrix.Zero();\n this._projectionTextureScalingMatrix = Matrix.FromValues(0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.5, 1.0);\n this.position = position;\n this.direction = direction;\n this.angle = angle;\n this.exponent = exponent;\n }\n /**\n * Returns the string \"SpotLight\".\n * @returns the class name\n */\n getClassName() {\n return \"SpotLight\";\n }\n /**\n * Returns the integer 2.\n * @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x\n */\n getTypeID() {\n return Light.LIGHTTYPEID_SPOTLIGHT;\n }\n /**\n * Overrides the direction setter to recompute the projection texture view light Matrix.\n * @param value\n */\n _setDirection(value) {\n super._setDirection(value);\n this._projectionTextureViewLightDirty = true;\n }\n /**\n * Overrides the position setter to recompute the projection texture view light Matrix.\n * @param value\n */\n _setPosition(value) {\n super._setPosition(value);\n this._projectionTextureViewLightDirty = true;\n }\n /**\n * Sets the passed matrix \"matrix\" as perspective projection matrix for the shadows and the passed view matrix with the fov equal to the SpotLight angle and and aspect ratio of 1.0.\n * Returns the SpotLight.\n * @param matrix\n * @param viewMatrix\n * @param renderList\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _setDefaultShadowProjectionMatrix(matrix, viewMatrix, renderList) {\n const activeCamera = this.getScene().activeCamera;\n if (!activeCamera) {\n return;\n }\n this._shadowAngleScale = this._shadowAngleScale || 1;\n const angle = this._shadowAngleScale * this._angle;\n const minZ = this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ;\n const maxZ = this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ;\n const useReverseDepthBuffer = this.getScene().getEngine().useReverseDepthBuffer;\n Matrix.PerspectiveFovLHToRef(angle, 1.0, useReverseDepthBuffer ? maxZ : minZ, useReverseDepthBuffer ? minZ : maxZ, matrix, true, this._scene.getEngine().isNDCHalfZRange, undefined, useReverseDepthBuffer);\n }\n _computeProjectionTextureViewLightMatrix() {\n this._projectionTextureViewLightDirty = false;\n this._projectionTextureDirty = true;\n this.getAbsolutePosition().addToRef(this.getShadowDirection(), this._projectionTextureViewTargetVector);\n Matrix.LookAtLHToRef(this.getAbsolutePosition(), this._projectionTextureViewTargetVector, this._projectionTextureUpDirection, this._projectionTextureViewLightMatrix);\n }\n _computeProjectionTextureProjectionLightMatrix() {\n this._projectionTextureProjectionLightDirty = false;\n this._projectionTextureDirty = true;\n const lightFar = this.projectionTextureLightFar;\n const lightNear = this.projectionTextureLightNear;\n const P = lightFar / (lightFar - lightNear);\n const Q = -P * lightNear;\n const S = 1.0 / Math.tan(this._angle / 2.0);\n const A = 1.0;\n Matrix.FromValuesToRef(S / A, 0.0, 0.0, 0.0, 0.0, S, 0.0, 0.0, 0.0, 0.0, P, 1.0, 0.0, 0.0, Q, 0.0, this._projectionTextureProjectionLightMatrix);\n }\n /**\n * Main function for light texture projection matrix computing.\n */\n _computeProjectionTextureMatrix() {\n this._projectionTextureDirty = false;\n this._projectionTextureViewLightMatrix.multiplyToRef(this._projectionTextureProjectionLightMatrix, this._projectionTextureMatrix);\n if (this._projectionTexture instanceof Texture) {\n const u = this._projectionTexture.uScale / 2.0;\n const v = this._projectionTexture.vScale / 2.0;\n Matrix.FromValuesToRef(u, 0.0, 0.0, 0.0, 0.0, v, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.5, 1.0, this._projectionTextureScalingMatrix);\n }\n this._projectionTextureMatrix.multiplyToRef(this._projectionTextureScalingMatrix, this._projectionTextureMatrix);\n }\n _buildUniformLayout() {\n this._uniformBuffer.addUniform(\"vLightData\", 4);\n this._uniformBuffer.addUniform(\"vLightDiffuse\", 4);\n this._uniformBuffer.addUniform(\"vLightSpecular\", 4);\n this._uniformBuffer.addUniform(\"vLightDirection\", 3);\n this._uniformBuffer.addUniform(\"vLightFalloff\", 4);\n this._uniformBuffer.addUniform(\"shadowsInfo\", 3);\n this._uniformBuffer.addUniform(\"depthValues\", 2);\n this._uniformBuffer.create();\n }\n _computeAngleValues() {\n this._lightAngleScale = 1.0 / Math.max(0.001, Math.cos(this._innerAngle * 0.5) - this._cosHalfAngle);\n this._lightAngleOffset = -this._cosHalfAngle * this._lightAngleScale;\n }\n /**\n * Sets the passed Effect \"effect\" with the Light textures.\n * @param effect The effect to update\n * @param lightIndex The index of the light in the effect to update\n * @returns The light\n */\n transferTexturesToEffect(effect, lightIndex) {\n if (this.projectionTexture && this.projectionTexture.isReady()) {\n if (this._projectionTextureViewLightDirty) {\n this._computeProjectionTextureViewLightMatrix();\n }\n if (this._projectionTextureProjectionLightDirty) {\n this._computeProjectionTextureProjectionLightMatrix();\n }\n if (this._projectionTextureDirty) {\n this._computeProjectionTextureMatrix();\n }\n effect.setMatrix(\"textureProjectionMatrix\" + lightIndex, this._projectionTextureMatrix);\n effect.setTexture(\"projectionLightTexture\" + lightIndex, this.projectionTexture);\n }\n return this;\n }\n /**\n * Sets the passed Effect object with the SpotLight transformed position (or position if not parented) and normalized direction.\n * @param effect The effect to update\n * @param lightIndex The index of the light in the effect to update\n * @returns The spot light\n */\n transferToEffect(effect, lightIndex) {\n let normalizeDirection;\n if (this.computeTransformedInformation()) {\n this._uniformBuffer.updateFloat4(\"vLightData\", this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, this.exponent, lightIndex);\n normalizeDirection = Vector3.Normalize(this.transformedDirection);\n }\n else {\n this._uniformBuffer.updateFloat4(\"vLightData\", this.position.x, this.position.y, this.position.z, this.exponent, lightIndex);\n normalizeDirection = Vector3.Normalize(this.direction);\n }\n this._uniformBuffer.updateFloat4(\"vLightDirection\", normalizeDirection.x, normalizeDirection.y, normalizeDirection.z, this._cosHalfAngle, lightIndex);\n this._uniformBuffer.updateFloat4(\"vLightFalloff\", this.range, this._inverseSquaredRange, this._lightAngleScale, this._lightAngleOffset, lightIndex);\n return this;\n }\n transferToNodeMaterialEffect(effect, lightDataUniformName) {\n let normalizeDirection;\n if (this.computeTransformedInformation()) {\n normalizeDirection = Vector3.Normalize(this.transformedDirection);\n }\n else {\n normalizeDirection = Vector3.Normalize(this.direction);\n }\n if (this.getScene().useRightHandedSystem) {\n effect.setFloat3(lightDataUniformName, -normalizeDirection.x, -normalizeDirection.y, -normalizeDirection.z);\n }\n else {\n effect.setFloat3(lightDataUniformName, normalizeDirection.x, normalizeDirection.y, normalizeDirection.z);\n }\n return this;\n }\n /**\n * Disposes the light and the associated resources.\n */\n dispose() {\n super.dispose();\n if (this._projectionTexture) {\n this._projectionTexture.dispose();\n }\n }\n /**\n * Gets the minZ used for shadow according to both the scene and the light.\n * @param activeCamera The camera we are returning the min for\n * @returns the depth min z\n */\n getDepthMinZ(activeCamera) {\n const engine = this._scene.getEngine();\n const minZ = this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ;\n return engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? minZ : this._scene.getEngine().isNDCHalfZRange ? 0 : minZ;\n }\n /**\n * Gets the maxZ used for shadow according to both the scene and the light.\n * @param activeCamera The camera we are returning the max for\n * @returns the depth max z\n */\n getDepthMaxZ(activeCamera) {\n const engine = this._scene.getEngine();\n const maxZ = this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ;\n return engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : maxZ;\n }\n /**\n * Prepares the list of defines specific to the light type.\n * @param defines the list of defines\n * @param lightIndex defines the index of the light for the effect\n */\n prepareLightSpecificDefines(defines, lightIndex) {\n defines[\"SPOTLIGHT\" + lightIndex] = true;\n defines[\"PROJECTEDLIGHTTEXTURE\" + lightIndex] = this.projectionTexture && this.projectionTexture.isReady() ? true : false;\n }\n}\n__decorate([\n serialize()\n], SpotLight.prototype, \"angle\", null);\n__decorate([\n serialize()\n], SpotLight.prototype, \"innerAngle\", null);\n__decorate([\n serialize()\n], SpotLight.prototype, \"shadowAngleScale\", null);\n__decorate([\n serialize()\n], SpotLight.prototype, \"exponent\", void 0);\n__decorate([\n serialize()\n], SpotLight.prototype, \"projectionTextureLightNear\", null);\n__decorate([\n serialize()\n], SpotLight.prototype, \"projectionTextureLightFar\", null);\n__decorate([\n serialize()\n], SpotLight.prototype, \"projectionTextureUpDirection\", null);\n__decorate([\n serializeAsTexture(\"projectedLightTexture\")\n], SpotLight.prototype, \"_projectionTexture\", void 0);\n// Register Class Name\nRegisterClass(\"BABYLON.SpotLight\", SpotLight);\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,SAAS,EAAEC,kBAAkB,QAAQ,uBAAuB;AACrE,SAASC,MAAM,EAAEC,OAAO,QAAQ,yBAAyB;AACzD,SAASC,IAAI,QAAQ,YAAY;AACjC,SAASC,KAAK,QAAQ,YAAY;AAClC,SAASC,WAAW,QAAQ,kBAAkB;AAC9C,SAASC,OAAO,QAAQ,kCAAkC;AAC1D,SAASC,aAAa,QAAQ,sBAAsB;AACpDJ,IAAI,CAACK,kBAAkB,CAAC,cAAc,EAAE,CAACC,IAAI,EAAEC,KAAK,KAAK;EACrD,OAAO,MAAM,IAAIC,SAAS,CAACF,IAAI,EAAEP,OAAO,CAACU,IAAI,CAAC,CAAC,EAAEV,OAAO,CAACU,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAEF,KAAK,CAAC;AACjF,CAAC,CAAC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,SAAS,SAASN,WAAW,CAAC;EACvC;AACJ;AACA;EACI,IAAIQ,KAAKA,CAAA,EAAG;IACR,OAAO,IAAI,CAACC,MAAM;E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