7aeeea70bb7d8696beba53f793d2e3026b0b6096ae249dc66050e285fb5d84de.json 119 KB

1
  1. {"ast":null,"code":"import { __decorate } from \"../../tslib.es6.js\";\nimport { serialize } from \"../../Misc/decorators.js\";\nimport { Observable } from \"../../Misc/observable.js\";\nimport { Matrix, TmpVectors, Vector3 } from \"../../Maths/math.vector.js\";\nimport { BaseTexture } from \"../../Materials/Textures/baseTexture.js\";\nimport { GetClass, RegisterClass } from \"../../Misc/typeStore.js\";\nimport { _WarnImport } from \"../../Misc/devTools.js\";\nimport { TimingTools } from \"../../Misc/timingTools.js\";\nimport { InstantiationTools } from \"../../Misc/instantiationTools.js\";\nimport { Plane } from \"../../Maths/math.plane.js\";\nimport { EncodeArrayBufferToBase64 } from \"../../Misc/stringTools.js\";\nimport { GenerateBase64StringFromTexture, GenerateBase64StringFromTextureAsync } from \"../../Misc/copyTools.js\";\nimport { useOpenGLOrientationForUV } from \"../../Compat/compatibilityOptions.js\";\nimport { SerializationHelper } from \"../../Misc/decorators.serialization.js\";\n/**\n * This represents a texture in babylon. It can be easily loaded from a network, base64 or html input.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction#texture\n */\nexport class Texture extends BaseTexture {\n /**\n * @internal\n */\n static _CreateVideoTexture(name, src, scene, generateMipMaps = false, invertY = false, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, settings = {}, onError, format = 5) {\n throw _WarnImport(\"VideoTexture\");\n }\n /**\n * Are mip maps generated for this texture or not.\n */\n get noMipmap() {\n return this._noMipmap;\n }\n /** Returns the texture mime type if it was defined by a loader (undefined else) */\n get mimeType() {\n return this._mimeType;\n }\n /**\n * Is the texture preventing material to render while loading.\n * If false, a default texture will be used instead of the loading one during the preparation step.\n */\n set isBlocking(value) {\n this._isBlocking = value;\n }\n get isBlocking() {\n return this._isBlocking;\n }\n /**\n * Gets a boolean indicating if the texture needs to be inverted on the y axis during loading\n */\n get invertY() {\n return this._invertY;\n }\n /**\n * Instantiates a new texture.\n * This represents a texture in babylon. It can be easily loaded from a network, base64 or html input.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction#texture\n * @param url defines the url of the picture to load as a texture\n * @param sceneOrEngine defines the scene or engine the texture will belong to\n * @param noMipmapOrOptions defines if the texture will require mip maps or not or set of all options to create the texture\n * @param invertY defines if the texture needs to be inverted on the y axis during loading\n * @param samplingMode defines the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...)\n * @param onLoad defines a callback triggered when the texture has been loaded\n * @param onError defines a callback triggered when an error occurred during the loading session\n * @param buffer defines the buffer to load the texture from in case the texture is loaded from a buffer representation\n * @param deleteBuffer defines if the buffer we are loading the texture from should be deleted after load\n * @param format defines the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)\n * @param mimeType defines an optional mime type information\n * @param loaderOptions options to be passed to the loader\n * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)\n * @param forcedExtension defines the extension to use to pick the right loader\n */\n constructor(url, sceneOrEngine, noMipmapOrOptions, invertY, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, onLoad = null, onError = null, buffer = null, deleteBuffer = false, format, mimeType, loaderOptions, creationFlags, forcedExtension) {\n var _internalTexture;\n super(sceneOrEngine);\n /**\n * Define the url of the texture.\n */\n this.url = null;\n /**\n * Define an offset on the texture to offset the u coordinates of the UVs\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#offsetting\n */\n this.uOffset = 0;\n /**\n * Define an offset on the texture to offset the v coordinates of the UVs\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#offsetting\n */\n this.vOffset = 0;\n /**\n * Define an offset on the texture to scale the u coordinates of the UVs\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#tiling\n */\n this.uScale = 1.0;\n /**\n * Define an offset on the texture to scale the v coordinates of the UVs\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#tiling\n */\n this.vScale = 1.0;\n /**\n * Define an offset on the texture to rotate around the u coordinates of the UVs\n * The angle is defined in radians.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials\n */\n this.uAng = 0;\n /**\n * Define an offset on the texture to rotate around the v coordinates of the UVs\n * The angle is defined in radians.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials\n */\n this.vAng = 0;\n /**\n * Define an offset on the texture to rotate around the w coordinates of the UVs (in case of 3d texture)\n * The angle is defined in radians.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials\n */\n this.wAng = 0;\n /**\n * Defines the center of rotation (U)\n */\n this.uRotationCenter = 0.5;\n /**\n * Defines the center of rotation (V)\n */\n this.vRotationCenter = 0.5;\n /**\n * Defines the center of rotation (W)\n */\n this.wRotationCenter = 0.5;\n /**\n * Sets this property to true to avoid deformations when rotating the texture with non-uniform scaling\n */\n this.homogeneousRotationInUVTransform = false;\n /**\n * List of inspectable custom properties (used by the Inspector)\n * @see https://doc.babylonjs.com/toolsAndResources/inspector#extensibility\n */\n this.inspectableCustomProperties = null;\n /** @internal */\n this._noMipmap = false;\n /** @internal */\n this._invertY = false;\n this._rowGenerationMatrix = null;\n this._cachedTextureMatrix = null;\n this._projectionModeMatrix = null;\n this._t0 = null;\n this._t1 = null;\n this._t2 = null;\n this._cachedUOffset = -1;\n this._cachedVOffset = -1;\n this._cachedUScale = 0;\n this._cachedVScale = 0;\n this._cachedUAng = -1;\n this._cachedVAng = -1;\n this._cachedWAng = -1;\n this._cachedReflectionProjectionMatrixId = -1;\n this._cachedURotationCenter = -1;\n this._cachedVRotationCenter = -1;\n this._cachedWRotationCenter = -1;\n this._cachedHomogeneousRotationInUVTransform = false;\n this._cachedIdentity3x2 = true;\n this._cachedReflectionTextureMatrix = null;\n this._cachedReflectionUOffset = -1;\n this._cachedReflectionVOffset = -1;\n this._cachedReflectionUScale = 0;\n this._cachedReflectionVScale = 0;\n this._cachedReflectionCoordinatesMode = -1;\n /** @internal */\n this._buffer = null;\n this._deleteBuffer = false;\n this._format = null;\n this._delayedOnLoad = null;\n this._delayedOnError = null;\n /**\n * Observable triggered once the texture has been loaded.\n */\n this.onLoadObservable = new Observable();\n this._isBlocking = true;\n this.name = url || \"\";\n this.url = url;\n let noMipmap;\n let useSRGBBuffer = false;\n let internalTexture = null;\n let gammaSpace = true;\n if (typeof noMipmapOrOptions === \"object\" && noMipmapOrOptions !== null) {\n var _noMipmapOrOptions$no, _noMipmapOrOptions$in, _noMipmapOrOptions$sa, _noMipmapOrOptions$on, _noMipmapOrOptions$on2, _noMipmapOrOptions$bu, _noMipmapOrOptions$de, _noMipmapOrOptions$us, _noMipmapOrOptions$in2, _noMipmapOrOptions$ga, _noMipmapOrOptions$fo;\n noMipmap = (_noMipmapOrOptions$no = noMipmapOrOptions.noMipmap) !== null && _noMipmapOrOptions$no !== void 0 ? _noMipmapOrOptions$no : false;\n invertY = (_noMipmapOrOptions$in = noMipmapOrOptions.invertY) !== null && _noMipmapOrOptions$in !== void 0 ? _noMipmapOrOptions$in : !useOpenGLOrientationForUV;\n samplingMode = (_noMipmapOrOptions$sa = noMipmapOrOptions.samplingMode) !== null && _noMipmapOrOptions$sa !== void 0 ? _noMipmapOrOptions$sa : Texture.TRILINEAR_SAMPLINGMODE;\n onLoad = (_noMipmapOrOptions$on = noMipmapOrOptions.onLoad) !== null && _noMipmapOrOptions$on !== void 0 ? _noMipmapOrOptions$on : null;\n onError = (_noMipmapOrOptions$on2 = noMipmapOrOptions.onError) !== null && _noMipmapOrOptions$on2 !== void 0 ? _noMipmapOrOptions$on2 : null;\n buffer = (_noMipmapOrOptions$bu = noMipmapOrOptions.buffer) !== null && _noMipmapOrOptions$bu !== void 0 ? _noMipmapOrOptions$bu : null;\n deleteBuffer = (_noMipmapOrOptions$de = noMipmapOrOptions.deleteBuffer) !== null && _noMipmapOrOptions$de !== void 0 ? _noMipmapOrOptions$de : false;\n format = noMipmapOrOptions.format;\n mimeType = noMipmapOrOptions.mimeType;\n loaderOptions = noMipmapOrOptions.loaderOptions;\n creationFlags = noMipmapOrOptions.creationFlags;\n useSRGBBuffer = (_noMipmapOrOptions$us = noMipmapOrOptions.useSRGBBuffer) !== null && _noMipmapOrOptions$us !== void 0 ? _noMipmapOrOptions$us : false;\n internalTexture = (_noMipmapOrOptions$in2 = noMipmapOrOptions.internalTexture) !== null && _noMipmapOrOptions$in2 !== void 0 ? _noMipmapOrOptions$in2 : null;\n gammaSpace = (_noMipmapOrOptions$ga = noMipmapOrOptions.gammaSpace) !== null && _noMipmapOrOptions$ga !== void 0 ? _noMipmapOrOptions$ga : gammaSpace;\n forcedExtension = (_noMipmapOrOptions$fo = noMipmapOrOptions.forcedExtension) !== null && _noMipmapOrOptions$fo !== void 0 ? _noMipmapOrOptions$fo : forcedExtension;\n } else {\n noMipmap = !!noMipmapOrOptions;\n }\n this._gammaSpace = gammaSpace;\n this._noMipmap = noMipmap;\n this._invertY = invertY === undefined ? !useOpenGLOrientationForUV : invertY;\n this._initialSamplingMode = samplingMode;\n this._buffer = buffer;\n this._deleteBuffer = deleteBuffer;\n this._mimeType = mimeType;\n this._loaderOptions = loaderOptions;\n this._creationFlags = creationFlags;\n this._useSRGBBuffer = useSRGBBuffer;\n this._forcedExtension = forcedExtension;\n if (format) {\n this._format = format;\n }\n const scene = this.getScene();\n const engine = this._getEngine();\n if (!engine) {\n return;\n }\n engine.onBeforeTextureInitObservable.notifyObservers(this);\n const load = () => {\n if (this._texture) {\n if (this._texture._invertVScale) {\n this.vScale *= -1;\n this.vOffset += 1;\n }\n // Update texture to match internal texture's wrapping\n if (this._texture._cachedWrapU !== null) {\n this.wrapU = this._texture._cachedWrapU;\n this._texture._cachedWrapU = null;\n }\n if (this._texture._cachedWrapV !== null) {\n this.wrapV = this._texture._cachedWrapV;\n this._texture._cachedWrapV = null;\n }\n if (this._texture._cachedWrapR !== null) {\n this.wrapR = this._texture._cachedWrapR;\n this._texture._cachedWrapR = null;\n }\n }\n if (this.onLoadObservable.hasObservers()) {\n this.onLoadObservable.notifyObservers(this);\n }\n if (onLoad) {\n onLoad();\n }\n if (!this.isBlocking && scene) {\n scene.resetCachedMaterial();\n }\n };\n const errorHandler = (message, exception) => {\n this._loadingError = true;\n this._errorObject = {\n message,\n exception\n };\n if (onError) {\n onError(message, exception);\n }\n Texture.OnTextureLoadErrorObservable.notifyObservers(this);\n };\n if (!this.url && !internalTexture) {\n this._delayedOnLoad = load;\n this._delayedOnError = errorHandler;\n return;\n }\n this._texture = (_internalTexture = internalTexture) !== null && _internalTexture !== void 0 ? _internalTexture : this._getFromCache(this.url, noMipmap, samplingMode, this._invertY, useSRGBBuffer, this.isCube);\n if (!this._texture) {\n if (!scene || !scene.useDelayedTextureLoading) {\n try {\n this._texture = engine.createTexture(this.url, noMipmap, this._invertY, scene, samplingMode, load, errorHandler, this._buffer, undefined, this._format, this._forcedExtension, mimeType, loaderOptions, creationFlags, useSRGBBuffer);\n } catch (e) {\n errorHandler(\"error loading\", e);\n throw e;\n }\n if (deleteBuffer) {\n this._buffer = null;\n }\n } else {\n this.delayLoadState = 4;\n this._delayedOnLoad = load;\n this._delayedOnError = errorHandler;\n }\n } else {\n if (this._texture.isReady) {\n TimingTools.SetImmediate(() => load());\n } else {\n const loadObserver = this._texture.onLoadedObservable.add(load);\n this._texture.onErrorObservable.add(e => {\n var _this$_texture;\n errorHandler(e.message, e.exception);\n (_this$_texture = this._texture) === null || _this$_texture === void 0 || _this$_texture.onLoadedObservable.remove(loadObserver);\n });\n }\n }\n }\n /**\n * Update the url (and optional buffer) of this texture if url was null during construction.\n * @param url the url of the texture\n * @param buffer the buffer of the texture (defaults to null)\n * @param onLoad callback called when the texture is loaded (defaults to null)\n * @param forcedExtension defines the extension to use to pick the right loader\n */\n updateURL(url, buffer = null, onLoad, forcedExtension) {\n if (this.url) {\n this.releaseInternalTexture();\n this.getScene().markAllMaterialsAsDirty(1, mat => {\n return mat.hasTexture(this);\n });\n }\n if (!this.name || this.name.startsWith(\"data:\")) {\n this.name = url;\n }\n this.url = url;\n this._buffer = buffer;\n this._forcedExtension = forcedExtension;\n this.delayLoadState = 4;\n if (onLoad) {\n this._delayedOnLoad = onLoad;\n }\n this.delayLoad();\n }\n /**\n * Finish the loading sequence of a texture flagged as delayed load.\n * @internal\n */\n delayLoad() {\n if (this.delayLoadState !== 4) {\n return;\n }\n const scene = this.getScene();\n if (!scene) {\n return;\n }\n this.delayLoadState = 1;\n this._texture = this._getFromCache(this.url, this._noMipmap, this.samplingMode, this._invertY, this._useSRGBBuffer, this.isCube);\n if (!this._texture) {\n this._texture = scene.getEngine().createTexture(this.url, this._noMipmap, this._invertY, scene, this.samplingMode, this._delayedOnLoad, this._delayedOnError, this._buffer, null, this._format, this._forcedExtension, this._mimeType, this._loaderOptions, this._creationFlags, this._useSRGBBuffer);\n if (this._deleteBuffer) {\n this._buffer = null;\n }\n } else {\n if (this._delayedOnLoad) {\n if (this._texture.isReady) {\n TimingTools.SetImmediate(this._delayedOnLoad);\n } else {\n this._texture.onLoadedObservable.add(this._delayedOnLoad);\n }\n }\n }\n this._delayedOnLoad = null;\n this._delayedOnError = null;\n }\n _prepareRowForTextureGeneration(x, y, z, t) {\n x *= this._cachedUScale;\n y *= this._cachedVScale;\n x -= this.uRotationCenter * this._cachedUScale;\n y -= this.vRotationCenter * this._cachedVScale;\n z -= this.wRotationCenter;\n Vector3.TransformCoordinatesFromFloatsToRef(x, y, z, this._rowGenerationMatrix, t);\n t.x += this.uRotationCenter * this._cachedUScale + this._cachedUOffset;\n t.y += this.vRotationCenter * this._cachedVScale + this._cachedVOffset;\n t.z += this.wRotationCenter;\n }\n /**\n * Get the current texture matrix which includes the requested offsetting, tiling and rotation components.\n * @param uBase The horizontal base offset multiplier (1 by default)\n * @returns the transform matrix of the texture.\n */\n getTextureMatrix(uBase = 1) {\n if (this.uOffset === this._cachedUOffset && this.vOffset === this._cachedVOffset && this.uScale * uBase === this._cachedUScale && this.vScale === this._cachedVScale && this.uAng === this._cachedUAng && this.vAng === this._cachedVAng && this.wAng === this._cachedWAng && this.uRotationCenter === this._cachedURotationCenter && this.vRotationCenter === this._cachedVRotationCenter && this.wRotationCenter === this._cachedWRotationCenter && this.homogeneousRotationInUVTransform === this._cachedHomogeneousRotationInUVTransform) {\n return this._cachedTextureMatrix;\n }\n this._cachedUOffset = this.uOffset;\n this._cachedVOffset = this.vOffset;\n this._cachedUScale = this.uScale * uBase;\n this._cachedVScale = this.vScale;\n this._cachedUAng = this.uAng;\n this._cachedVAng = this.vAng;\n this._cachedWAng = this.wAng;\n this._cachedURotationCenter = this.uRotationCenter;\n this._cachedVRotationCenter = this.vRotationCenter;\n this._cachedWRotationCenter = this.wRotationCenter;\n this._cachedHomogeneousRotationInUVTransform = this.homogeneousRotationInUVTransform;\n if (!this._cachedTextureMatrix || !this._rowGenerationMatrix) {\n this._cachedTextureMatrix = Matrix.Zero();\n this._rowGenerationMatrix = new Matrix();\n this._t0 = Vector3.Zero();\n this._t1 = Vector3.Zero();\n this._t2 = Vector3.Zero();\n }\n Matrix.RotationYawPitchRollToRef(this.vAng, this.uAng, this.wAng, this._rowGenerationMatrix);\n if (this.homogeneousRotationInUVTransform) {\n Matrix.TranslationToRef(-this._cachedURotationCenter, -this._cachedVRotationCenter, -this._cachedWRotationCenter, TmpVectors.Matrix[0]);\n Matrix.TranslationToRef(this._cachedURotationCenter, this._cachedVRotationCenter, this._cachedWRotationCenter, TmpVectors.Matrix[1]);\n Matrix.ScalingToRef(this._cachedUScale, this._cachedVScale, 0, TmpVectors.Matrix[2]);\n Matrix.TranslationToRef(this._cachedUOffset, this._cachedVOffset, 0, TmpVectors.Matrix[3]);\n TmpVectors.Matrix[0].multiplyToRef(this._rowGenerationMatrix, this._cachedTextureMatrix);\n this._cachedTextureMatrix.multiplyToRef(TmpVectors.Matrix[1], this._cachedTextureMatrix);\n this._cachedTextureMatrix.multiplyToRef(TmpVectors.Matrix[2], this._cachedTextureMatrix);\n this._cachedTextureMatrix.multiplyToRef(TmpVectors.Matrix[3], this._cachedTextureMatrix);\n // copy the translation row to the 3rd row of the matrix so that we don't need to update the shaders (which expects the translation to be on the 3rd row)\n this._cachedTextureMatrix.setRowFromFloats(2, this._cachedTextureMatrix.m[12], this._cachedTextureMatrix.m[13], this._cachedTextureMatrix.m[14], 1);\n } else {\n this._prepareRowForTextureGeneration(0, 0, 0, this._t0);\n this._prepareRowForTextureGeneration(1.0, 0, 0, this._t1);\n this._prepareRowForTextureGeneration(0, 1.0, 0, this._t2);\n this._t1.subtractInPlace(this._t0);\n this._t2.subtractInPlace(this._t0);\n Matrix.FromValuesToRef(this._t1.x, this._t1.y, this._t1.z, 0.0, this._t2.x, this._t2.y, this._t2.z, 0.0, this._t0.x, this._t0.y, this._t0.z, 0.0, 0.0, 0.0, 0.0, 1.0, this._cachedTextureMatrix);\n }\n const scene = this.getScene();\n if (!scene) {\n return this._cachedTextureMatrix;\n }\n const previousIdentity3x2 = this._cachedIdentity3x2;\n this._cachedIdentity3x2 = this._cachedTextureMatrix.isIdentityAs3x2();\n if (this.optimizeUVAllocation && previousIdentity3x2 !== this._cachedIdentity3x2) {\n // We flag the materials that are using this texture as \"texture dirty\" because depending on the fact that the matrix is the identity or not, some defines\n // will get different values (see PrepareDefinesForMergedUV), meaning we should regenerate the effect accordingly\n scene.markAllMaterialsAsDirty(1, mat => {\n return mat.hasTexture(this);\n });\n }\n return this._cachedTextureMatrix;\n }\n /**\n * Get the current matrix used to apply reflection. This is useful to rotate an environment texture for instance.\n * @returns The reflection texture transform\n */\n getReflectionTextureMatrix() {\n const scene = this.getScene();\n if (!scene) {\n return this._cachedReflectionTextureMatrix;\n }\n if (this.uOffset === this._cachedReflectionUOffset && this.vOffset === this._cachedReflectionVOffset && this.uScale === this._cachedReflectionUScale && this.vScale === this._cachedReflectionVScale && this.coordinatesMode === this._cachedReflectionCoordinatesMode) {\n if (this.coordinatesMode === Texture.PROJECTION_MODE) {\n if (this._cachedReflectionProjectionMatrixId === scene.getProjectionMatrix().updateFlag) {\n return this._cachedReflectionTextureMatrix;\n }\n } else {\n return this._cachedReflectionTextureMatrix;\n }\n }\n if (!this._cachedReflectionTextureMatrix) {\n this._cachedReflectionTextureMatrix = Matrix.Zero();\n }\n if (!this._projectionModeMatrix) {\n this._projectionModeMatrix = Matrix.Zero();\n }\n const flagMaterialsAsTextureDirty = this._cachedReflectionCoordinatesMode !== this.coordinatesMode;\n this._cachedReflectionUOffset = this.uOffset;\n this._cachedReflectionVOffset = this.vOffset;\n this._cachedReflectionUScale = this.uScale;\n this._cachedReflectionVScale = this.vScale;\n this._cachedReflectionCoordinatesMode = this.coordinatesMode;\n switch (this.coordinatesMode) {\n case Texture.PLANAR_MODE:\n {\n Matrix.IdentityToRef(this._cachedReflectionTextureMatrix);\n this._cachedReflectionTextureMatrix[0] = this.uScale;\n this._cachedReflectionTextureMatrix[5] = this.vScale;\n this._cachedReflectionTextureMatrix[12] = this.uOffset;\n this._cachedReflectionTextureMatrix[13] = this.vOffset;\n break;\n }\n case Texture.PROJECTION_MODE:\n {\n Matrix.FromValuesToRef(0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 1.0, 1.0, this._projectionModeMatrix);\n const projectionMatrix = scene.getProjectionMatrix();\n this._cachedReflectionProjectionMatrixId = projectionMatrix.updateFlag;\n projectionMatrix.multiplyToRef(this._projectionModeMatrix, this._cachedReflectionTextureMatrix);\n break;\n }\n default:\n Matrix.IdentityToRef(this._cachedReflectionTextureMatrix);\n break;\n }\n if (flagMaterialsAsTextureDirty) {\n // We flag the materials that are using this texture as \"texture dirty\" if the coordinatesMode has changed.\n // Indeed, this property is used to set the value of some defines used to generate the effect (in material.isReadyForSubMesh), so we must make sure this code will be re-executed and the effect recreated if necessary\n scene.markAllMaterialsAsDirty(1, mat => {\n return mat.hasTexture(this);\n });\n }\n return this._cachedReflectionTextureMatrix;\n }\n /**\n * Clones the texture.\n * @returns the cloned texture\n */\n clone() {\n const options = {\n noMipmap: this._noMipmap,\n invertY: this._invertY,\n samplingMode: this.samplingMode,\n onLoad: undefined,\n onError: undefined,\n buffer: this._texture ? this._texture._buffer : undefined,\n deleteBuffer: this._deleteBuffer,\n format: this.textureFormat,\n mimeType: this.mimeType,\n loaderOptions: this._loaderOptions,\n creationFlags: this._creationFlags,\n useSRGBBuffer: this._useSRGBBuffer\n };\n return SerializationHelper.Clone(() => {\n return new Texture(this._texture ? this._texture.url : null, this.getScene(), options);\n }, this);\n }\n /**\n * Serialize the texture to a JSON representation we can easily use in the respective Parse function.\n * @returns The JSON representation of the texture\n */\n serialize() {\n var _this$_texture3;\n const savedName = this.name;\n if (!Texture.SerializeBuffers) {\n if (this.name.startsWith(\"data:\")) {\n this.name = \"\";\n }\n }\n if (this.name.startsWith(\"data:\") && this.url === this.name) {\n this.url = \"\";\n }\n const serializationObject = super.serialize(Texture._SerializeInternalTextureUniqueId);\n if (!serializationObject) {\n return null;\n }\n if (Texture.SerializeBuffers || Texture.ForceSerializeBuffers) {\n if (typeof this._buffer === \"string\" && this._buffer.substring(0, 5) === \"data:\") {\n serializationObject.base64String = this._buffer;\n serializationObject.name = serializationObject.name.replace(\"data:\", \"\");\n } else if (this.url && this.url.startsWith(\"data:\") && this._buffer instanceof Uint8Array) {\n serializationObject.base64String = \"data:image/png;base64,\" + EncodeArrayBufferToBase64(this._buffer);\n } else if (Texture.ForceSerializeBuffers || this.url && this.url.startsWith(\"blob:\") || this._forceSerialize) {\n serializationObject.base64String = !this._engine || this._engine._features.supportSyncTextureRead ? GenerateBase64StringFromTexture(this) : GenerateBase64StringFromTextureAsync(this);\n }\n }\n serializationObject.invertY = this._invertY;\n serializationObject.samplingMode = this.samplingMode;\n serializationObject._creationFlags = this._creationFlags;\n serializationObject._useSRGBBuffer = this._useSRGBBuffer;\n if (Texture._SerializeInternalTextureUniqueId) {\n var _this$_texture2;\n serializationObject.internalTextureUniqueId = (_this$_texture2 = this._texture) === null || _this$_texture2 === void 0 ? void 0 : _this$_texture2.uniqueId;\n }\n serializationObject.internalTextureLabel = (_this$_texture3 = this._texture) === null || _this$_texture3 === void 0 ? void 0 : _this$_texture3.label;\n serializationObject.noMipmap = this._noMipmap;\n this.name = savedName;\n return serializationObject;\n }\n /**\n * Get the current class name of the texture useful for serialization or dynamic coding.\n * @returns \"Texture\"\n */\n getClassName() {\n return \"Texture\";\n }\n /**\n * Dispose the texture and release its associated resources.\n */\n dispose() {\n super.dispose();\n this.onLoadObservable.clear();\n this._delayedOnLoad = null;\n this._delayedOnError = null;\n this._buffer = null;\n }\n /**\n * Parse the JSON representation of a texture in order to recreate the texture in the given scene.\n * @param parsedTexture Define the JSON representation of the texture\n * @param scene Define the scene the parsed texture should be instantiated in\n * @param rootUrl Define the root url of the parsing sequence in the case of relative dependencies\n * @returns The parsed texture if successful\n */\n static Parse(parsedTexture, scene, rootUrl) {\n if (parsedTexture.customType) {\n const customTexture = InstantiationTools.Instantiate(parsedTexture.customType);\n // Update Sampling Mode\n const parsedCustomTexture = customTexture.Parse(parsedTexture, scene, rootUrl);\n if (parsedTexture.samplingMode && parsedCustomTexture.updateSamplingMode && parsedCustomTexture._samplingMode) {\n if (parsedCustomTexture._samplingMode !== parsedTexture.samplingMode) {\n parsedCustomTexture.updateSamplingMode(parsedTexture.samplingMode);\n }\n }\n return parsedCustomTexture;\n }\n if (parsedTexture.isCube && !parsedTexture.isRenderTarget) {\n return Texture._CubeTextureParser(parsedTexture, scene, rootUrl);\n }\n const hasInternalTextureUniqueId = parsedTexture.internalTextureUniqueId !== undefined;\n if (!parsedTexture.name && !parsedTexture.isRenderTarget && !hasInternalTextureUniqueId) {\n return null;\n }\n let internalTexture;\n if (hasInternalTextureUniqueId) {\n const cache = scene.getEngine().getLoadedTexturesCache();\n for (const texture of cache) {\n if (texture.uniqueId === parsedTexture.internalTextureUniqueId) {\n internalTexture = texture;\n break;\n }\n }\n }\n const onLoaded = texture => {\n // Clear cache\n if (texture && texture._texture) {\n texture._texture._cachedWrapU = null;\n texture._texture._cachedWrapV = null;\n texture._texture._cachedWrapR = null;\n }\n // Update Sampling Mode\n if (parsedTexture.samplingMode) {\n const sampling = parsedTexture.samplingMode;\n if (texture && texture.samplingMode !== sampling) {\n texture.updateSamplingMode(sampling);\n }\n }\n // Animations\n if (texture && parsedTexture.animations) {\n for (let animationIndex = 0; animationIndex < parsedTexture.animations.length; animationIndex++) {\n const parsedAnimation = parsedTexture.animations[animationIndex];\n const internalClass = GetClass(\"BABYLON.Animation\");\n if (internalClass) {\n texture.animations.push(internalClass.Parse(parsedAnimation));\n }\n }\n }\n if (texture && texture._texture) {\n if (hasInternalTextureUniqueId && !internalTexture) {\n texture._texture._setUniqueId(parsedTexture.internalTextureUniqueId);\n }\n texture._texture.label = parsedTexture.internalTextureLabel;\n }\n };\n const texture = SerializationHelper.Parse(() => {\n let generateMipMaps = true;\n if (parsedTexture.noMipmap) {\n generateMipMaps = false;\n }\n if (parsedTexture.mirrorPlane) {\n const mirrorTexture = Texture._CreateMirror(parsedTexture.name, parsedTexture.renderTargetSize, scene, generateMipMaps);\n mirrorTexture._waitingRenderList = parsedTexture.renderList;\n mirrorTexture.mirrorPlane = Plane.FromArray(parsedTexture.mirrorPlane);\n onLoaded(mirrorTexture);\n return mirrorTexture;\n } else if (parsedTexture.isRenderTarget) {\n let renderTargetTexture = null;\n if (parsedTexture.isCube) {\n // Search for an existing reflection probe (which contains a cube render target texture)\n if (scene.reflectionProbes) {\n for (let index = 0; index < scene.reflectionProbes.length; index++) {\n const probe = scene.reflectionProbes[index];\n if (probe.name === parsedTexture.name) {\n return probe.cubeTexture;\n }\n }\n }\n } else {\n var _parsedTexture$_creat;\n renderTargetTexture = Texture._CreateRenderTargetTexture(parsedTexture.name, parsedTexture.renderTargetSize, scene, generateMipMaps, (_parsedTexture$_creat = parsedTexture._creationFlags) !== null && _parsedTexture$_creat !== void 0 ? _parsedTexture$_creat : 0);\n renderTargetTexture._waitingRenderList = parsedTexture.renderList;\n }\n onLoaded(renderTargetTexture);\n return renderTargetTexture;\n } else if (parsedTexture.isVideo) {\n const texture = Texture._CreateVideoTexture(rootUrl + (parsedTexture.url || parsedTexture.name), rootUrl + (parsedTexture.src || parsedTexture.url), scene, generateMipMaps, parsedTexture.invertY, parsedTexture.samplingMode, parsedTexture.settings || {});\n onLoaded(texture);\n return texture;\n } else {\n let texture;\n if (parsedTexture.base64String && !internalTexture) {\n var _parsedTexture$_creat2, _parsedTexture$_useSR;\n // name and url are the same to ensure caching happens from the actual base64 string\n texture = Texture.CreateFromBase64String(parsedTexture.base64String, parsedTexture.base64String, scene, !generateMipMaps, parsedTexture.invertY, parsedTexture.samplingMode, () => {\n onLoaded(texture);\n }, (_parsedTexture$_creat2 = parsedTexture._creationFlags) !== null && _parsedTexture$_creat2 !== void 0 ? _parsedTexture$_creat2 : 0, (_parsedTexture$_useSR = parsedTexture._useSRGBBuffer) !== null && _parsedTexture$_useSR !== void 0 ? _parsedTexture$_useSR : false);\n // prettier name to fit with the loaded data\n texture.name = parsedTexture.name;\n } else {\n let url;\n if (parsedTexture.name && (parsedTexture.name.indexOf(\"://\") > 0 || parsedTexture.name.startsWith(\"data:\"))) {\n url = parsedTexture.name;\n } else {\n url = rootUrl + parsedTexture.name;\n }\n if (parsedTexture.url && (parsedTexture.url.startsWith(\"data:\") || Texture.UseSerializedUrlIfAny)) {\n url = parsedTexture.url;\n }\n const options = {\n noMipmap: !generateMipMaps,\n invertY: parsedTexture.invertY,\n samplingMode: parsedTexture.samplingMode,\n onLoad: () => {\n onLoaded(texture);\n },\n internalTexture\n };\n texture = new Texture(url, scene, options);\n }\n return texture;\n }\n }, parsedTexture, scene);\n return texture;\n }\n /**\n * Creates a texture from its base 64 representation.\n * @param data Define the base64 payload without the data: prefix\n * @param name Define the name of the texture in the scene useful fo caching purpose for instance\n * @param scene Define the scene the texture should belong to\n * @param noMipmapOrOptions defines if the texture will require mip maps or not or set of all options to create the texture\n * @param invertY define if the texture needs to be inverted on the y axis during loading\n * @param samplingMode define the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...)\n * @param onLoad define a callback triggered when the texture has been loaded\n * @param onError define a callback triggered when an error occurred during the loading session\n * @param format define the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)\n * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)\n * @param forcedExtension defines the extension to use to pick the right loader\n * @returns the created texture\n */\n static CreateFromBase64String(data, name, scene, noMipmapOrOptions, invertY, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, onLoad = null, onError = null, format = 5, creationFlags, forcedExtension) {\n return new Texture(\"data:\" + name, scene, noMipmapOrOptions, invertY, samplingMode, onLoad, onError, data, false, format, undefined, undefined, creationFlags, forcedExtension);\n }\n /**\n * Creates a texture from its data: representation. (data: will be added in case only the payload has been passed in)\n * @param name Define the name of the texture in the scene useful fo caching purpose for instance\n * @param buffer define the buffer to load the texture from in case the texture is loaded from a buffer representation\n * @param scene Define the scene the texture should belong to\n * @param deleteBuffer define if the buffer we are loading the texture from should be deleted after load\n * @param noMipmapOrOptions defines if the texture will require mip maps or not or set of all options to create the texture\n * @param invertY define if the texture needs to be inverted on the y axis during loading\n * @param samplingMode define the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...)\n * @param onLoad define a callback triggered when the texture has been loaded\n * @param onError define a callback triggered when an error occurred during the loading session\n * @param format define the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)\n * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)\n * @param forcedExtension defines the extension to use to pick the right loader\n * @returns the created texture\n */\n static LoadFromDataString(name, buffer, scene, deleteBuffer = false, noMipmapOrOptions, invertY = true, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, onLoad = null, onError = null, format = 5, creationFlags, forcedExtension) {\n if (name.substring(0, 5) !== \"data:\") {\n name = \"data:\" + name;\n }\n return new Texture(name, scene, noMipmapOrOptions, invertY, samplingMode, onLoad, onError, buffer, deleteBuffer, format, undefined, undefined, creationFlags, forcedExtension);\n }\n}\n/**\n * Gets or sets a general boolean used to indicate that textures containing direct data (buffers) must be saved as part of the serialization process\n */\nTexture.SerializeBuffers = true;\n/**\n * Gets or sets a general boolean used to indicate that texture buffers must be saved as part of the serialization process.\n * If no buffer exists, one will be created as base64 string from the internal webgl data.\n */\nTexture.ForceSerializeBuffers = false;\n/**\n * This observable will notify when any texture had a loading error\n */\nTexture.OnTextureLoadErrorObservable = new Observable();\n/** @internal */\nTexture._SerializeInternalTextureUniqueId = false;\n/**\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nTexture._CubeTextureParser = (jsonTexture, scene, rootUrl) => {\n throw _WarnImport(\"CubeTexture\");\n};\n/**\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nTexture._CreateMirror = (name, renderTargetSize, scene, generateMipMaps) => {\n throw _WarnImport(\"MirrorTexture\");\n};\n/**\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nTexture._CreateRenderTargetTexture = (name, renderTargetSize, scene, generateMipMaps, creationFlags) => {\n throw _WarnImport(\"RenderTargetTexture\");\n};\n/** nearest is mag = nearest and min = nearest and no mip */\nTexture.NEAREST_SAMPLINGMODE = 1;\n/** nearest is mag = nearest and min = nearest and mip = linear */\nTexture.NEAREST_NEAREST_MIPLINEAR = 8; // nearest is mag = nearest and min = nearest and mip = linear\n/** Bilinear is mag = linear and min = linear and no mip */\nTexture.BILINEAR_SAMPLINGMODE = 2;\n/** Bilinear is mag = linear and min = linear and mip = nearest */\nTexture.LINEAR_LINEAR_MIPNEAREST = 11; // Bilinear is mag = linear and min = linear and mip = nearest\n/** Trilinear is mag = linear and min = linear and mip = linear */\nTexture.TRILINEAR_SAMPLINGMODE = 3;\n/** Trilinear is mag = linear and min = linear and mip = linear */\nTexture.LINEAR_LINEAR_MIPLINEAR = 3; // Trilinear is mag = linear and min = linear and mip = linear\n/** mag = nearest and min = nearest and mip = nearest */\nTexture.NEAREST_NEAREST_MIPNEAREST = 4;\n/** mag = nearest and min = linear and mip = nearest */\nTexture.NEAREST_LINEAR_MIPNEAREST = 5;\n/** mag = nearest and min = linear and mip = linear */\nTexture.NEAREST_LINEAR_MIPLINEAR = 6;\n/** mag = nearest and min = linear and mip = none */\nTexture.NEAREST_LINEAR = 7;\n/** mag = nearest and min = nearest and mip = none */\nTexture.NEAREST_NEAREST = 1;\n/** mag = linear and min = nearest and mip = nearest */\nTexture.LINEAR_NEAREST_MIPNEAREST = 9;\n/** mag = linear and min = nearest and mip = linear */\nTexture.LINEAR_NEAREST_MIPLINEAR = 10;\n/** mag = linear and min = linear and mip = none */\nTexture.LINEAR_LINEAR = 2;\n/** mag = linear and min = nearest and mip = none */\nTexture.LINEAR_NEAREST = 12;\n/** Explicit coordinates mode */\nTexture.EXPLICIT_MODE = 0;\n/** Spherical coordinates mode */\nTexture.SPHERICAL_MODE = 1;\n/** Planar coordinates mode */\nTexture.PLANAR_MODE = 2;\n/** Cubic coordinates mode */\nTexture.CUBIC_MODE = 3;\n/** Projection coordinates mode */\nTexture.PROJECTION_MODE = 4;\n/** Inverse Cubic coordinates mode */\nTexture.SKYBOX_MODE = 5;\n/** Inverse Cubic coordinates mode */\nTexture.INVCUBIC_MODE = 6;\n/** Equirectangular coordinates mode */\nTexture.EQUIRECTANGULAR_MODE = 7;\n/** Equirectangular Fixed coordinates mode */\nTexture.FIXED_EQUIRECTANGULAR_MODE = 8;\n/** Equirectangular Fixed Mirrored coordinates mode */\nTexture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9;\n/** Texture is not repeating outside of 0..1 UVs */\nTexture.CLAMP_ADDRESSMODE = 0;\n/** Texture is repeating outside of 0..1 UVs */\nTexture.WRAP_ADDRESSMODE = 1;\n/** Texture is repeating and mirrored */\nTexture.MIRROR_ADDRESSMODE = 2;\n/**\n * Gets or sets a boolean which defines if the texture url must be build from the serialized URL instead of just using the name and loading them side by side with the scene file\n */\nTexture.UseSerializedUrlIfAny = false;\n__decorate([serialize()], Texture.prototype, \"url\", void 0);\n__decorate([serialize()], Texture.prototype, \"uOffset\", void 0);\n__decorate([serialize()], Texture.prototype, \"vOffset\", void 0);\n__decorate([serialize()], Texture.prototype, \"uScale\", void 0);\n__decorate([serialize()], Texture.prototype, \"vScale\", void 0);\n__decorate([serialize()], Texture.prototype, \"uAng\", void 0);\n__decorate([serialize()], Texture.prototype, \"vAng\", void 0);\n__decorate([serialize()], Texture.prototype, \"wAng\", void 0);\n__decorate([serialize()], Texture.prototype, \"uRotationCenter\", void 0);\n__decorate([serialize()], Texture.prototype, \"vRotationCenter\", void 0);\n__decorate([serialize()], Texture.prototype, \"wRotationCenter\", void 0);\n__decorate([serialize()], Texture.prototype, \"homogeneousRotationInUVTransform\", void 0);\n__decorate([serialize()], Texture.prototype, \"isBlocking\", null);\n// References the dependencies.\nRegisterClass(\"BABYLON.Texture\", Texture);\nSerializationHelper._TextureParser = Texture.Parse;","map":{"version":3,"names":["__decorate","serialize","Observable","Matrix","TmpVectors","Vector3","BaseTexture","GetClass","RegisterClass","_WarnImport","TimingTools","InstantiationTools","Plane","EncodeArrayBufferToBase64","GenerateBase64StringFromTexture","GenerateBase64StringFromTextureAsync","useOpenGLOrientationForUV","SerializationHelper","Texture","_CreateVideoTexture","name","src","scene","generateMipMaps","invertY","samplingMode","TRILINEAR_SAMPLINGMODE","settings","onError","format","noMipmap","_noMipmap","mimeType","_mimeType","isBlocking","value","_isBlocking","_invertY","constructor","url","sceneOrEngine","noMipmapOrOptions","onLoad","buffer","deleteBuffer","loaderOptions","creationFlags","forcedExtension","_internalTexture","uOffset","vOffset","uScale","vScale","uAng","vAng","wAng","uRotationCenter","vRotationCenter","wRotationCenter","homogeneousRotationInUVTransform","inspectableCustomProperties","_rowGenerationMatrix","_cachedTextureMatrix","_projectionModeMatrix","_t0","_t1","_t2","_cachedUOffset","_cachedVOffset","_cachedUScale","_cachedVScale","_cachedUAng","_cachedVAng","_cachedWAng","_cachedReflectionProjectionMatrixId","_cachedURotationCenter","_cachedVRotationCenter","_cachedWRotationCenter","_cachedHomogeneousRotationInUVTransform","_cachedIdentity3x2","_cachedReflectionTextureMatrix","_cachedReflectionUOffset","_cachedReflectionVOffset","_cachedReflectionUScale","_cachedReflectionVScale","_cachedReflectionCoordinatesMode","_buffer","_deleteBuffer","_format","_delayedOnLoad","_delayedOnError","onLoadObservable","useSRGBBuffer","internalTexture","gammaSpace","_noMipmapOrOptions$no","_noMipmapOrOptions$in","_noMipmapOrOptions$sa","_noMipmapOrOptions$on","_noMipmapOrOptions$on2","_noMipmapOrOptions$bu","_noMipmapOrOptions$de","_noMipmapOrOptions$us","_noMipmapOrOptions$in2","_noMipmapOrOptions$ga","_noMipmapOrOptions$fo","_gammaSpace","undefined","_initialSamplingMode","_loaderOptions","_creationFlags","_useSRGBBuffer","_forcedExtension","getScene","engine","_getEngine","onBeforeTextureInitObservable","notifyObservers","load","_texture","_invertVScale","_cachedWrapU","wrapU","_cachedWrapV","wrapV","_cachedWrapR","wrapR","hasObservers","resetCachedMaterial","errorHandler","message","exception","_loadingError","_errorObject","OnTextureLoadErrorObservable","_getFromCache","isCube","useDelayedTextureLoading","createTexture","e","delayLoadState","isReady","SetImmediate","loadObserver","onLoadedObservable","add","onErrorObservable","_this$_texture","remove","updateURL","releaseInternalTexture","markAllMaterialsAsDirty","mat","hasTexture","startsWith","delayLoad","getEngine","_prepareRowForTextureGeneration","x","y","z","t","TransformCoordinatesFromFloatsToRef","getTextureMatrix","uBase","Zero","RotationYawPitchRollToRef","TranslationToRef","ScalingToRef","multiplyToRef","setRowFromFloats","m","subtractInPlace","FromValuesToRef","previousIdentity3x2","isIdentityAs3x2","optimizeUVAllocation","getReflectionTextureMatrix","coordinatesMode","PROJECTION_MODE","getProjectionMatrix","updateFlag","flagMaterialsAsTextureDirty","PLANAR_MODE","IdentityToRef","projectionMatrix","clone","options","textureFormat","Clone","_this$_texture3","savedName","SerializeBuffers","serializationObject","_SerializeInternalTextureUniqueId","ForceSerializeBuffers","substring","base64String","replace","Uint8Array","_forceSerialize","_engine","_features","supportSyncTextureRead","_this$_texture2","internalTextureUniqueId","uniqueId","internalTextureLabel","label","getClassName","dispose","clear","Parse","parsedTexture","rootUrl","customType","customTexture","Instantiate","parsedCustomTexture","updateSamplingMode","_samplingMode","isRenderTarget","_CubeTextureParser","hasInternalTextureUniqueId","cache","getLoadedTexturesCache","texture","onLoaded","sampling","animations","animationIndex","length","parsedAnimation","internalClass","push","_setUniqueId","mirrorPlane","mirrorTexture","_CreateMirror","renderTargetSize","_waitingRenderList","renderList","FromArray","renderTargetTexture","reflectionProbes","index","probe","cubeTexture","_parsedTexture$_creat","_CreateRenderTargetTexture","isVideo","_parsedTexture$_creat2","_parsedTexture$_useSR","CreateFromBase64String","indexOf","UseSerializedUrlIfAny","data","LoadFromDataString","jsonTexture","NEAREST_SAMPLINGMODE","NEAREST_NEAREST_MIPLINEAR","BILINEAR_SAMPLINGMODE","LINEAR_LINEAR_MIPNEAREST","LINEAR_LINEAR_MIPLINEAR","NEAREST_NEAREST_MIPNEAREST","NEAREST_LINEAR_MIPNEAREST","NEAREST_LINEAR_MIPLINEAR","NEAREST_LINEAR","NEAREST_NEAREST","LINEAR_NEAREST_MIPNEAREST","LINEAR_NEAREST_MIPLINEAR","LINEAR_LINEAR","LINEAR_NEAREST","EXPLICIT_MODE","SPHERICAL_MODE","CUBIC_MODE","SKYBOX_MODE","INVCUBIC_MODE","EQUIRECTANGULAR_MODE","FIXED_EQUIRECTANGULAR_MODE","FIXED_EQUIRECTANGULAR_MIRRORED_MODE","CLAMP_ADDRESSMODE","WRAP_ADDRESSMODE","MIRROR_ADDRESSMODE","prototype","_TextureParser"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Materials/Textures/texture.js"],"sourcesContent":["import { __decorate } from \"../../tslib.es6.js\";\nimport { serialize } from \"../../Misc/decorators.js\";\nimport { Observable } from \"../../Misc/observable.js\";\nimport { Matrix, TmpVectors, Vector3 } from \"../../Maths/math.vector.js\";\nimport { BaseTexture } from \"../../Materials/Textures/baseTexture.js\";\n\nimport { GetClass, RegisterClass } from \"../../Misc/typeStore.js\";\nimport { _WarnImport } from \"../../Misc/devTools.js\";\nimport { TimingTools } from \"../../Misc/timingTools.js\";\nimport { InstantiationTools } from \"../../Misc/instantiationTools.js\";\nimport { Plane } from \"../../Maths/math.plane.js\";\nimport { EncodeArrayBufferToBase64 } from \"../../Misc/stringTools.js\";\nimport { GenerateBase64StringFromTexture, GenerateBase64StringFromTextureAsync } from \"../../Misc/copyTools.js\";\nimport { useOpenGLOrientationForUV } from \"../../Compat/compatibilityOptions.js\";\nimport { SerializationHelper } from \"../../Misc/decorators.serialization.js\";\n/**\n * This represents a texture in babylon. It can be easily loaded from a network, base64 or html input.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction#texture\n */\nexport class Texture extends BaseTexture {\n /**\n * @internal\n */\n static _CreateVideoTexture(name, src, scene, generateMipMaps = false, invertY = false, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, settings = {}, onError, format = 5) {\n throw _WarnImport(\"VideoTexture\");\n }\n /**\n * Are mip maps generated for this texture or not.\n */\n get noMipmap() {\n return this._noMipmap;\n }\n /** Returns the texture mime type if it was defined by a loader (undefined else) */\n get mimeType() {\n return this._mimeType;\n }\n /**\n * Is the texture preventing material to render while loading.\n * If false, a default texture will be used instead of the loading one during the preparation step.\n */\n set isBlocking(value) {\n this._isBlocking = value;\n }\n get isBlocking() {\n return this._isBlocking;\n }\n /**\n * Gets a boolean indicating if the texture needs to be inverted on the y axis during loading\n */\n get invertY() {\n return this._invertY;\n }\n /**\n * Instantiates a new texture.\n * This represents a texture in babylon. It can be easily loaded from a network, base64 or html input.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction#texture\n * @param url defines the url of the picture to load as a texture\n * @param sceneOrEngine defines the scene or engine the texture will belong to\n * @param noMipmapOrOptions defines if the texture will require mip maps or not or set of all options to create the texture\n * @param invertY defines if the texture needs to be inverted on the y axis during loading\n * @param samplingMode defines the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...)\n * @param onLoad defines a callback triggered when the texture has been loaded\n * @param onError defines a callback triggered when an error occurred during the loading session\n * @param buffer defines the buffer to load the texture from in case the texture is loaded from a buffer representation\n * @param deleteBuffer defines if the buffer we are loading the texture from should be deleted after load\n * @param format defines the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)\n * @param mimeType defines an optional mime type information\n * @param loaderOptions options to be passed to the loader\n * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)\n * @param forcedExtension defines the extension to use to pick the right loader\n */\n constructor(url, sceneOrEngine, noMipmapOrOptions, invertY, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, onLoad = null, onError = null, buffer = null, deleteBuffer = false, format, mimeType, loaderOptions, creationFlags, forcedExtension) {\n super(sceneOrEngine);\n /**\n * Define the url of the texture.\n */\n this.url = null;\n /**\n * Define an offset on the texture to offset the u coordinates of the UVs\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#offsetting\n */\n this.uOffset = 0;\n /**\n * Define an offset on the texture to offset the v coordinates of the UVs\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#offsetting\n */\n this.vOffset = 0;\n /**\n * Define an offset on the texture to scale the u coordinates of the UVs\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#tiling\n */\n this.uScale = 1.0;\n /**\n * Define an offset on the texture to scale the v coordinates of the UVs\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#tiling\n */\n this.vScale = 1.0;\n /**\n * Define an offset on the texture to rotate around the u coordinates of the UVs\n * The angle is defined in radians.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials\n */\n this.uAng = 0;\n /**\n * Define an offset on the texture to rotate around the v coordinates of the UVs\n * The angle is defined in radians.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials\n */\n this.vAng = 0;\n /**\n * Define an offset on the texture to rotate around the w coordinates of the UVs (in case of 3d texture)\n * The angle is defined in radians.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials\n */\n this.wAng = 0;\n /**\n * Defines the center of rotation (U)\n */\n this.uRotationCenter = 0.5;\n /**\n * Defines the center of rotation (V)\n */\n this.vRotationCenter = 0.5;\n /**\n * Defines the center of rotation (W)\n */\n this.wRotationCenter = 0.5;\n /**\n * Sets this property to true to avoid deformations when rotating the texture with non-uniform scaling\n */\n this.homogeneousRotationInUVTransform = false;\n /**\n * List of inspectable custom properties (used by the Inspector)\n * @see https://doc.babylonjs.com/toolsAndResources/inspector#extensibility\n */\n this.inspectableCustomProperties = null;\n /** @internal */\n this._noMipmap = false;\n /** @internal */\n this._invertY = false;\n this._rowGenerationMatrix = null;\n this._cachedTextureMatrix = null;\n this._projectionModeMatrix = null;\n this._t0 = null;\n this._t1 = null;\n this._t2 = null;\n this._cachedUOffset = -1;\n this._cachedVOffset = -1;\n this._cachedUScale = 0;\n this._cachedVScale = 0;\n this._cachedUAng = -1;\n this._cachedVAng = -1;\n this._cachedWAng = -1;\n this._cachedReflectionProjectionMatrixId = -1;\n this._cachedURotationCenter = -1;\n this._cachedVRotationCenter = -1;\n this._cachedWRotationCenter = -1;\n this._cachedHomogeneousRotationInUVTransform = false;\n this._cachedIdentity3x2 = true;\n this._cachedReflectionTextureMatrix = null;\n this._cachedReflectionUOffset = -1;\n this._cachedReflectionVOffset = -1;\n this._cachedReflectionUScale = 0;\n this._cachedReflectionVScale = 0;\n this._cachedReflectionCoordinatesMode = -1;\n /** @internal */\n this._buffer = null;\n this._deleteBuffer = false;\n this._format = null;\n this._delayedOnLoad = null;\n this._delayedOnError = null;\n /**\n * Observable triggered once the texture has been loaded.\n */\n this.onLoadObservable = new Observable();\n this._isBlocking = true;\n this.name = url || \"\";\n this.url = url;\n let noMipmap;\n let useSRGBBuffer = false;\n let internalTexture = null;\n let gammaSpace = true;\n if (typeof noMipmapOrOptions === \"object\" && noMipmapOrOptions !== null) {\n noMipmap = noMipmapOrOptions.noMipmap ?? false;\n invertY = noMipmapOrOptions.invertY ?? !useOpenGLOrientationForUV;\n samplingMode = noMipmapOrOptions.samplingMode ?? Texture.TRILINEAR_SAMPLINGMODE;\n onLoad = noMipmapOrOptions.onLoad ?? null;\n onError = noMipmapOrOptions.onError ?? null;\n buffer = noMipmapOrOptions.buffer ?? null;\n deleteBuffer = noMipmapOrOptions.deleteBuffer ?? false;\n format = noMipmapOrOptions.format;\n mimeType = noMipmapOrOptions.mimeType;\n loaderOptions = noMipmapOrOptions.loaderOptions;\n creationFlags = noMipmapOrOptions.creationFlags;\n useSRGBBuffer = noMipmapOrOptions.useSRGBBuffer ?? false;\n internalTexture = noMipmapOrOptions.internalTexture ?? null;\n gammaSpace = noMipmapOrOptions.gammaSpace ?? gammaSpace;\n forcedExtension = noMipmapOrOptions.forcedExtension ?? forcedExtension;\n }\n else {\n noMipmap = !!noMipmapOrOptions;\n }\n this._gammaSpace = gammaSpace;\n this._noMipmap = noMipmap;\n this._invertY = invertY === undefined ? !useOpenGLOrientationForUV : invertY;\n this._initialSamplingMode = samplingMode;\n this._buffer = buffer;\n this._deleteBuffer = deleteBuffer;\n this._mimeType = mimeType;\n this._loaderOptions = loaderOptions;\n this._creationFlags = creationFlags;\n this._useSRGBBuffer = useSRGBBuffer;\n this._forcedExtension = forcedExtension;\n if (format) {\n this._format = format;\n }\n const scene = this.getScene();\n const engine = this._getEngine();\n if (!engine) {\n return;\n }\n engine.onBeforeTextureInitObservable.notifyObservers(this);\n const load = () => {\n if (this._texture) {\n if (this._texture._invertVScale) {\n this.vScale *= -1;\n this.vOffset += 1;\n }\n // Update texture to match internal texture's wrapping\n if (this._texture._cachedWrapU !== null) {\n this.wrapU = this._texture._cachedWrapU;\n this._texture._cachedWrapU = null;\n }\n if (this._texture._cachedWrapV !== null) {\n this.wrapV = this._texture._cachedWrapV;\n this._texture._cachedWrapV = null;\n }\n if (this._texture._cachedWrapR !== null) {\n this.wrapR = this._texture._cachedWrapR;\n this._texture._cachedWrapR = null;\n }\n }\n if (this.onLoadObservable.hasObservers()) {\n this.onLoadObservable.notifyObservers(this);\n }\n if (onLoad) {\n onLoad();\n }\n if (!this.isBlocking && scene) {\n scene.resetCachedMaterial();\n }\n };\n const errorHandler = (message, exception) => {\n this._loadingError = true;\n this._errorObject = { message, exception };\n if (onError) {\n onError(message, exception);\n }\n Texture.OnTextureLoadErrorObservable.notifyObservers(this);\n };\n if (!this.url && !internalTexture) {\n this._delayedOnLoad = load;\n this._delayedOnError = errorHandler;\n return;\n }\n this._texture = internalTexture ?? this._getFromCache(this.url, noMipmap, samplingMode, this._invertY, useSRGBBuffer, this.isCube);\n if (!this._texture) {\n if (!scene || !scene.useDelayedTextureLoading) {\n try {\n this._texture = engine.createTexture(this.url, noMipmap, this._invertY, scene, samplingMode, load, errorHandler, this._buffer, undefined, this._format, this._forcedExtension, mimeType, loaderOptions, creationFlags, useSRGBBuffer);\n }\n catch (e) {\n errorHandler(\"error loading\", e);\n throw e;\n }\n if (deleteBuffer) {\n this._buffer = null;\n }\n }\n else {\n this.delayLoadState = 4;\n this._delayedOnLoad = load;\n this._delayedOnError = errorHandler;\n }\n }\n else {\n if (this._texture.isReady) {\n TimingTools.SetImmediate(() => load());\n }\n else {\n const loadObserver = this._texture.onLoadedObservable.add(load);\n this._texture.onErrorObservable.add((e) => {\n errorHandler(e.message, e.exception);\n this._texture?.onLoadedObservable.remove(loadObserver);\n });\n }\n }\n }\n /**\n * Update the url (and optional buffer) of this texture if url was null during construction.\n * @param url the url of the texture\n * @param buffer the buffer of the texture (defaults to null)\n * @param onLoad callback called when the texture is loaded (defaults to null)\n * @param forcedExtension defines the extension to use to pick the right loader\n */\n updateURL(url, buffer = null, onLoad, forcedExtension) {\n if (this.url) {\n this.releaseInternalTexture();\n this.getScene().markAllMaterialsAsDirty(1, (mat) => {\n return mat.hasTexture(this);\n });\n }\n if (!this.name || this.name.startsWith(\"data:\")) {\n this.name = url;\n }\n this.url = url;\n this._buffer = buffer;\n this._forcedExtension = forcedExtension;\n this.delayLoadState = 4;\n if (onLoad) {\n this._delayedOnLoad = onLoad;\n }\n this.delayLoad();\n }\n /**\n * Finish the loading sequence of a texture flagged as delayed load.\n * @internal\n */\n delayLoad() {\n if (this.delayLoadState !== 4) {\n return;\n }\n const scene = this.getScene();\n if (!scene) {\n return;\n }\n this.delayLoadState = 1;\n this._texture = this._getFromCache(this.url, this._noMipmap, this.samplingMode, this._invertY, this._useSRGBBuffer, this.isCube);\n if (!this._texture) {\n this._texture = scene\n .getEngine()\n .createTexture(this.url, this._noMipmap, this._invertY, scene, this.samplingMode, this._delayedOnLoad, this._delayedOnError, this._buffer, null, this._format, this._forcedExtension, this._mimeType, this._loaderOptions, this._creationFlags, this._useSRGBBuffer);\n if (this._deleteBuffer) {\n this._buffer = null;\n }\n }\n else {\n if (this._delayedOnLoad) {\n if (this._texture.isReady) {\n TimingTools.SetImmediate(this._delayedOnLoad);\n }\n else {\n this._texture.onLoadedObservable.add(this._delayedOnLoad);\n }\n }\n }\n this._delayedOnLoad = null;\n this._delayedOnError = null;\n }\n _prepareRowForTextureGeneration(x, y, z, t) {\n x *= this._cachedUScale;\n y *= this._cachedVScale;\n x -= this.uRotationCenter * this._cachedUScale;\n y -= this.vRotationCenter * this._cachedVScale;\n z -= this.wRotationCenter;\n Vector3.TransformCoordinatesFromFloatsToRef(x, y, z, this._rowGenerationMatrix, t);\n t.x += this.uRotationCenter * this._cachedUScale + this._cachedUOffset;\n t.y += this.vRotationCenter * this._cachedVScale + this._cachedVOffset;\n t.z += this.wRotationCenter;\n }\n /**\n * Get the current texture matrix which includes the requested offsetting, tiling and rotation components.\n * @param uBase The horizontal base offset multiplier (1 by default)\n * @returns the transform matrix of the texture.\n */\n getTextureMatrix(uBase = 1) {\n if (this.uOffset === this._cachedUOffset &&\n this.vOffset === this._cachedVOffset &&\n this.uScale * uBase === this._cachedUScale &&\n this.vScale === this._cachedVScale &&\n this.uAng === this._cachedUAng &&\n this.vAng === this._cachedVAng &&\n this.wAng === this._cachedWAng &&\n this.uRotationCenter === this._cachedURotationCenter &&\n this.vRotationCenter === this._cachedVRotationCenter &&\n this.wRotationCenter === this._cachedWRotationCenter &&\n this.homogeneousRotationInUVTransform === this._cachedHomogeneousRotationInUVTransform) {\n return this._cachedTextureMatrix;\n }\n this._cachedUOffset = this.uOffset;\n this._cachedVOffset = this.vOffset;\n this._cachedUScale = this.uScale * uBase;\n this._cachedVScale = this.vScale;\n this._cachedUAng = this.uAng;\n this._cachedVAng = this.vAng;\n this._cachedWAng = this.wAng;\n this._cachedURotationCenter = this.uRotationCenter;\n this._cachedVRotationCenter = this.vRotationCenter;\n this._cachedWRotationCenter = this.wRotationCenter;\n this._cachedHomogeneousRotationInUVTransform = this.homogeneousRotationInUVTransform;\n if (!this._cachedTextureMatrix || !this._rowGenerationMatrix) {\n this._cachedTextureMatrix = Matrix.Zero();\n this._rowGenerationMatrix = new Matrix();\n this._t0 = Vector3.Zero();\n this._t1 = Vector3.Zero();\n this._t2 = Vector3.Zero();\n }\n Matrix.RotationYawPitchRollToRef(this.vAng, this.uAng, this.wAng, this._rowGenerationMatrix);\n if (this.homogeneousRotationInUVTransform) {\n Matrix.TranslationToRef(-this._cachedURotationCenter, -this._cachedVRotationCenter, -this._cachedWRotationCenter, TmpVectors.Matrix[0]);\n Matrix.TranslationToRef(this._cachedURotationCenter, this._cachedVRotationCenter, this._cachedWRotationCenter, TmpVectors.Matrix[1]);\n Matrix.ScalingToRef(this._cachedUScale, this._cachedVScale, 0, TmpVectors.Matrix[2]);\n Matrix.TranslationToRef(this._cachedUOffset, this._cachedVOffset, 0, TmpVectors.Matrix[3]);\n TmpVectors.Matrix[0].multiplyToRef(this._rowGenerationMatrix, this._cachedTextureMatrix);\n this._cachedTextureMatrix.multiplyToRef(TmpVectors.Matrix[1], this._cachedTextureMatrix);\n this._cachedTextureMatrix.multiplyToRef(TmpVectors.Matrix[2], this._cachedTextureMatrix);\n this._cachedTextureMatrix.multiplyToRef(TmpVectors.Matrix[3], this._cachedTextureMatrix);\n // copy the translation row to the 3rd row of the matrix so that we don't need to update the shaders (which expects the translation to be on the 3rd row)\n this._cachedTextureMatrix.setRowFromFloats(2, this._cachedTextureMatrix.m[12], this._cachedTextureMatrix.m[13], this._cachedTextureMatrix.m[14], 1);\n }\n else {\n this._prepareRowForTextureGeneration(0, 0, 0, this._t0);\n this._prepareRowForTextureGeneration(1.0, 0, 0, this._t1);\n this._prepareRowForTextureGeneration(0, 1.0, 0, this._t2);\n this._t1.subtractInPlace(this._t0);\n this._t2.subtractInPlace(this._t0);\n Matrix.FromValuesToRef(this._t1.x, this._t1.y, this._t1.z, 0.0, this._t2.x, this._t2.y, this._t2.z, 0.0, this._t0.x, this._t0.y, this._t0.z, 0.0, 0.0, 0.0, 0.0, 1.0, this._cachedTextureMatrix);\n }\n const scene = this.getScene();\n if (!scene) {\n return this._cachedTextureMatrix;\n }\n const previousIdentity3x2 = this._cachedIdentity3x2;\n this._cachedIdentity3x2 = this._cachedTextureMatrix.isIdentityAs3x2();\n if (this.optimizeUVAllocation && previousIdentity3x2 !== this._cachedIdentity3x2) {\n // We flag the materials that are using this texture as \"texture dirty\" because depending on the fact that the matrix is the identity or not, some defines\n // will get different values (see PrepareDefinesForMergedUV), meaning we should regenerate the effect accordingly\n scene.markAllMaterialsAsDirty(1, (mat) => {\n return mat.hasTexture(this);\n });\n }\n return this._cachedTextureMatrix;\n }\n /**\n * Get the current matrix used to apply reflection. This is useful to rotate an environment texture for instance.\n * @returns The reflection texture transform\n */\n getReflectionTextureMatrix() {\n const scene = this.getScene();\n if (!scene) {\n return this._cachedReflectionTextureMatrix;\n }\n if (this.uOffset === this._cachedReflectionUOffset &&\n this.vOffset === this._cachedReflectionVOffset &&\n this.uScale === this._cachedReflectionUScale &&\n this.vScale === this._cachedReflectionVScale &&\n this.coordinatesMode === this._cachedReflectionCoordinatesMode) {\n if (this.coordinatesMode === Texture.PROJECTION_MODE) {\n if (this._cachedReflectionProjectionMatrixId === scene.getProjectionMatrix().updateFlag) {\n return this._cachedReflectionTextureMatrix;\n }\n }\n else {\n return this._cachedReflectionTextureMatrix;\n }\n }\n if (!this._cachedReflectionTextureMatrix) {\n this._cachedReflectionTextureMatrix = Matrix.Zero();\n }\n if (!this._projectionModeMatrix) {\n this._projectionModeMatrix = Matrix.Zero();\n }\n const flagMaterialsAsTextureDirty = this._cachedReflectionCoordinatesMode !== this.coordinatesMode;\n this._cachedReflectionUOffset = this.uOffset;\n this._cachedReflectionVOffset = this.vOffset;\n this._cachedReflectionUScale = this.uScale;\n this._cachedReflectionVScale = this.vScale;\n this._cachedReflectionCoordinatesMode = this.coordinatesMode;\n switch (this.coordinatesMode) {\n case Texture.PLANAR_MODE: {\n Matrix.IdentityToRef(this._cachedReflectionTextureMatrix);\n this._cachedReflectionTextureMatrix[0] = this.uScale;\n this._cachedReflectionTextureMatrix[5] = this.vScale;\n this._cachedReflectionTextureMatrix[12] = this.uOffset;\n this._cachedReflectionTextureMatrix[13] = this.vOffset;\n break;\n }\n case Texture.PROJECTION_MODE: {\n Matrix.FromValuesToRef(0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 1.0, 1.0, this._projectionModeMatrix);\n const projectionMatrix = scene.getProjectionMatrix();\n this._cachedReflectionProjectionMatrixId = projectionMatrix.updateFlag;\n projectionMatrix.multiplyToRef(this._projectionModeMatrix, this._cachedReflectionTextureMatrix);\n break;\n }\n default:\n Matrix.IdentityToRef(this._cachedReflectionTextureMatrix);\n break;\n }\n if (flagMaterialsAsTextureDirty) {\n // We flag the materials that are using this texture as \"texture dirty\" if the coordinatesMode has changed.\n // Indeed, this property is used to set the value of some defines used to generate the effect (in material.isReadyForSubMesh), so we must make sure this code will be re-executed and the effect recreated if necessary\n scene.markAllMaterialsAsDirty(1, (mat) => {\n return mat.hasTexture(this);\n });\n }\n return this._cachedReflectionTextureMatrix;\n }\n /**\n * Clones the texture.\n * @returns the cloned texture\n */\n clone() {\n const options = {\n noMipmap: this._noMipmap,\n invertY: this._invertY,\n samplingMode: this.samplingMode,\n onLoad: undefined,\n onError: undefined,\n buffer: this._texture ? this._texture._buffer : undefined,\n deleteBuffer: this._deleteBuffer,\n format: this.textureFormat,\n mimeType: this.mimeType,\n loaderOptions: this._loaderOptions,\n creationFlags: this._creationFlags,\n useSRGBBuffer: this._useSRGBBuffer,\n };\n return SerializationHelper.Clone(() => {\n return new Texture(this._texture ? this._texture.url : null, this.getScene(), options);\n }, this);\n }\n /**\n * Serialize the texture to a JSON representation we can easily use in the respective Parse function.\n * @returns The JSON representation of the texture\n */\n serialize() {\n const savedName = this.name;\n if (!Texture.SerializeBuffers) {\n if (this.name.startsWith(\"data:\")) {\n this.name = \"\";\n }\n }\n if (this.name.startsWith(\"data:\") && this.url === this.name) {\n this.url = \"\";\n }\n const serializationObject = super.serialize(Texture._SerializeInternalTextureUniqueId);\n if (!serializationObject) {\n return null;\n }\n if (Texture.SerializeBuffers || Texture.ForceSerializeBuffers) {\n if (typeof this._buffer === \"string\" && this._buffer.substring(0, 5) === \"data:\") {\n serializationObject.base64String = this._buffer;\n serializationObject.name = serializationObject.name.replace(\"data:\", \"\");\n }\n else if (this.url && this.url.startsWith(\"data:\") && this._buffer instanceof Uint8Array) {\n serializationObject.base64String = \"data:image/png;base64,\" + EncodeArrayBufferToBase64(this._buffer);\n }\n else if (Texture.ForceSerializeBuffers || (this.url && this.url.startsWith(\"blob:\")) || this._forceSerialize) {\n serializationObject.base64String =\n !this._engine || this._engine._features.supportSyncTextureRead ? GenerateBase64StringFromTexture(this) : GenerateBase64StringFromTextureAsync(this);\n }\n }\n serializationObject.invertY = this._invertY;\n serializationObject.samplingMode = this.samplingMode;\n serializationObject._creationFlags = this._creationFlags;\n serializationObject._useSRGBBuffer = this._useSRGBBuffer;\n if (Texture._SerializeInternalTextureUniqueId) {\n serializationObject.internalTextureUniqueId = this._texture?.uniqueId;\n }\n serializationObject.internalTextureLabel = this._texture?.label;\n serializationObject.noMipmap = this._noMipmap;\n this.name = savedName;\n return serializationObject;\n }\n /**\n * Get the current class name of the texture useful for serialization or dynamic coding.\n * @returns \"Texture\"\n */\n getClassName() {\n return \"Texture\";\n }\n /**\n * Dispose the texture and release its associated resources.\n */\n dispose() {\n super.dispose();\n this.onLoadObservable.clear();\n this._delayedOnLoad = null;\n this._delayedOnError = null;\n this._buffer = null;\n }\n /**\n * Parse the JSON representation of a texture in order to recreate the texture in the given scene.\n * @param parsedTexture Define the JSON representation of the texture\n * @param scene Define the scene the parsed texture should be instantiated in\n * @param rootUrl Define the root url of the parsing sequence in the case of relative dependencies\n * @returns The parsed texture if successful\n */\n static Parse(parsedTexture, scene, rootUrl) {\n if (parsedTexture.customType) {\n const customTexture = InstantiationTools.Instantiate(parsedTexture.customType);\n // Update Sampling Mode\n const parsedCustomTexture = customTexture.Parse(parsedTexture, scene, rootUrl);\n if (parsedTexture.samplingMode && parsedCustomTexture.updateSamplingMode && parsedCustomTexture._samplingMode) {\n if (parsedCustomTexture._samplingMode !== parsedTexture.samplingMode) {\n parsedCustomTexture.updateSamplingMode(parsedTexture.samplingMode);\n }\n }\n return parsedCustomTexture;\n }\n if (parsedTexture.isCube && !parsedTexture.isRenderTarget) {\n return Texture._CubeTextureParser(parsedTexture, scene, rootUrl);\n }\n const hasInternalTextureUniqueId = parsedTexture.internalTextureUniqueId !== undefined;\n if (!parsedTexture.name && !parsedTexture.isRenderTarget && !hasInternalTextureUniqueId) {\n return null;\n }\n let internalTexture;\n if (hasInternalTextureUniqueId) {\n const cache = scene.getEngine().getLoadedTexturesCache();\n for (const texture of cache) {\n if (texture.uniqueId === parsedTexture.internalTextureUniqueId) {\n internalTexture = texture;\n break;\n }\n }\n }\n const onLoaded = (texture) => {\n // Clear cache\n if (texture && texture._texture) {\n texture._texture._cachedWrapU = null;\n texture._texture._cachedWrapV = null;\n texture._texture._cachedWrapR = null;\n }\n // Update Sampling Mode\n if (parsedTexture.samplingMode) {\n const sampling = parsedTexture.samplingMode;\n if (texture && texture.samplingMode !== sampling) {\n texture.updateSamplingMode(sampling);\n }\n }\n // Animations\n if (texture && parsedTexture.animations) {\n for (let animationIndex = 0; animationIndex < parsedTexture.animations.length; animationIndex++) {\n const parsedAnimation = parsedTexture.animations[animationIndex];\n const internalClass = GetClass(\"BABYLON.Animation\");\n if (internalClass) {\n texture.animations.push(internalClass.Parse(parsedAnimation));\n }\n }\n }\n if (texture && texture._texture) {\n if (hasInternalTextureUniqueId && !internalTexture) {\n texture._texture._setUniqueId(parsedTexture.internalTextureUniqueId);\n }\n texture._texture.label = parsedTexture.internalTextureLabel;\n }\n };\n const texture = SerializationHelper.Parse(() => {\n let generateMipMaps = true;\n if (parsedTexture.noMipmap) {\n generateMipMaps = false;\n }\n if (parsedTexture.mirrorPlane) {\n const mirrorTexture = Texture._CreateMirror(parsedTexture.name, parsedTexture.renderTargetSize, scene, generateMipMaps);\n mirrorTexture._waitingRenderList = parsedTexture.renderList;\n mirrorTexture.mirrorPlane = Plane.FromArray(parsedTexture.mirrorPlane);\n onLoaded(mirrorTexture);\n return mirrorTexture;\n }\n else if (parsedTexture.isRenderTarget) {\n let renderTargetTexture = null;\n if (parsedTexture.isCube) {\n // Search for an existing reflection probe (which contains a cube render target texture)\n if (scene.reflectionProbes) {\n for (let index = 0; index < scene.reflectionProbes.length; index++) {\n const probe = scene.reflectionProbes[index];\n if (probe.name === parsedTexture.name) {\n return probe.cubeTexture;\n }\n }\n }\n }\n else {\n renderTargetTexture = Texture._CreateRenderTargetTexture(parsedTexture.name, parsedTexture.renderTargetSize, scene, generateMipMaps, parsedTexture._creationFlags ?? 0);\n renderTargetTexture._waitingRenderList = parsedTexture.renderList;\n }\n onLoaded(renderTargetTexture);\n return renderTargetTexture;\n }\n else if (parsedTexture.isVideo) {\n const texture = Texture._CreateVideoTexture(rootUrl + (parsedTexture.url || parsedTexture.name), rootUrl + (parsedTexture.src || parsedTexture.url), scene, generateMipMaps, parsedTexture.invertY, parsedTexture.samplingMode, parsedTexture.settings || {});\n onLoaded(texture);\n return texture;\n }\n else {\n let texture;\n if (parsedTexture.base64String && !internalTexture) {\n // name and url are the same to ensure caching happens from the actual base64 string\n texture = Texture.CreateFromBase64String(parsedTexture.base64String, parsedTexture.base64String, scene, !generateMipMaps, parsedTexture.invertY, parsedTexture.samplingMode, () => {\n onLoaded(texture);\n }, parsedTexture._creationFlags ?? 0, parsedTexture._useSRGBBuffer ?? false);\n // prettier name to fit with the loaded data\n texture.name = parsedTexture.name;\n }\n else {\n let url;\n if (parsedTexture.name && (parsedTexture.name.indexOf(\"://\") > 0 || parsedTexture.name.startsWith(\"data:\"))) {\n url = parsedTexture.name;\n }\n else {\n url = rootUrl + parsedTexture.name;\n }\n if (parsedTexture.url && (parsedTexture.url.startsWith(\"data:\") || Texture.UseSerializedUrlIfAny)) {\n url = parsedTexture.url;\n }\n const options = {\n noMipmap: !generateMipMaps,\n invertY: parsedTexture.invertY,\n samplingMode: parsedTexture.samplingMode,\n onLoad: () => {\n onLoaded(texture);\n },\n internalTexture,\n };\n texture = new Texture(url, scene, options);\n }\n return texture;\n }\n }, parsedTexture, scene);\n return texture;\n }\n /**\n * Creates a texture from its base 64 representation.\n * @param data Define the base64 payload without the data: prefix\n * @param name Define the name of the texture in the scene useful fo caching purpose for instance\n * @param scene Define the scene the texture should belong to\n * @param noMipmapOrOptions defines if the texture will require mip maps or not or set of all options to create the texture\n * @param invertY define if the texture needs to be inverted on the y axis during loading\n * @param samplingMode define the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...)\n * @param onLoad define a callback triggered when the texture has been loaded\n * @param onError define a callback triggered when an error occurred during the loading session\n * @param format define the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)\n * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)\n * @param forcedExtension defines the extension to use to pick the right loader\n * @returns the created texture\n */\n static CreateFromBase64String(data, name, scene, noMipmapOrOptions, invertY, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, onLoad = null, onError = null, format = 5, creationFlags, forcedExtension) {\n return new Texture(\"data:\" + name, scene, noMipmapOrOptions, invertY, samplingMode, onLoad, onError, data, false, format, undefined, undefined, creationFlags, forcedExtension);\n }\n /**\n * Creates a texture from its data: representation. (data: will be added in case only the payload has been passed in)\n * @param name Define the name of the texture in the scene useful fo caching purpose for instance\n * @param buffer define the buffer to load the texture from in case the texture is loaded from a buffer representation\n * @param scene Define the scene the texture should belong to\n * @param deleteBuffer define if the buffer we are loading the texture from should be deleted after load\n * @param noMipmapOrOptions defines if the texture will require mip maps or not or set of all options to create the texture\n * @param invertY define if the texture needs to be inverted on the y axis during loading\n * @param samplingMode define the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...)\n * @param onLoad define a callback triggered when the texture has been loaded\n * @param onError define a callback triggered when an error occurred during the loading session\n * @param format define the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)\n * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)\n * @param forcedExtension defines the extension to use to pick the right loader\n * @returns the created texture\n */\n static LoadFromDataString(name, buffer, scene, deleteBuffer = false, noMipmapOrOptions, invertY = true, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, onLoad = null, onError = null, format = 5, creationFlags, forcedExtension) {\n if (name.substring(0, 5) !== \"data:\") {\n name = \"data:\" + name;\n }\n return new Texture(name, scene, noMipmapOrOptions, invertY, samplingMode, onLoad, onError, buffer, deleteBuffer, format, undefined, undefined, creationFlags, forcedExtension);\n }\n}\n/**\n * Gets or sets a general boolean used to indicate that textures containing direct data (buffers) must be saved as part of the serialization process\n */\nTexture.SerializeBuffers = true;\n/**\n * Gets or sets a general boolean used to indicate that texture buffers must be saved as part of the serialization process.\n * If no buffer exists, one will be created as base64 string from the internal webgl data.\n */\nTexture.ForceSerializeBuffers = false;\n/**\n * This observable will notify when any texture had a loading error\n */\nTexture.OnTextureLoadErrorObservable = new Observable();\n/** @internal */\nTexture._SerializeInternalTextureUniqueId = false;\n/**\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nTexture._CubeTextureParser = (jsonTexture, scene, rootUrl) => {\n throw _WarnImport(\"CubeTexture\");\n};\n/**\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nTexture._CreateMirror = (name, renderTargetSize, scene, generateMipMaps) => {\n throw _WarnImport(\"MirrorTexture\");\n};\n/**\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nTexture._CreateRenderTargetTexture = (name, renderTargetSize, scene, generateMipMaps, creationFlags) => {\n throw _WarnImport(\"RenderTargetTexture\");\n};\n/** nearest is mag = nearest and min = nearest and no mip */\nTexture.NEAREST_SAMPLINGMODE = 1;\n/** nearest is mag = nearest and min = nearest and mip = linear */\nTexture.NEAREST_NEAREST_MIPLINEAR = 8; // nearest is mag = nearest and min = nearest and mip = linear\n/** Bilinear is mag = linear and min = linear and no mip */\nTexture.BILINEAR_SAMPLINGMODE = 2;\n/** Bilinear is mag = linear and min = linear and mip = nearest */\nTexture.LINEAR_LINEAR_MIPNEAREST = 11; // Bilinear is mag = linear and min = linear and mip = nearest\n/** Trilinear is mag = linear and min = linear and mip = linear */\nTexture.TRILINEAR_SAMPLINGMODE = 3;\n/** Trilinear is mag = linear and min = linear and mip = linear */\nTexture.LINEAR_LINEAR_MIPLINEAR = 3; // Trilinear is mag = linear and min = linear and mip = linear\n/** mag = nearest and min = nearest and mip = nearest */\nTexture.NEAREST_NEAREST_MIPNEAREST = 4;\n/** mag = nearest and min = linear and mip = nearest */\nTexture.NEAREST_LINEAR_MIPNEAREST = 5;\n/** mag = nearest and min = linear and mip = linear */\nTexture.NEAREST_LINEAR_MIPLINEAR = 6;\n/** mag = nearest and min = linear and mip = none */\nTexture.NEAREST_LINEAR = 7;\n/** mag = nearest and min = nearest and mip = none */\nTexture.NEAREST_NEAREST = 1;\n/** mag = linear and min = nearest and mip = nearest */\nTexture.LINEAR_NEAREST_MIPNEAREST = 9;\n/** mag = linear and min = nearest and mip = linear */\nTexture.LINEAR_NEAREST_MIPLINEAR = 10;\n/** mag = linear and min = linear and mip = none */\nTexture.LINEAR_LINEAR = 2;\n/** mag = linear and min = nearest and mip = none */\nTexture.LINEAR_NEAREST = 12;\n/** Explicit coordinates mode */\nTexture.EXPLICIT_MODE = 0;\n/** Spherical coordinates mode */\nTexture.SPHERICAL_MODE = 1;\n/** Planar coordinates mode */\nTexture.PLANAR_MODE = 2;\n/** Cubic coordinates mode */\nTexture.CUBIC_MODE = 3;\n/** Projection coordinates mode */\nTexture.PROJECTION_MODE = 4;\n/** Inverse Cubic coordinates mode */\nTexture.SKYBOX_MODE = 5;\n/** Inverse Cubic coordinates mode */\nTexture.INVCUBIC_MODE = 6;\n/** Equirectangular coordinates mode */\nTexture.EQUIRECTANGULAR_MODE = 7;\n/** Equirectangular Fixed coordinates mode */\nTexture.FIXED_EQUIRECTANGULAR_MODE = 8;\n/** Equirectangular Fixed Mirrored coordinates mode */\nTexture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9;\n/** Texture is not repeating outside of 0..1 UVs */\nTexture.CLAMP_ADDRESSMODE = 0;\n/** Texture is repeating outside of 0..1 UVs */\nTexture.WRAP_ADDRESSMODE = 1;\n/** Texture is repeating and mirrored */\nTexture.MIRROR_ADDRESSMODE = 2;\n/**\n * Gets or sets a boolean which defines if the texture url must be build from the serialized URL instead of just using the name and loading them side by side with the scene file\n */\nTexture.UseSerializedUrlIfAny = false;\n__decorate([\n serialize()\n], Texture.prototype, \"url\", void 0);\n__decorate([\n serialize()\n], Texture.prototype, \"uOffset\", void 0);\n__decorate([\n serialize()\n], Texture.prototype, \"vOffset\", void 0);\n__decorate([\n serialize()\n], Texture.prototype, \"uScale\", void 0);\n__decorate([\n serialize()\n], Texture.prototype, \"vScale\", void 0);\n__decorate([\n serialize()\n], Texture.prototype, \"uAng\", void 0);\n__decorate([\n serialize()\n], Texture.prototype, \"vAng\", void 0);\n__decorate([\n serialize()\n], Texture.prototype, \"wAng\", void 0);\n__decorate([\n serialize()\n], Texture.prototype, \"uRotationCenter\", void 0);\n__decorate([\n serialize()\n], Texture.prototype, \"vRotationCenter\", void 0);\n__decorate([\n serialize()\n], Texture.prototype, \"wRotationCenter\", void 0);\n__decorate([\n serialize()\n], Texture.prototype, \"homogeneousRotationInUVTransform\", void 0);\n__decorate([\n serialize()\n], Texture.prototype, \"isBlocking\", null);\n// References the dependencies.\nRegisterClass(\"BABYLON.Texture\", Texture);\nSerializationHelper._TextureParser = Texture.Parse;\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,SAAS,QAAQ,0BAA0B;AACpD,SAASC,UAAU,QAAQ,0BAA0B;AACrD,SAASC,MAAM,EAAEC,UAAU,EAAEC,OAAO,QAAQ,4BAA4B;AACxE,SAASC,WAAW,QAAQ,yCAAyC;AAErE,SAASC,QAAQ,EAAEC,aAAa,QAAQ,yBAAyB;AACjE,SAASC,WAAW,QAAQ,wBAAwB;AACpD,SAASC,WAAW,QAAQ,2BAA2B;AACvD,SAASC,kBAAkB,QAAQ,kCAAkC;AACrE,SAASC,KAAK,QAAQ,2BAA2B;AACjD,SAASC,yBAAyB,QAAQ,2BAA2B;AACrE,SAASC,+BAA+B,EAAEC,oCAAoC,QAAQ,yBAAyB;AAC/G,SAASC,yBAAyB,QAAQ,sCAAsC;AAChF,SAASC,mBAAmB,QAAQ,wCAAwC;AAC5E;AACA;AACA;AACA;AACA,OAAO,MAAMC,OAAO,SAASZ,WAAW,CAAC;EACrC;AACJ;AACA;EACI,OAAOa,mBAAmBA,CAACC,IAAI,EAAEC,GAAG,EAAEC,KAAK,EAAEC,eAAe,GAAG,KAAK,EAAEC,OAAO,GAAG,KAAK,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