@babylonjs/core 5.52.0 → 5.53.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Animations/animatable.js +1 -1
- package/Animations/animatable.js.map +1 -1
- package/Animations/animationGroup.js +8 -1
- package/Animations/animationGroup.js.map +1 -1
- package/Collisions/pickingInfo.d.ts +2 -1
- package/Collisions/pickingInfo.js +4 -3
- package/Collisions/pickingInfo.js.map +1 -1
- package/DeviceInput/eventFactory.js +4 -0
- package/DeviceInput/eventFactory.js.map +1 -1
- package/DeviceInput/webDeviceInputSystem.js +17 -9
- package/DeviceInput/webDeviceInputSystem.js.map +1 -1
- package/Engines/Extensions/engine.cubeTexture.js +3 -0
- package/Engines/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.js +74 -19
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +2 -5
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGL/webGLHardwareTexture.d.ts +3 -1
- package/Engines/WebGL/webGLHardwareTexture.js +19 -7
- package/Engines/WebGL/webGLHardwareTexture.js.map +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.d.ts +14 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.js +76 -6
- package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.js +20 -0
- package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +3 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/webgpuConstants.d.ts +22 -7
- package/Engines/WebGPU/webgpuConstants.js +24 -8
- package/Engines/WebGPU/webgpuConstants.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.d.ts +0 -3
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +20 -53
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.d.ts +3 -2
- package/Engines/WebGPU/webgpuTextureHelper.js +33 -14
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/WebGPU/webgpuTintWASM.d.ts +3 -2
- package/Engines/WebGPU/webgpuTintWASM.js +10 -8
- package/Engines/WebGPU/webgpuTintWASM.js.map +1 -1
- package/Engines/constants.d.ts +12 -0
- package/Engines/constants.js +12 -0
- package/Engines/constants.js.map +1 -1
- package/Engines/engine.d.ts +130 -72
- package/Engines/engine.js +5 -0
- package/Engines/engine.js.map +1 -1
- package/Engines/nativeEngine.d.ts +1 -0
- package/Engines/nativeEngine.js +16 -5
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/renderTargetWrapper.d.ts +28 -4
- package/Engines/renderTargetWrapper.js +107 -10
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.d.ts +6 -6
- package/Engines/thinEngine.js +29 -21
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +25 -8
- package/Engines/webgpuEngine.js +112 -48
- package/Engines/webgpuEngine.js.map +1 -1
- package/Inputs/scene.inputManager.js +5 -12
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Materials/PBR/pbrAnisotropicConfiguration.js +0 -1
- package/Materials/PBR/pbrAnisotropicConfiguration.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +3 -0
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/Filtering/hdrFiltering.js +4 -0
- package/Materials/Textures/Filtering/hdrFiltering.js.map +1 -1
- package/Materials/Textures/internalTexture.d.ts +4 -0
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/multiRenderTarget.d.ts +40 -0
- package/Materials/Textures/multiRenderTarget.js +143 -4
- package/Materials/Textures/multiRenderTarget.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +4 -0
- package/Materials/Textures/renderTargetTexture.js +10 -2
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/texture.d.ts +4 -2
- package/Materials/Textures/texture.js +1 -0
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/Textures/textureCreationOptions.d.ts +4 -0
- package/Materials/Textures/textureCreationOptions.js.map +1 -1
- package/Materials/materialPluginBase.d.ts +3 -2
- package/Materials/materialPluginBase.js.map +1 -1
- package/Materials/materialPluginManager.js +13 -3
- package/Materials/materialPluginManager.js.map +1 -1
- package/Materials/uniformBuffer.d.ts +2 -0
- package/Materials/uniformBuffer.js +4 -0
- package/Materials/uniformBuffer.js.map +1 -1
- package/Maths/math.frustum.d.ts +8 -1
- package/Maths/math.frustum.js +14 -0
- package/Maths/math.frustum.js.map +1 -1
- package/Meshes/instancedMesh.d.ts +2 -1
- package/Meshes/instancedMesh.js +3 -2
- package/Meshes/instancedMesh.js.map +1 -1
- package/Meshes/mesh.d.ts +10 -5
- package/Meshes/mesh.js +40 -16
- package/Meshes/mesh.js.map +1 -1
- package/Misc/filesInput.d.ts +5 -2
- package/Misc/filesInput.js +39 -20
- package/Misc/filesInput.js.map +1 -1
- package/Misc/interfaces/screenshotSize.d.ts +17 -3
- package/Misc/interfaces/screenshotSize.js.map +1 -1
- package/Misc/sceneOptimizer.js +3 -0
- package/Misc/sceneOptimizer.js.map +1 -1
- package/Misc/screenshotTools.d.ts +2 -2
- package/Misc/screenshotTools.js +49 -9
- package/Misc/screenshotTools.js.map +1 -1
- package/Misc/textureTools.d.ts +1 -1
- package/Misc/textureTools.js +4 -2
- package/Misc/textureTools.js.map +1 -1
- package/Physics/v2/physicsAggregate.js +3 -3
- package/Physics/v2/physicsAggregate.js.map +1 -1
- package/Physics/v2/physicsBody.d.ts +27 -16
- package/Physics/v2/physicsBody.js +31 -16
- package/Physics/v2/physicsBody.js.map +1 -1
- package/Physics/v2/physicsConstraint.d.ts +6 -6
- package/Physics/v2/physicsConstraint.js +6 -6
- package/Physics/v2/physicsConstraint.js.map +1 -1
- package/Physics/v2/physicsShape.d.ts +7 -7
- package/Physics/v2/physicsShape.js +7 -7
- package/Physics/v2/physicsShape.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +1 -0
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/postProcessRenderPipelineManager.d.ts +5 -0
- package/PostProcesses/RenderPipeline/postProcessRenderPipelineManager.js +7 -0
- package/PostProcesses/RenderPipeline/postProcessRenderPipelineManager.js.map +1 -1
- package/PostProcesses/depthOfFieldMergePostProcess.d.ts +0 -23
- package/PostProcesses/depthOfFieldMergePostProcess.js +0 -5
- package/PostProcesses/depthOfFieldMergePostProcess.js.map +1 -1
- package/PostProcesses/postProcess.js +1 -0
- package/PostProcesses/postProcess.js.map +1 -1
- package/Probes/reflectionProbe.js +1 -0
- package/Probes/reflectionProbe.js.map +1 -1
- package/Rendering/depthPeelingRenderer.js +3 -1
- package/Rendering/depthPeelingRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderer.js +1 -1
- package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js +2 -1
- package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTextures.js +2 -0
- package/Rendering/fluidRenderer/fluidRenderingTextures.js.map +1 -1
- package/Shaders/default.fragment.js +1 -1
- package/Shaders/default.fragment.js.map +1 -1
- package/Shaders/depthOfFieldMerge.fragment.js +10 -5
- package/Shaders/depthOfFieldMerge.fragment.js.map +1 -1
- package/Shaders/fluidRenderingRender.fragment.js +3 -3
- package/Shaders/fluidRenderingRender.fragment.js.map +1 -1
- package/Shaders/motionBlur.fragment.js +8 -2
- package/Shaders/motionBlur.fragment.js.map +1 -1
- package/Shaders/screenSpaceReflection2.fragment.js +11 -4
- package/Shaders/screenSpaceReflection2.fragment.js.map +1 -1
- package/Shaders/screenSpaceReflection2Blur.fragment.js +6 -1
- package/Shaders/screenSpaceReflection2Blur.fragment.js.map +1 -1
- package/Shaders/ssao2.fragment.js +1 -0
- package/Shaders/ssao2.fragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/bakedVertexAnimation.js +9 -9
- package/ShadersWGSL/ShadersInclude/bakedVertexAnimation.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/bonesVertex.js +16 -16
- package/ShadersWGSL/ShadersInclude/bonesVertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/clipPlaneFragment.js +6 -6
- package/ShadersWGSL/ShadersInclude/clipPlaneFragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/clipPlaneVertex.js +6 -6
- package/ShadersWGSL/ShadersInclude/clipPlaneVertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/instancesVertex.js +1 -1
- package/ShadersWGSL/ShadersInclude/instancesVertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/morphTargetsVertex.js +8 -8
- package/ShadersWGSL/ShadersInclude/morphTargetsVertex.js.map +1 -1
- package/XR/features/WebXRControllerTeleportation.d.ts +9 -0
- package/XR/features/WebXRControllerTeleportation.js +28 -4
- package/XR/features/WebXRControllerTeleportation.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"texture.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Materials/Textures/texture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE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A4yBL,+BAA+B;AAC/B,aAAa,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;AAC1C,mBAAmB,CAAC,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC","sourcesContent":["import { serialize, SerializationHelper } from \"../../Misc/decorators\";\r\nimport { Observable } from \"../../Misc/observable\";\r\nimport type { Nullable } from \"../../types\";\r\nimport { Matrix, TmpVectors, Vector3 } from \"../../Maths/math.vector\";\r\nimport { BaseTexture } from \"../../Materials/Textures/baseTexture\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport { GetClass, RegisterClass } from \"../../Misc/typeStore\";\r\nimport { _WarnImport } from \"../../Misc/devTools\";\r\nimport type { IInspectable } from \"../../Misc/iInspectable\";\r\nimport type { ThinEngine } from \"../../Engines/thinEngine\";\r\nimport { TimingTools } from \"../../Misc/timingTools\";\r\nimport { InstantiationTools } from \"../../Misc/instantiationTools\";\r\nimport { Plane } from \"../../Maths/math.plane\";\r\nimport { EncodeArrayBufferToBase64 } from \"../../Misc/stringTools\";\r\nimport { GenerateBase64StringFromTexture, GenerateBase64StringFromTextureAsync } from \"../../Misc/copyTools\";\r\nimport { CompatibilityOptions } from \"../../Compat/compatibilityOptions\";\r\nimport type { InternalTexture } from \"./internalTexture\";\r\n\r\ndeclare type CubeTexture = import(\"../../Materials/Textures/cubeTexture\").CubeTexture;\r\ndeclare type MirrorTexture = import(\"../../Materials/Textures/mirrorTexture\").MirrorTexture;\r\ndeclare type RenderTargetTexture = import(\"../../Materials/Textures/renderTargetTexture\").RenderTargetTexture;\r\ndeclare type Scene = import(\"../../scene\").Scene;\r\n\r\n/**\r\n * Defines the available options when creating a texture\r\n */\r\nexport interface ITextureCreationOptions {\r\n /** Defines if the texture will require mip maps or not (default: false) */\r\n noMipmap?: boolean;\r\n\r\n /** Defines if the texture needs to be inverted on the y axis during loading (default: true) */\r\n invertY?: boolean;\r\n\r\n /** Defines the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...) (default: Texture.TRILINEAR_SAMPLINGMODE) */\r\n samplingMode?: number;\r\n\r\n /** Defines a callback triggered when the texture has been loaded (default: null) */\r\n onLoad?: Nullable<() => void>;\r\n\r\n /** Defines a callback triggered when an error occurred during the loading session (default: null) */\r\n onError?: Nullable<(message?: string, exception?: any) => void>;\r\n\r\n /** Defines the buffer to load the texture from in case the texture is loaded from a buffer representation (default: null) */\r\n buffer?: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob | ImageBitmap>;\r\n\r\n /** Defines if the buffer we are loading the texture from should be deleted after load (default: false) */\r\n deleteBuffer?: boolean;\r\n\r\n /** Defines the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...) (default: ) */\r\n format?: number;\r\n\r\n /** Defines an optional mime type information (default: undefined) */\r\n mimeType?: string;\r\n\r\n /** Options to be passed to the loader (default: undefined) */\r\n loaderOptions?: any;\r\n\r\n /** Specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg) (default: undefined) */\r\n creationFlags?: number;\r\n\r\n /** Defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU) (default: false) */\r\n useSRGBBuffer?: boolean;\r\n\r\n /** Defines the underlying texture from an already existing one */\r\n internalTexture?: InternalTexture;\r\n}\r\n\r\n/**\r\n * This represents a texture in babylon. It can be easily loaded from a network, base64 or html input.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction#texture\r\n */\r\nexport class Texture extends BaseTexture {\r\n /**\r\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\r\n */\r\n public static SerializeBuffers = true;\r\n\r\n /**\r\n * Gets or sets a general boolean used to indicate that texture buffers must be saved as part of the serialization process.\r\n * If no buffer exists, one will be created as base64 string from the internal webgl data.\r\n */\r\n public static ForceSerializeBuffers = false;\r\n\r\n /**\r\n * This observable will notify when any texture had a loading error\r\n */\r\n public static OnTextureLoadErrorObservable = new Observable<BaseTexture>();\r\n\r\n /** @internal */\r\n public static _SerializeInternalTextureUniqueId = false;\r\n\r\n /**\r\n * @internal\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public static _CubeTextureParser = (jsonTexture: any, scene: Scene, rootUrl: string): CubeTexture => {\r\n throw _WarnImport(\"CubeTexture\");\r\n };\r\n /**\r\n * @internal\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public static _CreateMirror = (name: string, renderTargetSize: number, scene: Scene, generateMipMaps: boolean): MirrorTexture => {\r\n throw _WarnImport(\"MirrorTexture\");\r\n };\r\n /**\r\n * @internal\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public static _CreateRenderTargetTexture = (name: string, renderTargetSize: number, scene: Scene, generateMipMaps: boolean, creationFlags?: number): RenderTargetTexture => {\r\n throw _WarnImport(\"RenderTargetTexture\");\r\n };\r\n\r\n /** nearest is mag = nearest and min = nearest and no mip */\r\n public static readonly NEAREST_SAMPLINGMODE = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n /** nearest is mag = nearest and min = nearest and mip = linear */\r\n public static readonly NEAREST_NEAREST_MIPLINEAR = Constants.TEXTURE_NEAREST_NEAREST_MIPLINEAR; // nearest is mag = nearest and min = nearest and mip = linear\r\n\r\n /** Bilinear is mag = linear and min = linear and no mip */\r\n public static readonly BILINEAR_SAMPLINGMODE = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n /** Bilinear is mag = linear and min = linear and mip = nearest */\r\n public static readonly LINEAR_LINEAR_MIPNEAREST = Constants.TEXTURE_LINEAR_LINEAR_MIPNEAREST; // Bilinear is mag = linear and min = linear and mip = nearest\r\n\r\n /** Trilinear is mag = linear and min = linear and mip = linear */\r\n public static readonly TRILINEAR_SAMPLINGMODE = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE;\r\n /** Trilinear is mag = linear and min = linear and mip = linear */\r\n public static readonly LINEAR_LINEAR_MIPLINEAR = Constants.TEXTURE_LINEAR_LINEAR_MIPLINEAR; // Trilinear is mag = linear and min = linear and mip = linear\r\n\r\n /** mag = nearest and min = nearest and mip = nearest */\r\n public static readonly NEAREST_NEAREST_MIPNEAREST = Constants.TEXTURE_NEAREST_NEAREST_MIPNEAREST;\r\n /** mag = nearest and min = linear and mip = nearest */\r\n public static readonly NEAREST_LINEAR_MIPNEAREST = Constants.TEXTURE_NEAREST_LINEAR_MIPNEAREST;\r\n /** mag = nearest and min = linear and mip = linear */\r\n public static readonly NEAREST_LINEAR_MIPLINEAR = Constants.TEXTURE_NEAREST_LINEAR_MIPLINEAR;\r\n /** mag = nearest and min = linear and mip = none */\r\n public static readonly NEAREST_LINEAR = Constants.TEXTURE_NEAREST_LINEAR;\r\n /** mag = nearest and min = nearest and mip = none */\r\n public static readonly NEAREST_NEAREST = Constants.TEXTURE_NEAREST_NEAREST;\r\n /** mag = linear and min = nearest and mip = nearest */\r\n public static readonly LINEAR_NEAREST_MIPNEAREST = Constants.TEXTURE_LINEAR_NEAREST_MIPNEAREST;\r\n /** mag = linear and min = nearest and mip = linear */\r\n public static readonly LINEAR_NEAREST_MIPLINEAR = Constants.TEXTURE_LINEAR_NEAREST_MIPLINEAR;\r\n /** mag = linear and min = linear and mip = none */\r\n public static readonly LINEAR_LINEAR = Constants.TEXTURE_LINEAR_LINEAR;\r\n /** mag = linear and min = nearest and mip = none */\r\n public static readonly LINEAR_NEAREST = Constants.TEXTURE_LINEAR_NEAREST;\r\n\r\n /** Explicit coordinates mode */\r\n public static readonly EXPLICIT_MODE = Constants.TEXTURE_EXPLICIT_MODE;\r\n /** Spherical coordinates mode */\r\n public static readonly SPHERICAL_MODE = Constants.TEXTURE_SPHERICAL_MODE;\r\n /** Planar coordinates mode */\r\n public static readonly PLANAR_MODE = Constants.TEXTURE_PLANAR_MODE;\r\n /** Cubic coordinates mode */\r\n public static readonly CUBIC_MODE = Constants.TEXTURE_CUBIC_MODE;\r\n /** Projection coordinates mode */\r\n public static readonly PROJECTION_MODE = Constants.TEXTURE_PROJECTION_MODE;\r\n /** Inverse Cubic coordinates mode */\r\n public static readonly SKYBOX_MODE = Constants.TEXTURE_SKYBOX_MODE;\r\n /** Inverse Cubic coordinates mode */\r\n public static readonly INVCUBIC_MODE = Constants.TEXTURE_INVCUBIC_MODE;\r\n /** Equirectangular coordinates mode */\r\n public static readonly EQUIRECTANGULAR_MODE = Constants.TEXTURE_EQUIRECTANGULAR_MODE;\r\n /** Equirectangular Fixed coordinates mode */\r\n public static readonly FIXED_EQUIRECTANGULAR_MODE = Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MODE;\r\n /** Equirectangular Fixed Mirrored coordinates mode */\r\n public static readonly FIXED_EQUIRECTANGULAR_MIRRORED_MODE = Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE;\r\n\r\n /** Texture is not repeating outside of 0..1 UVs */\r\n public static readonly CLAMP_ADDRESSMODE = Constants.TEXTURE_CLAMP_ADDRESSMODE;\r\n /** Texture is repeating outside of 0..1 UVs */\r\n public static readonly WRAP_ADDRESSMODE = Constants.TEXTURE_WRAP_ADDRESSMODE;\r\n /** Texture is repeating and mirrored */\r\n public static readonly MIRROR_ADDRESSMODE = Constants.TEXTURE_MIRROR_ADDRESSMODE;\r\n\r\n /**\r\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\r\n */\r\n public static UseSerializedUrlIfAny = false;\r\n\r\n /**\r\n * Define the url of the texture.\r\n */\r\n @serialize()\r\n public url: Nullable<string> = null;\r\n\r\n /**\r\n * Define an offset on the texture to offset the u coordinates of the UVs\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#offsetting\r\n */\r\n @serialize()\r\n public uOffset = 0;\r\n\r\n /**\r\n * Define an offset on the texture to offset the v coordinates of the UVs\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#offsetting\r\n */\r\n @serialize()\r\n public vOffset = 0;\r\n\r\n /**\r\n * Define an offset on the texture to scale the u coordinates of the UVs\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#tiling\r\n */\r\n @serialize()\r\n public uScale = 1.0;\r\n\r\n /**\r\n * Define an offset on the texture to scale the v coordinates of the UVs\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#tiling\r\n */\r\n @serialize()\r\n public vScale = 1.0;\r\n\r\n /**\r\n * Define an offset on the texture to rotate around the u coordinates of the UVs\r\n * The angle is defined in radians.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials\r\n */\r\n @serialize()\r\n public uAng = 0;\r\n\r\n /**\r\n * Define an offset on the texture to rotate around the v coordinates of the UVs\r\n * The angle is defined in radians.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials\r\n */\r\n @serialize()\r\n public vAng = 0;\r\n\r\n /**\r\n * Define an offset on the texture to rotate around the w coordinates of the UVs (in case of 3d texture)\r\n * The angle is defined in radians.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials\r\n */\r\n @serialize()\r\n public wAng = 0;\r\n\r\n /**\r\n * Defines the center of rotation (U)\r\n */\r\n @serialize()\r\n public uRotationCenter = 0.5;\r\n\r\n /**\r\n * Defines the center of rotation (V)\r\n */\r\n @serialize()\r\n public vRotationCenter = 0.5;\r\n\r\n /**\r\n * Defines the center of rotation (W)\r\n */\r\n @serialize()\r\n public wRotationCenter = 0.5;\r\n\r\n /**\r\n * Sets this property to true to avoid deformations when rotating the texture with non-uniform scaling\r\n */\r\n @serialize()\r\n public homogeneousRotationInUVTransform = false;\r\n\r\n /**\r\n * Are mip maps generated for this texture or not.\r\n */\r\n get noMipmap(): boolean {\r\n return this._noMipmap;\r\n }\r\n\r\n /**\r\n * List of inspectable custom properties (used by the Inspector)\r\n * @see https://doc.babylonjs.com/toolsAndResources/inspector#extensibility\r\n */\r\n public inspectableCustomProperties: Nullable<IInspectable[]> = null;\r\n\r\n private _noMipmap: boolean = false;\r\n /** @internal */\r\n public _invertY: boolean = false;\r\n private _rowGenerationMatrix: Nullable<Matrix> = null;\r\n private _cachedTextureMatrix: Nullable<Matrix> = null;\r\n private _projectionModeMatrix: Nullable<Matrix> = null;\r\n private _t0: Nullable<Vector3> = null;\r\n private _t1: Nullable<Vector3> = null;\r\n private _t2: Nullable<Vector3> = null;\r\n\r\n private _cachedUOffset: number = -1;\r\n private _cachedVOffset: number = -1;\r\n private _cachedUScale: number = 0;\r\n private _cachedVScale: number = 0;\r\n private _cachedUAng: number = -1;\r\n private _cachedVAng: number = -1;\r\n private _cachedWAng: number = -1;\r\n private _cachedReflectionProjectionMatrixId: number = -1;\r\n private _cachedURotationCenter: number = -1;\r\n private _cachedVRotationCenter: number = -1;\r\n private _cachedWRotationCenter: number = -1;\r\n private _cachedHomogeneousRotationInUVTransform: boolean = false;\r\n\r\n private _cachedReflectionTextureMatrix: Nullable<Matrix> = null;\r\n private _cachedReflectionUOffset = -1;\r\n private _cachedReflectionVOffset = -1;\r\n private _cachedReflectionUScale = 0;\r\n private _cachedReflectionVScale = 0;\r\n private _cachedReflectionCoordinatesMode = -1;\r\n\r\n /** @internal */\r\n public _buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob | ImageBitmap> = null;\r\n private _deleteBuffer: boolean = false;\r\n protected _format: Nullable<number> = null;\r\n private _delayedOnLoad: Nullable<() => void> = null;\r\n private _delayedOnError: Nullable<() => void> = null;\r\n private _mimeType?: string;\r\n private _loaderOptions?: any;\r\n private _creationFlags?: number;\r\n private _useSRGBBuffer?: boolean;\r\n private _forcedExtension?: string;\r\n\r\n /** Returns the texture mime type if it was defined by a loader (undefined else) */\r\n public get mimeType() {\r\n return this._mimeType;\r\n }\r\n\r\n /**\r\n * Observable triggered once the texture has been loaded.\r\n */\r\n public onLoadObservable: Observable<Texture> = new Observable<Texture>();\r\n\r\n protected _isBlocking: boolean = true;\r\n /**\r\n * Is the texture preventing material to render while loading.\r\n * If false, a default texture will be used instead of the loading one during the preparation step.\r\n */\r\n public set isBlocking(value: boolean) {\r\n this._isBlocking = value;\r\n }\r\n @serialize()\r\n public get isBlocking(): boolean {\r\n return this._isBlocking;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if the texture needs to be inverted on the y axis during loading\r\n */\r\n public get invertY(): boolean {\r\n return this._invertY;\r\n }\r\n\r\n /**\r\n * Instantiates a new texture.\r\n * This represents a texture in babylon. It can be easily loaded from a network, base64 or html input.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction#texture\r\n * @param url defines the url of the picture to load as a texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param noMipmapOrOptions defines if the texture will require mip maps or not or set of all options to create the texture\r\n * @param invertY defines if the texture needs to be inverted on the y axis during loading\r\n * @param samplingMode defines the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...)\r\n * @param onLoad defines a callback triggered when the texture has been loaded\r\n * @param onError defines a callback triggered when an error occurred during the loading session\r\n * @param buffer defines the buffer to load the texture from in case the texture is loaded from a buffer representation\r\n * @param deleteBuffer defines if the buffer we are loading the texture from should be deleted after load\r\n * @param format defines the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)\r\n * @param mimeType defines an optional mime type information\r\n * @param loaderOptions options to be passed to the loader\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @param forcedExtension defines the extension to use to pick the right loader\r\n */\r\n constructor(\r\n url: Nullable<string>,\r\n sceneOrEngine?: Nullable<Scene | ThinEngine>,\r\n noMipmapOrOptions?: boolean | ITextureCreationOptions,\r\n invertY?: boolean,\r\n samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE,\r\n onLoad: Nullable<() => void> = null,\r\n onError: Nullable<(message?: string, exception?: any) => void> = null,\r\n buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob | ImageBitmap> = null,\r\n deleteBuffer: boolean = false,\r\n format?: number,\r\n mimeType?: string,\r\n loaderOptions?: any,\r\n creationFlags?: number,\r\n forcedExtension?: string\r\n ) {\r\n super(sceneOrEngine);\r\n\r\n this.name = url || \"\";\r\n this.url = url;\r\n\r\n let noMipmap: boolean;\r\n let useSRGBBuffer: boolean = false;\r\n let internalTexture: Nullable<InternalTexture> = null;\r\n\r\n if (typeof noMipmapOrOptions === \"object\" && noMipmapOrOptions !== null) {\r\n noMipmap = noMipmapOrOptions.noMipmap ?? false;\r\n invertY = noMipmapOrOptions.invertY ?? (CompatibilityOptions.UseOpenGLOrientationForUV ? false : true);\r\n samplingMode = noMipmapOrOptions.samplingMode ?? Texture.TRILINEAR_SAMPLINGMODE;\r\n onLoad = noMipmapOrOptions.onLoad ?? null;\r\n onError = noMipmapOrOptions.onError ?? null;\r\n buffer = noMipmapOrOptions.buffer ?? null;\r\n deleteBuffer = noMipmapOrOptions.deleteBuffer ?? false;\r\n format = noMipmapOrOptions.format;\r\n mimeType = noMipmapOrOptions.mimeType;\r\n loaderOptions = noMipmapOrOptions.loaderOptions;\r\n creationFlags = noMipmapOrOptions.creationFlags;\r\n useSRGBBuffer = noMipmapOrOptions.useSRGBBuffer ?? false;\r\n internalTexture = noMipmapOrOptions.internalTexture ?? null;\r\n } else {\r\n noMipmap = !!noMipmapOrOptions;\r\n }\r\n\r\n this._noMipmap = noMipmap;\r\n this._invertY = invertY === undefined ? (CompatibilityOptions.UseOpenGLOrientationForUV ? false : true) : invertY;\r\n this._initialSamplingMode = samplingMode;\r\n this._buffer = buffer;\r\n this._deleteBuffer = deleteBuffer;\r\n this._mimeType = mimeType;\r\n this._loaderOptions = loaderOptions;\r\n this._creationFlags = creationFlags;\r\n this._useSRGBBuffer = useSRGBBuffer;\r\n this._forcedExtension = forcedExtension;\r\n if (format) {\r\n this._format = format;\r\n }\r\n\r\n const scene = this.getScene();\r\n const engine = this._getEngine();\r\n if (!engine) {\r\n return;\r\n }\r\n\r\n engine.onBeforeTextureInitObservable.notifyObservers(this);\r\n\r\n const load = () => {\r\n if (this._texture) {\r\n if (this._texture._invertVScale) {\r\n this.vScale *= -1;\r\n this.vOffset += 1;\r\n }\r\n\r\n // Update texture to match internal texture's wrapping\r\n if (this._texture._cachedWrapU !== null) {\r\n this.wrapU = this._texture._cachedWrapU;\r\n this._texture._cachedWrapU = null;\r\n }\r\n if (this._texture._cachedWrapV !== null) {\r\n this.wrapV = this._texture._cachedWrapV;\r\n this._texture._cachedWrapV = null;\r\n }\r\n if (this._texture._cachedWrapR !== null) {\r\n this.wrapR = this._texture._cachedWrapR;\r\n this._texture._cachedWrapR = null;\r\n }\r\n }\r\n\r\n if (this.onLoadObservable.hasObservers()) {\r\n this.onLoadObservable.notifyObservers(this);\r\n }\r\n if (onLoad) {\r\n onLoad();\r\n }\r\n\r\n if (!this.isBlocking && scene) {\r\n scene.resetCachedMaterial();\r\n }\r\n };\r\n\r\n const errorHandler = (message?: string, exception?: any) => {\r\n this._loadingError = true;\r\n this._errorObject = { message, exception };\r\n if (onError) {\r\n onError(message, exception);\r\n }\r\n Texture.OnTextureLoadErrorObservable.notifyObservers(this);\r\n };\r\n\r\n if (!this.url && !internalTexture) {\r\n this._delayedOnLoad = load;\r\n this._delayedOnError = errorHandler;\r\n return;\r\n }\r\n\r\n this._texture = internalTexture ?? this._getFromCache(this.url, noMipmap, samplingMode, this._invertY, useSRGBBuffer);\r\n\r\n if (!this._texture) {\r\n if (!scene || !scene.useDelayedTextureLoading) {\r\n try {\r\n this._texture = engine.createTexture(\r\n this.url,\r\n noMipmap,\r\n this._invertY,\r\n scene,\r\n samplingMode,\r\n load,\r\n errorHandler,\r\n this._buffer,\r\n undefined,\r\n this._format,\r\n this._forcedExtension,\r\n mimeType,\r\n loaderOptions,\r\n creationFlags,\r\n useSRGBBuffer\r\n );\r\n } catch (e) {\r\n errorHandler(\"error loading\", e);\r\n throw e;\r\n }\r\n if (deleteBuffer) {\r\n this._buffer = null;\r\n }\r\n } else {\r\n this.delayLoadState = Constants.DELAYLOADSTATE_NOTLOADED;\r\n\r\n this._delayedOnLoad = load;\r\n this._delayedOnError = errorHandler;\r\n }\r\n } else {\r\n if (this._texture.isReady) {\r\n TimingTools.SetImmediate(() => load());\r\n } else {\r\n const loadObserver = this._texture.onLoadedObservable.add(load);\r\n this._texture.onErrorObservable.add((e) => {\r\n errorHandler(e.message, e.exception);\r\n this._texture?.onLoadedObservable.remove(loadObserver);\r\n });\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Update the url (and optional buffer) of this texture if url was null during construction.\r\n * @param url the url of the texture\r\n * @param buffer the buffer of the texture (defaults to null)\r\n * @param onLoad callback called when the texture is loaded (defaults to null)\r\n * @param forcedExtension defines the extension to use to pick the right loader\r\n */\r\n public updateURL(\r\n url: string,\r\n buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob | ImageBitmap> = null,\r\n onLoad?: () => void,\r\n forcedExtension?: string\r\n ): void {\r\n if (this.url) {\r\n this.releaseInternalTexture();\r\n this.getScene()!.markAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);\r\n }\r\n\r\n if (!this.name || this.name.startsWith(\"data:\")) {\r\n this.name = url;\r\n }\r\n this.url = url;\r\n this._buffer = buffer;\r\n this._forcedExtension = forcedExtension;\r\n this.delayLoadState = Constants.DELAYLOADSTATE_NOTLOADED;\r\n\r\n if (onLoad) {\r\n this._delayedOnLoad = onLoad;\r\n }\r\n this.delayLoad();\r\n }\r\n\r\n /**\r\n * Finish the loading sequence of a texture flagged as delayed load.\r\n * @internal\r\n */\r\n public delayLoad(): void {\r\n if (this.delayLoadState !== Constants.DELAYLOADSTATE_NOTLOADED) {\r\n return;\r\n }\r\n\r\n const scene = this.getScene();\r\n if (!scene) {\r\n return;\r\n }\r\n\r\n this.delayLoadState = Constants.DELAYLOADSTATE_LOADED;\r\n this._texture = this._getFromCache(this.url, this._noMipmap, this.samplingMode, this._invertY, this._useSRGBBuffer);\r\n\r\n if (!this._texture) {\r\n this._texture = scene\r\n .getEngine()\r\n .createTexture(\r\n this.url,\r\n this._noMipmap,\r\n this._invertY,\r\n scene,\r\n this.samplingMode,\r\n this._delayedOnLoad,\r\n this._delayedOnError,\r\n this._buffer,\r\n null,\r\n this._format,\r\n this._forcedExtension,\r\n this._mimeType,\r\n this._loaderOptions,\r\n this._creationFlags,\r\n this._useSRGBBuffer\r\n );\r\n if (this._deleteBuffer) {\r\n this._buffer = null;\r\n }\r\n } else {\r\n if (this._delayedOnLoad) {\r\n if (this._texture.isReady) {\r\n TimingTools.SetImmediate(this._delayedOnLoad);\r\n } else {\r\n this._texture.onLoadedObservable.add(this._delayedOnLoad);\r\n }\r\n }\r\n }\r\n\r\n this._delayedOnLoad = null;\r\n this._delayedOnError = null;\r\n }\r\n\r\n private _prepareRowForTextureGeneration(x: number, y: number, z: number, t: Vector3): void {\r\n x *= this._cachedUScale;\r\n y *= this._cachedVScale;\r\n\r\n x -= this.uRotationCenter * this._cachedUScale;\r\n y -= this.vRotationCenter * this._cachedVScale;\r\n z -= this.wRotationCenter;\r\n\r\n Vector3.TransformCoordinatesFromFloatsToRef(x, y, z, this._rowGenerationMatrix!, t);\r\n\r\n t.x += this.uRotationCenter * this._cachedUScale + this._cachedUOffset;\r\n t.y += this.vRotationCenter * this._cachedVScale + this._cachedVOffset;\r\n t.z += this.wRotationCenter;\r\n }\r\n\r\n /**\r\n * Checks if the texture has the same transform matrix than another texture\r\n * @param texture texture to check against\r\n * @returns true if the transforms are the same, else false\r\n */\r\n public checkTransformsAreIdentical(texture: Nullable<Texture>): boolean {\r\n return (\r\n texture !== null &&\r\n this.uOffset === texture.uOffset &&\r\n this.vOffset === texture.vOffset &&\r\n this.uScale === texture.uScale &&\r\n this.vScale === texture.vScale &&\r\n this.uAng === texture.uAng &&\r\n this.vAng === texture.vAng &&\r\n this.wAng === texture.wAng\r\n );\r\n }\r\n\r\n /**\r\n * Get the current texture matrix which includes the requested offsetting, tiling and rotation components.\r\n * @param uBase\r\n * @returns the transform matrix of the texture.\r\n */\r\n public getTextureMatrix(uBase = 1): Matrix {\r\n if (\r\n this.uOffset === this._cachedUOffset &&\r\n this.vOffset === this._cachedVOffset &&\r\n this.uScale * uBase === this._cachedUScale &&\r\n this.vScale === this._cachedVScale &&\r\n this.uAng === this._cachedUAng &&\r\n this.vAng === this._cachedVAng &&\r\n this.wAng === this._cachedWAng &&\r\n this.uRotationCenter === this._cachedURotationCenter &&\r\n this.vRotationCenter === this._cachedVRotationCenter &&\r\n this.wRotationCenter === this._cachedWRotationCenter &&\r\n this.homogeneousRotationInUVTransform === this._cachedHomogeneousRotationInUVTransform\r\n ) {\r\n return this._cachedTextureMatrix!;\r\n }\r\n\r\n this._cachedUOffset = this.uOffset;\r\n this._cachedVOffset = this.vOffset;\r\n this._cachedUScale = this.uScale * uBase;\r\n this._cachedVScale = this.vScale;\r\n this._cachedUAng = this.uAng;\r\n this._cachedVAng = this.vAng;\r\n this._cachedWAng = this.wAng;\r\n this._cachedURotationCenter = this.uRotationCenter;\r\n this._cachedVRotationCenter = this.vRotationCenter;\r\n this._cachedWRotationCenter = this.wRotationCenter;\r\n this._cachedHomogeneousRotationInUVTransform = this.homogeneousRotationInUVTransform;\r\n\r\n if (!this._cachedTextureMatrix || !this._rowGenerationMatrix) {\r\n this._cachedTextureMatrix = Matrix.Zero();\r\n this._rowGenerationMatrix = new Matrix();\r\n this._t0 = Vector3.Zero();\r\n this._t1 = Vector3.Zero();\r\n this._t2 = Vector3.Zero();\r\n }\r\n\r\n Matrix.RotationYawPitchRollToRef(this.vAng, this.uAng, this.wAng, this._rowGenerationMatrix!);\r\n\r\n if (this.homogeneousRotationInUVTransform) {\r\n Matrix.TranslationToRef(-this._cachedURotationCenter, -this._cachedVRotationCenter, -this._cachedWRotationCenter, TmpVectors.Matrix[0]);\r\n Matrix.TranslationToRef(this._cachedURotationCenter, this._cachedVRotationCenter, this._cachedWRotationCenter, TmpVectors.Matrix[1]);\r\n Matrix.ScalingToRef(this._cachedUScale, this._cachedVScale, 0, TmpVectors.Matrix[2]);\r\n Matrix.TranslationToRef(this._cachedUOffset, this._cachedVOffset, 0, TmpVectors.Matrix[3]);\r\n\r\n TmpVectors.Matrix[0].multiplyToRef(this._rowGenerationMatrix!, this._cachedTextureMatrix);\r\n this._cachedTextureMatrix.multiplyToRef(TmpVectors.Matrix[1], this._cachedTextureMatrix);\r\n this._cachedTextureMatrix.multiplyToRef(TmpVectors.Matrix[2], this._cachedTextureMatrix);\r\n this._cachedTextureMatrix.multiplyToRef(TmpVectors.Matrix[3], this._cachedTextureMatrix);\r\n\r\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)\r\n this._cachedTextureMatrix.setRowFromFloats(2, this._cachedTextureMatrix.m[12], this._cachedTextureMatrix.m[13], this._cachedTextureMatrix.m[14], 1);\r\n } else {\r\n this._prepareRowForTextureGeneration(0, 0, 0, this._t0!);\r\n this._prepareRowForTextureGeneration(1.0, 0, 0, this._t1!);\r\n this._prepareRowForTextureGeneration(0, 1.0, 0, this._t2!);\r\n\r\n this._t1!.subtractInPlace(this._t0!);\r\n this._t2!.subtractInPlace(this._t0!);\r\n\r\n Matrix.FromValuesToRef(\r\n this._t1!.x,\r\n this._t1!.y,\r\n this._t1!.z,\r\n 0.0,\r\n this._t2!.x,\r\n this._t2!.y,\r\n this._t2!.z,\r\n 0.0,\r\n this._t0!.x,\r\n this._t0!.y,\r\n this._t0!.z,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 1.0,\r\n this._cachedTextureMatrix\r\n );\r\n }\r\n\r\n const scene = this.getScene();\r\n\r\n if (!scene) {\r\n return this._cachedTextureMatrix;\r\n }\r\n\r\n if (this.optimizeUVAllocation) {\r\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\r\n // will get different values (see MaterialHelper.PrepareDefinesForMergedUV), meaning we should regenerate the effect accordingly\r\n scene.markAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag, (mat) => {\r\n return mat.hasTexture(this);\r\n });\r\n }\r\n\r\n return this._cachedTextureMatrix;\r\n }\r\n\r\n /**\r\n * Get the current matrix used to apply reflection. This is useful to rotate an environment texture for instance.\r\n * @returns The reflection texture transform\r\n */\r\n public getReflectionTextureMatrix(): Matrix {\r\n const scene = this.getScene();\r\n\r\n if (!scene) {\r\n return this._cachedReflectionTextureMatrix!;\r\n }\r\n\r\n if (\r\n this.uOffset === this._cachedReflectionUOffset &&\r\n this.vOffset === this._cachedReflectionVOffset &&\r\n this.uScale === this._cachedReflectionUScale &&\r\n this.vScale === this._cachedReflectionVScale &&\r\n this.coordinatesMode === this._cachedReflectionCoordinatesMode\r\n ) {\r\n if (this.coordinatesMode === Texture.PROJECTION_MODE) {\r\n if (this._cachedReflectionProjectionMatrixId === scene.getProjectionMatrix().updateFlag) {\r\n return this._cachedReflectionTextureMatrix!;\r\n }\r\n } else {\r\n return this._cachedReflectionTextureMatrix!;\r\n }\r\n }\r\n\r\n if (!this._cachedReflectionTextureMatrix) {\r\n this._cachedReflectionTextureMatrix = Matrix.Zero();\r\n }\r\n\r\n if (!this._projectionModeMatrix) {\r\n this._projectionModeMatrix = Matrix.Zero();\r\n }\r\n\r\n const flagMaterialsAsTextureDirty = this._cachedReflectionCoordinatesMode !== this.coordinatesMode;\r\n\r\n this._cachedReflectionUOffset = this.uOffset;\r\n this._cachedReflectionVOffset = this.vOffset;\r\n this._cachedReflectionUScale = this.uScale;\r\n this._cachedReflectionVScale = this.vScale;\r\n this._cachedReflectionCoordinatesMode = this.coordinatesMode;\r\n\r\n switch (this.coordinatesMode) {\r\n case Texture.PLANAR_MODE: {\r\n Matrix.IdentityToRef(this._cachedReflectionTextureMatrix);\r\n (<any>this._cachedReflectionTextureMatrix)[0] = this.uScale;\r\n (<any>this._cachedReflectionTextureMatrix)[5] = this.vScale;\r\n (<any>this._cachedReflectionTextureMatrix)[12] = this.uOffset;\r\n (<any>this._cachedReflectionTextureMatrix)[13] = this.vOffset;\r\n break;\r\n }\r\n case Texture.PROJECTION_MODE: {\r\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);\r\n\r\n const projectionMatrix = scene.getProjectionMatrix();\r\n this._cachedReflectionProjectionMatrixId = projectionMatrix.updateFlag;\r\n projectionMatrix.multiplyToRef(this._projectionModeMatrix, this._cachedReflectionTextureMatrix);\r\n break;\r\n }\r\n default:\r\n Matrix.IdentityToRef(this._cachedReflectionTextureMatrix);\r\n break;\r\n }\r\n\r\n if (flagMaterialsAsTextureDirty) {\r\n // We flag the materials that are using this texture as \"texture dirty\" if the coordinatesMode has changed.\r\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\r\n scene.markAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag, (mat) => {\r\n return mat.getActiveTextures().indexOf(this) !== -1;\r\n });\r\n }\r\n\r\n return this._cachedReflectionTextureMatrix;\r\n }\r\n\r\n /**\r\n * Clones the texture.\r\n * @returns the cloned texture\r\n */\r\n public clone(): Texture {\r\n const options: ITextureCreationOptions = {\r\n noMipmap: this._noMipmap,\r\n invertY: this._invertY,\r\n samplingMode: this.samplingMode,\r\n onLoad: undefined,\r\n onError: undefined,\r\n buffer: this._texture ? this._texture._buffer : undefined,\r\n deleteBuffer: this._deleteBuffer,\r\n format: this.textureFormat,\r\n mimeType: this.mimeType,\r\n loaderOptions: this._loaderOptions,\r\n creationFlags: this._creationFlags,\r\n useSRGBBuffer: this._useSRGBBuffer,\r\n };\r\n\r\n return SerializationHelper.Clone(() => {\r\n return new Texture(this._texture ? this._texture.url : null, this.getScene(), options);\r\n }, this);\r\n }\r\n\r\n /**\r\n * Serialize the texture to a JSON representation we can easily use in the respective Parse function.\r\n * @returns The JSON representation of the texture\r\n */\r\n public serialize(): any {\r\n const savedName = this.name;\r\n\r\n if (!Texture.SerializeBuffers) {\r\n if (this.name.startsWith(\"data:\")) {\r\n this.name = \"\";\r\n }\r\n }\r\n\r\n if (this.name.startsWith(\"data:\") && this.url === this.name) {\r\n this.url = \"\";\r\n }\r\n\r\n const serializationObject = super.serialize(Texture._SerializeInternalTextureUniqueId);\r\n\r\n if (!serializationObject) {\r\n return null;\r\n }\r\n\r\n if (Texture.SerializeBuffers || Texture.ForceSerializeBuffers) {\r\n if (typeof this._buffer === \"string\" && (this._buffer as string).substr(0, 5) === \"data:\") {\r\n serializationObject.base64String = this._buffer;\r\n serializationObject.name = serializationObject.name.replace(\"data:\", \"\");\r\n } else if (this.url && this.url.startsWith(\"data:\") && this._buffer instanceof Uint8Array) {\r\n serializationObject.base64String = \"data:image/png;base64,\" + EncodeArrayBufferToBase64(this._buffer);\r\n } else if (Texture.ForceSerializeBuffers || (this.url && this.url.startsWith(\"blob:\")) || this._forceSerialize) {\r\n serializationObject.base64String =\r\n !this._engine || this._engine._features.supportSyncTextureRead ? GenerateBase64StringFromTexture(this) : GenerateBase64StringFromTextureAsync(this);\r\n }\r\n }\r\n\r\n serializationObject.invertY = this._invertY;\r\n serializationObject.samplingMode = this.samplingMode;\r\n serializationObject._creationFlags = this._creationFlags;\r\n serializationObject._useSRGBBuffer = this._useSRGBBuffer;\r\n if (Texture._SerializeInternalTextureUniqueId) {\r\n serializationObject.internalTextureUniqueId = this._texture?.uniqueId ?? undefined;\r\n }\r\n\r\n this.name = savedName;\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Get the current class name of the texture useful for serialization or dynamic coding.\r\n * @returns \"Texture\"\r\n */\r\n public getClassName(): string {\r\n return \"Texture\";\r\n }\r\n\r\n /**\r\n * Dispose the texture and release its associated resources.\r\n */\r\n public dispose(): void {\r\n super.dispose();\r\n\r\n this.onLoadObservable.clear();\r\n\r\n this._delayedOnLoad = null;\r\n this._delayedOnError = null;\r\n this._buffer = null;\r\n }\r\n\r\n /**\r\n * Parse the JSON representation of a texture in order to recreate the texture in the given scene.\r\n * @param parsedTexture Define the JSON representation of the texture\r\n * @param scene Define the scene the parsed texture should be instantiated in\r\n * @param rootUrl Define the root url of the parsing sequence in the case of relative dependencies\r\n * @returns The parsed texture if successful\r\n */\r\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): Nullable<BaseTexture> {\r\n if (parsedTexture.customType) {\r\n const customTexture = InstantiationTools.Instantiate(parsedTexture.customType);\r\n // Update Sampling Mode\r\n const parsedCustomTexture: any = customTexture.Parse(parsedTexture, scene, rootUrl);\r\n if (parsedTexture.samplingMode && parsedCustomTexture.updateSamplingMode && parsedCustomTexture._samplingMode) {\r\n if (parsedCustomTexture._samplingMode !== parsedTexture.samplingMode) {\r\n parsedCustomTexture.updateSamplingMode(parsedTexture.samplingMode);\r\n }\r\n }\r\n return parsedCustomTexture;\r\n }\r\n\r\n if (parsedTexture.isCube && !parsedTexture.isRenderTarget) {\r\n return Texture._CubeTextureParser(parsedTexture, scene, rootUrl);\r\n }\r\n\r\n const hasInternalTextureUniqueId = parsedTexture.internalTextureUniqueId !== undefined;\r\n\r\n if (!parsedTexture.name && !parsedTexture.isRenderTarget && !hasInternalTextureUniqueId) {\r\n return null;\r\n }\r\n\r\n let internalTexture: InternalTexture | undefined;\r\n\r\n if (hasInternalTextureUniqueId) {\r\n const cache = scene.getEngine().getLoadedTexturesCache();\r\n for (const texture of cache) {\r\n if (texture.uniqueId === parsedTexture.internalTextureUniqueId) {\r\n internalTexture = texture;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n const onLoaded = (texture: Texture | null) => {\r\n // Clear cache\r\n if (texture && texture._texture) {\r\n texture._texture._cachedWrapU = null;\r\n texture._texture._cachedWrapV = null;\r\n texture._texture._cachedWrapR = null;\r\n }\r\n\r\n // Update Sampling Mode\r\n if (parsedTexture.samplingMode) {\r\n const sampling: number = parsedTexture.samplingMode;\r\n if (texture && texture.samplingMode !== sampling) {\r\n texture.updateSamplingMode(sampling);\r\n }\r\n }\r\n // Animations\r\n if (texture && parsedTexture.animations) {\r\n for (let animationIndex = 0; animationIndex < parsedTexture.animations.length; animationIndex++) {\r\n const parsedAnimation = parsedTexture.animations[animationIndex];\r\n const internalClass = GetClass(\"BABYLON.Animation\");\r\n if (internalClass) {\r\n texture.animations.push(internalClass.Parse(parsedAnimation));\r\n }\r\n }\r\n }\r\n\r\n if (hasInternalTextureUniqueId && !internalTexture) {\r\n texture?._texture?._setUniqueId(parsedTexture.internalTextureUniqueId);\r\n }\r\n };\r\n\r\n const texture = SerializationHelper.Parse(\r\n () => {\r\n let generateMipMaps: boolean = true;\r\n if (parsedTexture.noMipmap) {\r\n generateMipMaps = false;\r\n }\r\n if (parsedTexture.mirrorPlane) {\r\n const mirrorTexture = Texture._CreateMirror(parsedTexture.name, parsedTexture.renderTargetSize, scene, generateMipMaps);\r\n mirrorTexture._waitingRenderList = parsedTexture.renderList;\r\n mirrorTexture.mirrorPlane = Plane.FromArray(parsedTexture.mirrorPlane);\r\n onLoaded(mirrorTexture);\r\n return mirrorTexture;\r\n } else if (parsedTexture.isRenderTarget) {\r\n let renderTargetTexture: Nullable<RenderTargetTexture> = null;\r\n if (parsedTexture.isCube) {\r\n // Search for an existing reflection probe (which contains a cube render target texture)\r\n if (scene.reflectionProbes) {\r\n for (let index = 0; index < scene.reflectionProbes.length; index++) {\r\n const probe = scene.reflectionProbes[index];\r\n if (probe.name === parsedTexture.name) {\r\n return probe.cubeTexture;\r\n }\r\n }\r\n }\r\n } else {\r\n renderTargetTexture = Texture._CreateRenderTargetTexture(\r\n parsedTexture.name,\r\n parsedTexture.renderTargetSize,\r\n scene,\r\n generateMipMaps,\r\n parsedTexture._creationFlags ?? 0\r\n );\r\n renderTargetTexture._waitingRenderList = parsedTexture.renderList;\r\n }\r\n onLoaded(renderTargetTexture);\r\n return renderTargetTexture;\r\n } else {\r\n let texture: Texture;\r\n\r\n if (parsedTexture.base64String && !internalTexture) {\r\n // name and url are the same to ensure caching happens from the actual base64 string\r\n texture = Texture.CreateFromBase64String(\r\n parsedTexture.base64String,\r\n parsedTexture.base64String,\r\n scene,\r\n !generateMipMaps,\r\n parsedTexture.invertY,\r\n parsedTexture.samplingMode,\r\n () => {\r\n onLoaded(texture);\r\n },\r\n parsedTexture._creationFlags ?? 0,\r\n parsedTexture._useSRGBBuffer ?? false\r\n );\r\n\r\n // prettier name to fit with the loaded data\r\n texture.name = parsedTexture.name;\r\n } else {\r\n let url: string;\r\n if (parsedTexture.name && parsedTexture.name.indexOf(\"://\") > 0) {\r\n url = parsedTexture.name;\r\n } else {\r\n url = rootUrl + parsedTexture.name;\r\n }\r\n\r\n if (parsedTexture.url && (parsedTexture.url.startsWith(\"data:\") || Texture.UseSerializedUrlIfAny)) {\r\n url = parsedTexture.url;\r\n }\r\n\r\n const options: ITextureCreationOptions = {\r\n noMipmap: !generateMipMaps,\r\n invertY: parsedTexture.invertY,\r\n samplingMode: parsedTexture.samplingMode,\r\n onLoad: () => {\r\n onLoaded(texture);\r\n },\r\n internalTexture,\r\n };\r\n\r\n texture = new Texture(url, scene, options);\r\n }\r\n\r\n return texture;\r\n }\r\n },\r\n parsedTexture,\r\n scene\r\n );\r\n\r\n return texture;\r\n }\r\n\r\n /**\r\n * Creates a texture from its base 64 representation.\r\n * @param data Define the base64 payload without the data: prefix\r\n * @param name Define the name of the texture in the scene useful fo caching purpose for instance\r\n * @param scene Define the scene the texture should belong to\r\n * @param noMipmapOrOptions defines if the texture will require mip maps or not or set of all options to create the texture\r\n * @param invertY define if the texture needs to be inverted on the y axis during loading\r\n * @param samplingMode define the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...)\r\n * @param onLoad define a callback triggered when the texture has been loaded\r\n * @param onError define a callback triggered when an error occurred during the loading session\r\n * @param format define the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @returns the created texture\r\n */\r\n public static CreateFromBase64String(\r\n data: string,\r\n name: string,\r\n scene: Scene,\r\n noMipmapOrOptions?: boolean | ITextureCreationOptions,\r\n invertY?: boolean,\r\n samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE,\r\n onLoad: Nullable<() => void> = null,\r\n onError: Nullable<() => void> = null,\r\n format: number = Constants.TEXTUREFORMAT_RGBA,\r\n creationFlags?: number\r\n ): Texture {\r\n return new Texture(\"data:\" + name, scene, noMipmapOrOptions, invertY, samplingMode, onLoad, onError, data, false, format, undefined, undefined, creationFlags);\r\n }\r\n\r\n /**\r\n * Creates a texture from its data: representation. (data: will be added in case only the payload has been passed in)\r\n * @param name Define the name of the texture in the scene useful fo caching purpose for instance\r\n * @param buffer define the buffer to load the texture from in case the texture is loaded from a buffer representation\r\n * @param scene Define the scene the texture should belong to\r\n * @param deleteBuffer define if the buffer we are loading the texture from should be deleted after load\r\n * @param noMipmapOrOptions defines if the texture will require mip maps or not or set of all options to create the texture\r\n * @param invertY define if the texture needs to be inverted on the y axis during loading\r\n * @param samplingMode define the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...)\r\n * @param onLoad define a callback triggered when the texture has been loaded\r\n * @param onError define a callback triggered when an error occurred during the loading session\r\n * @param format define the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @returns the created texture\r\n */\r\n public static LoadFromDataString(\r\n name: string,\r\n buffer: any,\r\n scene: Scene,\r\n deleteBuffer: boolean = false,\r\n noMipmapOrOptions?: boolean | ITextureCreationOptions,\r\n invertY: boolean = true,\r\n samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE,\r\n onLoad: Nullable<() => void> = null,\r\n onError: Nullable<(message?: string, exception?: any) => void> = null,\r\n format: number = Constants.TEXTUREFORMAT_RGBA,\r\n creationFlags?: number\r\n ): Texture {\r\n if (name.substr(0, 5) !== \"data:\") {\r\n name = \"data:\" + name;\r\n }\r\n\r\n return new Texture(name, scene, noMipmapOrOptions, invertY, samplingMode, onLoad, onError, buffer, deleteBuffer, format, undefined, undefined, creationFlags);\r\n }\r\n}\r\n\r\n// References the dependencies.\r\nRegisterClass(\"BABYLON.Texture\", Texture);\r\nSerializationHelper._TextureParser = Texture.Parse;\r\n"]}
|
|
1
|
+
{"version":3,"file":"texture.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Materials/Textures/texture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,+BAA+B,EAAE,oCAAoC,EAAE,MAAM,sBAAsB,CAAC;AAC7G,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAoDzE;;;GAGG;AACH,MAAM,OAAO,OAAQ,SAAQ,WAAW;IA+LpC;;OAEG;IACH,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,SA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AS,CAAC,2CAA2C,CAAC;AAEnH,mDAAmD;AAC5B,yBAAiB,GAAG,SAAS,CAAC,yBAAyB,CAAC;AAC/E,+CAA+C;AACxB,wBAAgB,GAAG,SAAS,CAAC,wBAAwB,CAAC;AAC7E,wCAAwC;AACjB,0BAAkB,GAAG,SAAS,CAAC,0BAA0B,CAAC;AAEjF;;GAEG;AACW,6BAAqB,GAAG,KAAK,CAAC;AAM5C;IADC,SAAS,EAAE;oCACwB;AAOpC;IADC,SAAS,EAAE;wCACO;AAOnB;IADC,SAAS,EAAE;wCACO;AAOnB;IADC,SAAS,EAAE;uCACQ;AAOpB;IADC,SAAS,EAAE;uCACQ;AAQpB;IADC,SAAS,EAAE;qCACI;AAQhB;IADC,SAAS,EAAE;qCACI;AAQhB;IADC,SAAS,EAAE;qCACI;AAMhB;IADC,SAAS,EAAE;gDACiB;AAM7B;IADC,SAAS,EAAE;gDACiB;AAM7B;IADC,SAAS,EAAE;gDACiB;AAM7B;IADC,SAAS,EAAE;iEACoC;AA8EhD;IADC,SAAS,EAAE;yCAGX;AA4yBL,+BAA+B;AAC/B,aAAa,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;AAC1C,mBAAmB,CAAC,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC","sourcesContent":["import { serialize, SerializationHelper } from \"../../Misc/decorators\";\r\nimport { Observable } from \"../../Misc/observable\";\r\nimport type { Nullable } from \"../../types\";\r\nimport { Matrix, TmpVectors, Vector3 } from \"../../Maths/math.vector\";\r\nimport { BaseTexture } from \"../../Materials/Textures/baseTexture\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport { GetClass, RegisterClass } from \"../../Misc/typeStore\";\r\nimport { _WarnImport } from \"../../Misc/devTools\";\r\nimport type { IInspectable } from \"../../Misc/iInspectable\";\r\nimport type { ThinEngine } from \"../../Engines/thinEngine\";\r\nimport { TimingTools } from \"../../Misc/timingTools\";\r\nimport { InstantiationTools } from \"../../Misc/instantiationTools\";\r\nimport { Plane } from \"../../Maths/math.plane\";\r\nimport { EncodeArrayBufferToBase64 } from \"../../Misc/stringTools\";\r\nimport { GenerateBase64StringFromTexture, GenerateBase64StringFromTextureAsync } from \"../../Misc/copyTools\";\r\nimport { CompatibilityOptions } from \"../../Compat/compatibilityOptions\";\r\nimport type { InternalTexture } from \"./internalTexture\";\r\n\r\ndeclare type CubeTexture = import(\"../../Materials/Textures/cubeTexture\").CubeTexture;\r\ndeclare type MirrorTexture = import(\"../../Materials/Textures/mirrorTexture\").MirrorTexture;\r\ndeclare type RenderTargetTexture = import(\"../../Materials/Textures/renderTargetTexture\").RenderTargetTexture;\r\ndeclare type Scene = import(\"../../scene\").Scene;\r\n\r\n/**\r\n * Defines the available options when creating a texture\r\n */\r\nexport interface ITextureCreationOptions {\r\n /** Defines if the texture will require mip maps or not (default: false) */\r\n noMipmap?: boolean;\r\n\r\n /** Defines if the texture needs to be inverted on the y axis during loading (default: true) */\r\n invertY?: boolean;\r\n\r\n /** Defines the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...) (default: Texture.TRILINEAR_SAMPLINGMODE) */\r\n samplingMode?: number;\r\n\r\n /** Defines a callback triggered when the texture has been loaded (default: null) */\r\n onLoad?: Nullable<() => void>;\r\n\r\n /** Defines a callback triggered when an error occurred during the loading session (default: null) */\r\n onError?: Nullable<(message?: string, exception?: any) => void>;\r\n\r\n /** Defines the buffer to load the texture from in case the texture is loaded from a buffer representation (default: null) */\r\n buffer?: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob | ImageBitmap>;\r\n\r\n /** Defines if the buffer we are loading the texture from should be deleted after load (default: false) */\r\n deleteBuffer?: boolean;\r\n\r\n /** Defines the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...) (default: ) */\r\n format?: number;\r\n\r\n /** Defines an optional mime type information (default: undefined) */\r\n mimeType?: string;\r\n\r\n /** Options to be passed to the loader (default: undefined) */\r\n loaderOptions?: any;\r\n\r\n /** Specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg) (default: undefined) */\r\n creationFlags?: number;\r\n\r\n /** Defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU) (default: false) */\r\n useSRGBBuffer?: boolean;\r\n\r\n /** Defines the underlying texture from an already existing one */\r\n internalTexture?: InternalTexture;\r\n}\r\n\r\n/**\r\n * This represents a texture in babylon. It can be easily loaded from a network, base64 or html input.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction#texture\r\n */\r\nexport class Texture extends BaseTexture {\r\n /**\r\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\r\n */\r\n public static SerializeBuffers = true;\r\n\r\n /**\r\n * Gets or sets a general boolean used to indicate that texture buffers must be saved as part of the serialization process.\r\n * If no buffer exists, one will be created as base64 string from the internal webgl data.\r\n */\r\n public static ForceSerializeBuffers = false;\r\n\r\n /**\r\n * This observable will notify when any texture had a loading error\r\n */\r\n public static OnTextureLoadErrorObservable = new Observable<BaseTexture>();\r\n\r\n /** @internal */\r\n public static _SerializeInternalTextureUniqueId = false;\r\n\r\n /**\r\n * @internal\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public static _CubeTextureParser = (jsonTexture: any, scene: Scene, rootUrl: string): CubeTexture => {\r\n throw _WarnImport(\"CubeTexture\");\r\n };\r\n /**\r\n * @internal\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public static _CreateMirror = (name: string, renderTargetSize: number, scene: Scene, generateMipMaps: boolean): MirrorTexture => {\r\n throw _WarnImport(\"MirrorTexture\");\r\n };\r\n /**\r\n * @internal\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public static _CreateRenderTargetTexture = (name: string, renderTargetSize: number, scene: Scene, generateMipMaps: boolean, creationFlags?: number): RenderTargetTexture => {\r\n throw _WarnImport(\"RenderTargetTexture\");\r\n };\r\n\r\n /** nearest is mag = nearest and min = nearest and no mip */\r\n public static readonly NEAREST_SAMPLINGMODE = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n /** nearest is mag = nearest and min = nearest and mip = linear */\r\n public static readonly NEAREST_NEAREST_MIPLINEAR = Constants.TEXTURE_NEAREST_NEAREST_MIPLINEAR; // nearest is mag = nearest and min = nearest and mip = linear\r\n\r\n /** Bilinear is mag = linear and min = linear and no mip */\r\n public static readonly BILINEAR_SAMPLINGMODE = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n /** Bilinear is mag = linear and min = linear and mip = nearest */\r\n public static readonly LINEAR_LINEAR_MIPNEAREST = Constants.TEXTURE_LINEAR_LINEAR_MIPNEAREST; // Bilinear is mag = linear and min = linear and mip = nearest\r\n\r\n /** Trilinear is mag = linear and min = linear and mip = linear */\r\n public static readonly TRILINEAR_SAMPLINGMODE = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE;\r\n /** Trilinear is mag = linear and min = linear and mip = linear */\r\n public static readonly LINEAR_LINEAR_MIPLINEAR = Constants.TEXTURE_LINEAR_LINEAR_MIPLINEAR; // Trilinear is mag = linear and min = linear and mip = linear\r\n\r\n /** mag = nearest and min = nearest and mip = nearest */\r\n public static readonly NEAREST_NEAREST_MIPNEAREST = Constants.TEXTURE_NEAREST_NEAREST_MIPNEAREST;\r\n /** mag = nearest and min = linear and mip = nearest */\r\n public static readonly NEAREST_LINEAR_MIPNEAREST = Constants.TEXTURE_NEAREST_LINEAR_MIPNEAREST;\r\n /** mag = nearest and min = linear and mip = linear */\r\n public static readonly NEAREST_LINEAR_MIPLINEAR = Constants.TEXTURE_NEAREST_LINEAR_MIPLINEAR;\r\n /** mag = nearest and min = linear and mip = none */\r\n public static readonly NEAREST_LINEAR = Constants.TEXTURE_NEAREST_LINEAR;\r\n /** mag = nearest and min = nearest and mip = none */\r\n public static readonly NEAREST_NEAREST = Constants.TEXTURE_NEAREST_NEAREST;\r\n /** mag = linear and min = nearest and mip = nearest */\r\n public static readonly LINEAR_NEAREST_MIPNEAREST = Constants.TEXTURE_LINEAR_NEAREST_MIPNEAREST;\r\n /** mag = linear and min = nearest and mip = linear */\r\n public static readonly LINEAR_NEAREST_MIPLINEAR = Constants.TEXTURE_LINEAR_NEAREST_MIPLINEAR;\r\n /** mag = linear and min = linear and mip = none */\r\n public static readonly LINEAR_LINEAR = Constants.TEXTURE_LINEAR_LINEAR;\r\n /** mag = linear and min = nearest and mip = none */\r\n public static readonly LINEAR_NEAREST = Constants.TEXTURE_LINEAR_NEAREST;\r\n\r\n /** Explicit coordinates mode */\r\n public static readonly EXPLICIT_MODE = Constants.TEXTURE_EXPLICIT_MODE;\r\n /** Spherical coordinates mode */\r\n public static readonly SPHERICAL_MODE = Constants.TEXTURE_SPHERICAL_MODE;\r\n /** Planar coordinates mode */\r\n public static readonly PLANAR_MODE = Constants.TEXTURE_PLANAR_MODE;\r\n /** Cubic coordinates mode */\r\n public static readonly CUBIC_MODE = Constants.TEXTURE_CUBIC_MODE;\r\n /** Projection coordinates mode */\r\n public static readonly PROJECTION_MODE = Constants.TEXTURE_PROJECTION_MODE;\r\n /** Inverse Cubic coordinates mode */\r\n public static readonly SKYBOX_MODE = Constants.TEXTURE_SKYBOX_MODE;\r\n /** Inverse Cubic coordinates mode */\r\n public static readonly INVCUBIC_MODE = Constants.TEXTURE_INVCUBIC_MODE;\r\n /** Equirectangular coordinates mode */\r\n public static readonly EQUIRECTANGULAR_MODE = Constants.TEXTURE_EQUIRECTANGULAR_MODE;\r\n /** Equirectangular Fixed coordinates mode */\r\n public static readonly FIXED_EQUIRECTANGULAR_MODE = Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MODE;\r\n /** Equirectangular Fixed Mirrored coordinates mode */\r\n public static readonly FIXED_EQUIRECTANGULAR_MIRRORED_MODE = Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE;\r\n\r\n /** Texture is not repeating outside of 0..1 UVs */\r\n public static readonly CLAMP_ADDRESSMODE = Constants.TEXTURE_CLAMP_ADDRESSMODE;\r\n /** Texture is repeating outside of 0..1 UVs */\r\n public static readonly WRAP_ADDRESSMODE = Constants.TEXTURE_WRAP_ADDRESSMODE;\r\n /** Texture is repeating and mirrored */\r\n public static readonly MIRROR_ADDRESSMODE = Constants.TEXTURE_MIRROR_ADDRESSMODE;\r\n\r\n /**\r\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\r\n */\r\n public static UseSerializedUrlIfAny = false;\r\n\r\n /**\r\n * Define the url of the texture.\r\n */\r\n @serialize()\r\n public url: Nullable<string> = null;\r\n\r\n /**\r\n * Define an offset on the texture to offset the u coordinates of the UVs\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#offsetting\r\n */\r\n @serialize()\r\n public uOffset = 0;\r\n\r\n /**\r\n * Define an offset on the texture to offset the v coordinates of the UVs\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#offsetting\r\n */\r\n @serialize()\r\n public vOffset = 0;\r\n\r\n /**\r\n * Define an offset on the texture to scale the u coordinates of the UVs\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#tiling\r\n */\r\n @serialize()\r\n public uScale = 1.0;\r\n\r\n /**\r\n * Define an offset on the texture to scale the v coordinates of the UVs\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#tiling\r\n */\r\n @serialize()\r\n public vScale = 1.0;\r\n\r\n /**\r\n * Define an offset on the texture to rotate around the u coordinates of the UVs\r\n * The angle is defined in radians.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials\r\n */\r\n @serialize()\r\n public uAng = 0;\r\n\r\n /**\r\n * Define an offset on the texture to rotate around the v coordinates of the UVs\r\n * The angle is defined in radians.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials\r\n */\r\n @serialize()\r\n public vAng = 0;\r\n\r\n /**\r\n * Define an offset on the texture to rotate around the w coordinates of the UVs (in case of 3d texture)\r\n * The angle is defined in radians.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials\r\n */\r\n @serialize()\r\n public wAng = 0;\r\n\r\n /**\r\n * Defines the center of rotation (U)\r\n */\r\n @serialize()\r\n public uRotationCenter = 0.5;\r\n\r\n /**\r\n * Defines the center of rotation (V)\r\n */\r\n @serialize()\r\n public vRotationCenter = 0.5;\r\n\r\n /**\r\n * Defines the center of rotation (W)\r\n */\r\n @serialize()\r\n public wRotationCenter = 0.5;\r\n\r\n /**\r\n * Sets this property to true to avoid deformations when rotating the texture with non-uniform scaling\r\n */\r\n @serialize()\r\n public homogeneousRotationInUVTransform = false;\r\n\r\n /**\r\n * Are mip maps generated for this texture or not.\r\n */\r\n get noMipmap(): boolean {\r\n return this._noMipmap;\r\n }\r\n\r\n /**\r\n * List of inspectable custom properties (used by the Inspector)\r\n * @see https://doc.babylonjs.com/toolsAndResources/inspector#extensibility\r\n */\r\n public inspectableCustomProperties: Nullable<IInspectable[]> = null;\r\n\r\n /** @internal */\r\n public _noMipmap: boolean = false;\r\n /** @internal */\r\n public _invertY: boolean = false;\r\n private _rowGenerationMatrix: Nullable<Matrix> = null;\r\n private _cachedTextureMatrix: Nullable<Matrix> = null;\r\n private _projectionModeMatrix: Nullable<Matrix> = null;\r\n private _t0: Nullable<Vector3> = null;\r\n private _t1: Nullable<Vector3> = null;\r\n private _t2: Nullable<Vector3> = null;\r\n\r\n private _cachedUOffset: number = -1;\r\n private _cachedVOffset: number = -1;\r\n private _cachedUScale: number = 0;\r\n private _cachedVScale: number = 0;\r\n private _cachedUAng: number = -1;\r\n private _cachedVAng: number = -1;\r\n private _cachedWAng: number = -1;\r\n private _cachedReflectionProjectionMatrixId: number = -1;\r\n private _cachedURotationCenter: number = -1;\r\n private _cachedVRotationCenter: number = -1;\r\n private _cachedWRotationCenter: number = -1;\r\n private _cachedHomogeneousRotationInUVTransform: boolean = false;\r\n\r\n private _cachedReflectionTextureMatrix: Nullable<Matrix> = null;\r\n private _cachedReflectionUOffset = -1;\r\n private _cachedReflectionVOffset = -1;\r\n private _cachedReflectionUScale = 0;\r\n private _cachedReflectionVScale = 0;\r\n private _cachedReflectionCoordinatesMode = -1;\r\n\r\n /** @internal */\r\n public _buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob | ImageBitmap> = null;\r\n private _deleteBuffer: boolean = false;\r\n protected _format: Nullable<number> = null;\r\n private _delayedOnLoad: Nullable<() => void> = null;\r\n private _delayedOnError: Nullable<() => void> = null;\r\n private _mimeType?: string;\r\n private _loaderOptions?: any;\r\n private _creationFlags?: number;\r\n /** @internal */\r\n public _useSRGBBuffer?: boolean;\r\n private _forcedExtension?: string;\r\n\r\n /** Returns the texture mime type if it was defined by a loader (undefined else) */\r\n public get mimeType() {\r\n return this._mimeType;\r\n }\r\n\r\n /**\r\n * Observable triggered once the texture has been loaded.\r\n */\r\n public onLoadObservable: Observable<Texture> = new Observable<Texture>();\r\n\r\n protected _isBlocking: boolean = true;\r\n /**\r\n * Is the texture preventing material to render while loading.\r\n * If false, a default texture will be used instead of the loading one during the preparation step.\r\n */\r\n public set isBlocking(value: boolean) {\r\n this._isBlocking = value;\r\n }\r\n @serialize()\r\n public get isBlocking(): boolean {\r\n return this._isBlocking;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if the texture needs to be inverted on the y axis during loading\r\n */\r\n public get invertY(): boolean {\r\n return this._invertY;\r\n }\r\n\r\n /**\r\n * Instantiates a new texture.\r\n * This represents a texture in babylon. It can be easily loaded from a network, base64 or html input.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction#texture\r\n * @param url defines the url of the picture to load as a texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param noMipmapOrOptions defines if the texture will require mip maps or not or set of all options to create the texture\r\n * @param invertY defines if the texture needs to be inverted on the y axis during loading\r\n * @param samplingMode defines the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...)\r\n * @param onLoad defines a callback triggered when the texture has been loaded\r\n * @param onError defines a callback triggered when an error occurred during the loading session\r\n * @param buffer defines the buffer to load the texture from in case the texture is loaded from a buffer representation\r\n * @param deleteBuffer defines if the buffer we are loading the texture from should be deleted after load\r\n * @param format defines the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)\r\n * @param mimeType defines an optional mime type information\r\n * @param loaderOptions options to be passed to the loader\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @param forcedExtension defines the extension to use to pick the right loader\r\n */\r\n constructor(\r\n url: Nullable<string>,\r\n sceneOrEngine?: Nullable<Scene | ThinEngine>,\r\n noMipmapOrOptions?: boolean | ITextureCreationOptions,\r\n invertY?: boolean,\r\n samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE,\r\n onLoad: Nullable<() => void> = null,\r\n onError: Nullable<(message?: string, exception?: any) => void> = null,\r\n buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob | ImageBitmap> = null,\r\n deleteBuffer: boolean = false,\r\n format?: number,\r\n mimeType?: string,\r\n loaderOptions?: any,\r\n creationFlags?: number,\r\n forcedExtension?: string\r\n ) {\r\n super(sceneOrEngine);\r\n\r\n this.name = url || \"\";\r\n this.url = url;\r\n\r\n let noMipmap: boolean;\r\n let useSRGBBuffer: boolean = false;\r\n let internalTexture: Nullable<InternalTexture> = null;\r\n\r\n if (typeof noMipmapOrOptions === \"object\" && noMipmapOrOptions !== null) {\r\n noMipmap = noMipmapOrOptions.noMipmap ?? false;\r\n invertY = noMipmapOrOptions.invertY ?? (CompatibilityOptions.UseOpenGLOrientationForUV ? false : true);\r\n samplingMode = noMipmapOrOptions.samplingMode ?? Texture.TRILINEAR_SAMPLINGMODE;\r\n onLoad = noMipmapOrOptions.onLoad ?? null;\r\n onError = noMipmapOrOptions.onError ?? null;\r\n buffer = noMipmapOrOptions.buffer ?? null;\r\n deleteBuffer = noMipmapOrOptions.deleteBuffer ?? false;\r\n format = noMipmapOrOptions.format;\r\n mimeType = noMipmapOrOptions.mimeType;\r\n loaderOptions = noMipmapOrOptions.loaderOptions;\r\n creationFlags = noMipmapOrOptions.creationFlags;\r\n useSRGBBuffer = noMipmapOrOptions.useSRGBBuffer ?? false;\r\n internalTexture = noMipmapOrOptions.internalTexture ?? null;\r\n } else {\r\n noMipmap = !!noMipmapOrOptions;\r\n }\r\n\r\n this._noMipmap = noMipmap;\r\n this._invertY = invertY === undefined ? (CompatibilityOptions.UseOpenGLOrientationForUV ? false : true) : invertY;\r\n this._initialSamplingMode = samplingMode;\r\n this._buffer = buffer;\r\n this._deleteBuffer = deleteBuffer;\r\n this._mimeType = mimeType;\r\n this._loaderOptions = loaderOptions;\r\n this._creationFlags = creationFlags;\r\n this._useSRGBBuffer = useSRGBBuffer;\r\n this._forcedExtension = forcedExtension;\r\n if (format) {\r\n this._format = format;\r\n }\r\n\r\n const scene = this.getScene();\r\n const engine = this._getEngine();\r\n if (!engine) {\r\n return;\r\n }\r\n\r\n engine.onBeforeTextureInitObservable.notifyObservers(this);\r\n\r\n const load = () => {\r\n if (this._texture) {\r\n if (this._texture._invertVScale) {\r\n this.vScale *= -1;\r\n this.vOffset += 1;\r\n }\r\n\r\n // Update texture to match internal texture's wrapping\r\n if (this._texture._cachedWrapU !== null) {\r\n this.wrapU = this._texture._cachedWrapU;\r\n this._texture._cachedWrapU = null;\r\n }\r\n if (this._texture._cachedWrapV !== null) {\r\n this.wrapV = this._texture._cachedWrapV;\r\n this._texture._cachedWrapV = null;\r\n }\r\n if (this._texture._cachedWrapR !== null) {\r\n this.wrapR = this._texture._cachedWrapR;\r\n this._texture._cachedWrapR = null;\r\n }\r\n }\r\n\r\n if (this.onLoadObservable.hasObservers()) {\r\n this.onLoadObservable.notifyObservers(this);\r\n }\r\n if (onLoad) {\r\n onLoad();\r\n }\r\n\r\n if (!this.isBlocking && scene) {\r\n scene.resetCachedMaterial();\r\n }\r\n };\r\n\r\n const errorHandler = (message?: string, exception?: any) => {\r\n this._loadingError = true;\r\n this._errorObject = { message, exception };\r\n if (onError) {\r\n onError(message, exception);\r\n }\r\n Texture.OnTextureLoadErrorObservable.notifyObservers(this);\r\n };\r\n\r\n if (!this.url && !internalTexture) {\r\n this._delayedOnLoad = load;\r\n this._delayedOnError = errorHandler;\r\n return;\r\n }\r\n\r\n this._texture = internalTexture ?? this._getFromCache(this.url, noMipmap, samplingMode, this._invertY, useSRGBBuffer);\r\n\r\n if (!this._texture) {\r\n if (!scene || !scene.useDelayedTextureLoading) {\r\n try {\r\n this._texture = engine.createTexture(\r\n this.url,\r\n noMipmap,\r\n this._invertY,\r\n scene,\r\n samplingMode,\r\n load,\r\n errorHandler,\r\n this._buffer,\r\n undefined,\r\n this._format,\r\n this._forcedExtension,\r\n mimeType,\r\n loaderOptions,\r\n creationFlags,\r\n useSRGBBuffer\r\n );\r\n } catch (e) {\r\n errorHandler(\"error loading\", e);\r\n throw e;\r\n }\r\n if (deleteBuffer) {\r\n this._buffer = null;\r\n }\r\n } else {\r\n this.delayLoadState = Constants.DELAYLOADSTATE_NOTLOADED;\r\n\r\n this._delayedOnLoad = load;\r\n this._delayedOnError = errorHandler;\r\n }\r\n } else {\r\n if (this._texture.isReady) {\r\n TimingTools.SetImmediate(() => load());\r\n } else {\r\n const loadObserver = this._texture.onLoadedObservable.add(load);\r\n this._texture.onErrorObservable.add((e) => {\r\n errorHandler(e.message, e.exception);\r\n this._texture?.onLoadedObservable.remove(loadObserver);\r\n });\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Update the url (and optional buffer) of this texture if url was null during construction.\r\n * @param url the url of the texture\r\n * @param buffer the buffer of the texture (defaults to null)\r\n * @param onLoad callback called when the texture is loaded (defaults to null)\r\n * @param forcedExtension defines the extension to use to pick the right loader\r\n */\r\n public updateURL(\r\n url: string,\r\n buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob | ImageBitmap> = null,\r\n onLoad?: () => void,\r\n forcedExtension?: string\r\n ): void {\r\n if (this.url) {\r\n this.releaseInternalTexture();\r\n this.getScene()!.markAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);\r\n }\r\n\r\n if (!this.name || this.name.startsWith(\"data:\")) {\r\n this.name = url;\r\n }\r\n this.url = url;\r\n this._buffer = buffer;\r\n this._forcedExtension = forcedExtension;\r\n this.delayLoadState = Constants.DELAYLOADSTATE_NOTLOADED;\r\n\r\n if (onLoad) {\r\n this._delayedOnLoad = onLoad;\r\n }\r\n this.delayLoad();\r\n }\r\n\r\n /**\r\n * Finish the loading sequence of a texture flagged as delayed load.\r\n * @internal\r\n */\r\n public delayLoad(): void {\r\n if (this.delayLoadState !== Constants.DELAYLOADSTATE_NOTLOADED) {\r\n return;\r\n }\r\n\r\n const scene = this.getScene();\r\n if (!scene) {\r\n return;\r\n }\r\n\r\n this.delayLoadState = Constants.DELAYLOADSTATE_LOADED;\r\n this._texture = this._getFromCache(this.url, this._noMipmap, this.samplingMode, this._invertY, this._useSRGBBuffer);\r\n\r\n if (!this._texture) {\r\n this._texture = scene\r\n .getEngine()\r\n .createTexture(\r\n this.url,\r\n this._noMipmap,\r\n this._invertY,\r\n scene,\r\n this.samplingMode,\r\n this._delayedOnLoad,\r\n this._delayedOnError,\r\n this._buffer,\r\n null,\r\n this._format,\r\n this._forcedExtension,\r\n this._mimeType,\r\n this._loaderOptions,\r\n this._creationFlags,\r\n this._useSRGBBuffer\r\n );\r\n if (this._deleteBuffer) {\r\n this._buffer = null;\r\n }\r\n } else {\r\n if (this._delayedOnLoad) {\r\n if (this._texture.isReady) {\r\n TimingTools.SetImmediate(this._delayedOnLoad);\r\n } else {\r\n this._texture.onLoadedObservable.add(this._delayedOnLoad);\r\n }\r\n }\r\n }\r\n\r\n this._delayedOnLoad = null;\r\n this._delayedOnError = null;\r\n }\r\n\r\n private _prepareRowForTextureGeneration(x: number, y: number, z: number, t: Vector3): void {\r\n x *= this._cachedUScale;\r\n y *= this._cachedVScale;\r\n\r\n x -= this.uRotationCenter * this._cachedUScale;\r\n y -= this.vRotationCenter * this._cachedVScale;\r\n z -= this.wRotationCenter;\r\n\r\n Vector3.TransformCoordinatesFromFloatsToRef(x, y, z, this._rowGenerationMatrix!, t);\r\n\r\n t.x += this.uRotationCenter * this._cachedUScale + this._cachedUOffset;\r\n t.y += this.vRotationCenter * this._cachedVScale + this._cachedVOffset;\r\n t.z += this.wRotationCenter;\r\n }\r\n\r\n /**\r\n * Checks if the texture has the same transform matrix than another texture\r\n * @param texture texture to check against\r\n * @returns true if the transforms are the same, else false\r\n */\r\n public checkTransformsAreIdentical(texture: Nullable<Texture>): boolean {\r\n return (\r\n texture !== null &&\r\n this.uOffset === texture.uOffset &&\r\n this.vOffset === texture.vOffset &&\r\n this.uScale === texture.uScale &&\r\n this.vScale === texture.vScale &&\r\n this.uAng === texture.uAng &&\r\n this.vAng === texture.vAng &&\r\n this.wAng === texture.wAng\r\n );\r\n }\r\n\r\n /**\r\n * Get the current texture matrix which includes the requested offsetting, tiling and rotation components.\r\n * @param uBase\r\n * @returns the transform matrix of the texture.\r\n */\r\n public getTextureMatrix(uBase = 1): Matrix {\r\n if (\r\n this.uOffset === this._cachedUOffset &&\r\n this.vOffset === this._cachedVOffset &&\r\n this.uScale * uBase === this._cachedUScale &&\r\n this.vScale === this._cachedVScale &&\r\n this.uAng === this._cachedUAng &&\r\n this.vAng === this._cachedVAng &&\r\n this.wAng === this._cachedWAng &&\r\n this.uRotationCenter === this._cachedURotationCenter &&\r\n this.vRotationCenter === this._cachedVRotationCenter &&\r\n this.wRotationCenter === this._cachedWRotationCenter &&\r\n this.homogeneousRotationInUVTransform === this._cachedHomogeneousRotationInUVTransform\r\n ) {\r\n return this._cachedTextureMatrix!;\r\n }\r\n\r\n this._cachedUOffset = this.uOffset;\r\n this._cachedVOffset = this.vOffset;\r\n this._cachedUScale = this.uScale * uBase;\r\n this._cachedVScale = this.vScale;\r\n this._cachedUAng = this.uAng;\r\n this._cachedVAng = this.vAng;\r\n this._cachedWAng = this.wAng;\r\n this._cachedURotationCenter = this.uRotationCenter;\r\n this._cachedVRotationCenter = this.vRotationCenter;\r\n this._cachedWRotationCenter = this.wRotationCenter;\r\n this._cachedHomogeneousRotationInUVTransform = this.homogeneousRotationInUVTransform;\r\n\r\n if (!this._cachedTextureMatrix || !this._rowGenerationMatrix) {\r\n this._cachedTextureMatrix = Matrix.Zero();\r\n this._rowGenerationMatrix = new Matrix();\r\n this._t0 = Vector3.Zero();\r\n this._t1 = Vector3.Zero();\r\n this._t2 = Vector3.Zero();\r\n }\r\n\r\n Matrix.RotationYawPitchRollToRef(this.vAng, this.uAng, this.wAng, this._rowGenerationMatrix!);\r\n\r\n if (this.homogeneousRotationInUVTransform) {\r\n Matrix.TranslationToRef(-this._cachedURotationCenter, -this._cachedVRotationCenter, -this._cachedWRotationCenter, TmpVectors.Matrix[0]);\r\n Matrix.TranslationToRef(this._cachedURotationCenter, this._cachedVRotationCenter, this._cachedWRotationCenter, TmpVectors.Matrix[1]);\r\n Matrix.ScalingToRef(this._cachedUScale, this._cachedVScale, 0, TmpVectors.Matrix[2]);\r\n Matrix.TranslationToRef(this._cachedUOffset, this._cachedVOffset, 0, TmpVectors.Matrix[3]);\r\n\r\n TmpVectors.Matrix[0].multiplyToRef(this._rowGenerationMatrix!, this._cachedTextureMatrix);\r\n this._cachedTextureMatrix.multiplyToRef(TmpVectors.Matrix[1], this._cachedTextureMatrix);\r\n this._cachedTextureMatrix.multiplyToRef(TmpVectors.Matrix[2], this._cachedTextureMatrix);\r\n this._cachedTextureMatrix.multiplyToRef(TmpVectors.Matrix[3], this._cachedTextureMatrix);\r\n\r\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)\r\n this._cachedTextureMatrix.setRowFromFloats(2, this._cachedTextureMatrix.m[12], this._cachedTextureMatrix.m[13], this._cachedTextureMatrix.m[14], 1);\r\n } else {\r\n this._prepareRowForTextureGeneration(0, 0, 0, this._t0!);\r\n this._prepareRowForTextureGeneration(1.0, 0, 0, this._t1!);\r\n this._prepareRowForTextureGeneration(0, 1.0, 0, this._t2!);\r\n\r\n this._t1!.subtractInPlace(this._t0!);\r\n this._t2!.subtractInPlace(this._t0!);\r\n\r\n Matrix.FromValuesToRef(\r\n this._t1!.x,\r\n this._t1!.y,\r\n this._t1!.z,\r\n 0.0,\r\n this._t2!.x,\r\n this._t2!.y,\r\n this._t2!.z,\r\n 0.0,\r\n this._t0!.x,\r\n this._t0!.y,\r\n this._t0!.z,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 1.0,\r\n this._cachedTextureMatrix\r\n );\r\n }\r\n\r\n const scene = this.getScene();\r\n\r\n if (!scene) {\r\n return this._cachedTextureMatrix;\r\n }\r\n\r\n if (this.optimizeUVAllocation) {\r\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\r\n // will get different values (see MaterialHelper.PrepareDefinesForMergedUV), meaning we should regenerate the effect accordingly\r\n scene.markAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag, (mat) => {\r\n return mat.hasTexture(this);\r\n });\r\n }\r\n\r\n return this._cachedTextureMatrix;\r\n }\r\n\r\n /**\r\n * Get the current matrix used to apply reflection. This is useful to rotate an environment texture for instance.\r\n * @returns The reflection texture transform\r\n */\r\n public getReflectionTextureMatrix(): Matrix {\r\n const scene = this.getScene();\r\n\r\n if (!scene) {\r\n return this._cachedReflectionTextureMatrix!;\r\n }\r\n\r\n if (\r\n this.uOffset === this._cachedReflectionUOffset &&\r\n this.vOffset === this._cachedReflectionVOffset &&\r\n this.uScale === this._cachedReflectionUScale &&\r\n this.vScale === this._cachedReflectionVScale &&\r\n this.coordinatesMode === this._cachedReflectionCoordinatesMode\r\n ) {\r\n if (this.coordinatesMode === Texture.PROJECTION_MODE) {\r\n if (this._cachedReflectionProjectionMatrixId === scene.getProjectionMatrix().updateFlag) {\r\n return this._cachedReflectionTextureMatrix!;\r\n }\r\n } else {\r\n return this._cachedReflectionTextureMatrix!;\r\n }\r\n }\r\n\r\n if (!this._cachedReflectionTextureMatrix) {\r\n this._cachedReflectionTextureMatrix = Matrix.Zero();\r\n }\r\n\r\n if (!this._projectionModeMatrix) {\r\n this._projectionModeMatrix = Matrix.Zero();\r\n }\r\n\r\n const flagMaterialsAsTextureDirty = this._cachedReflectionCoordinatesMode !== this.coordinatesMode;\r\n\r\n this._cachedReflectionUOffset = this.uOffset;\r\n this._cachedReflectionVOffset = this.vOffset;\r\n this._cachedReflectionUScale = this.uScale;\r\n this._cachedReflectionVScale = this.vScale;\r\n this._cachedReflectionCoordinatesMode = this.coordinatesMode;\r\n\r\n switch (this.coordinatesMode) {\r\n case Texture.PLANAR_MODE: {\r\n Matrix.IdentityToRef(this._cachedReflectionTextureMatrix);\r\n (<any>this._cachedReflectionTextureMatrix)[0] = this.uScale;\r\n (<any>this._cachedReflectionTextureMatrix)[5] = this.vScale;\r\n (<any>this._cachedReflectionTextureMatrix)[12] = this.uOffset;\r\n (<any>this._cachedReflectionTextureMatrix)[13] = this.vOffset;\r\n break;\r\n }\r\n case Texture.PROJECTION_MODE: {\r\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);\r\n\r\n const projectionMatrix = scene.getProjectionMatrix();\r\n this._cachedReflectionProjectionMatrixId = projectionMatrix.updateFlag;\r\n projectionMatrix.multiplyToRef(this._projectionModeMatrix, this._cachedReflectionTextureMatrix);\r\n break;\r\n }\r\n default:\r\n Matrix.IdentityToRef(this._cachedReflectionTextureMatrix);\r\n break;\r\n }\r\n\r\n if (flagMaterialsAsTextureDirty) {\r\n // We flag the materials that are using this texture as \"texture dirty\" if the coordinatesMode has changed.\r\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\r\n scene.markAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag, (mat) => {\r\n return mat.getActiveTextures().indexOf(this) !== -1;\r\n });\r\n }\r\n\r\n return this._cachedReflectionTextureMatrix;\r\n }\r\n\r\n /**\r\n * Clones the texture.\r\n * @returns the cloned texture\r\n */\r\n public clone(): Texture {\r\n const options: ITextureCreationOptions = {\r\n noMipmap: this._noMipmap,\r\n invertY: this._invertY,\r\n samplingMode: this.samplingMode,\r\n onLoad: undefined,\r\n onError: undefined,\r\n buffer: this._texture ? this._texture._buffer : undefined,\r\n deleteBuffer: this._deleteBuffer,\r\n format: this.textureFormat,\r\n mimeType: this.mimeType,\r\n loaderOptions: this._loaderOptions,\r\n creationFlags: this._creationFlags,\r\n useSRGBBuffer: this._useSRGBBuffer,\r\n };\r\n\r\n return SerializationHelper.Clone(() => {\r\n return new Texture(this._texture ? this._texture.url : null, this.getScene(), options);\r\n }, this);\r\n }\r\n\r\n /**\r\n * Serialize the texture to a JSON representation we can easily use in the respective Parse function.\r\n * @returns The JSON representation of the texture\r\n */\r\n public serialize(): any {\r\n const savedName = this.name;\r\n\r\n if (!Texture.SerializeBuffers) {\r\n if (this.name.startsWith(\"data:\")) {\r\n this.name = \"\";\r\n }\r\n }\r\n\r\n if (this.name.startsWith(\"data:\") && this.url === this.name) {\r\n this.url = \"\";\r\n }\r\n\r\n const serializationObject = super.serialize(Texture._SerializeInternalTextureUniqueId);\r\n\r\n if (!serializationObject) {\r\n return null;\r\n }\r\n\r\n if (Texture.SerializeBuffers || Texture.ForceSerializeBuffers) {\r\n if (typeof this._buffer === \"string\" && (this._buffer as string).substr(0, 5) === \"data:\") {\r\n serializationObject.base64String = this._buffer;\r\n serializationObject.name = serializationObject.name.replace(\"data:\", \"\");\r\n } else if (this.url && this.url.startsWith(\"data:\") && this._buffer instanceof Uint8Array) {\r\n serializationObject.base64String = \"data:image/png;base64,\" + EncodeArrayBufferToBase64(this._buffer);\r\n } else if (Texture.ForceSerializeBuffers || (this.url && this.url.startsWith(\"blob:\")) || this._forceSerialize) {\r\n serializationObject.base64String =\r\n !this._engine || this._engine._features.supportSyncTextureRead ? GenerateBase64StringFromTexture(this) : GenerateBase64StringFromTextureAsync(this);\r\n }\r\n }\r\n\r\n serializationObject.invertY = this._invertY;\r\n serializationObject.samplingMode = this.samplingMode;\r\n serializationObject._creationFlags = this._creationFlags;\r\n serializationObject._useSRGBBuffer = this._useSRGBBuffer;\r\n if (Texture._SerializeInternalTextureUniqueId) {\r\n serializationObject.internalTextureUniqueId = this._texture?.uniqueId ?? undefined;\r\n }\r\n\r\n this.name = savedName;\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Get the current class name of the texture useful for serialization or dynamic coding.\r\n * @returns \"Texture\"\r\n */\r\n public getClassName(): string {\r\n return \"Texture\";\r\n }\r\n\r\n /**\r\n * Dispose the texture and release its associated resources.\r\n */\r\n public dispose(): void {\r\n super.dispose();\r\n\r\n this.onLoadObservable.clear();\r\n\r\n this._delayedOnLoad = null;\r\n this._delayedOnError = null;\r\n this._buffer = null;\r\n }\r\n\r\n /**\r\n * Parse the JSON representation of a texture in order to recreate the texture in the given scene.\r\n * @param parsedTexture Define the JSON representation of the texture\r\n * @param scene Define the scene the parsed texture should be instantiated in\r\n * @param rootUrl Define the root url of the parsing sequence in the case of relative dependencies\r\n * @returns The parsed texture if successful\r\n */\r\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): Nullable<BaseTexture> {\r\n if (parsedTexture.customType) {\r\n const customTexture = InstantiationTools.Instantiate(parsedTexture.customType);\r\n // Update Sampling Mode\r\n const parsedCustomTexture: any = customTexture.Parse(parsedTexture, scene, rootUrl);\r\n if (parsedTexture.samplingMode && parsedCustomTexture.updateSamplingMode && parsedCustomTexture._samplingMode) {\r\n if (parsedCustomTexture._samplingMode !== parsedTexture.samplingMode) {\r\n parsedCustomTexture.updateSamplingMode(parsedTexture.samplingMode);\r\n }\r\n }\r\n return parsedCustomTexture;\r\n }\r\n\r\n if (parsedTexture.isCube && !parsedTexture.isRenderTarget) {\r\n return Texture._CubeTextureParser(parsedTexture, scene, rootUrl);\r\n }\r\n\r\n const hasInternalTextureUniqueId = parsedTexture.internalTextureUniqueId !== undefined;\r\n\r\n if (!parsedTexture.name && !parsedTexture.isRenderTarget && !hasInternalTextureUniqueId) {\r\n return null;\r\n }\r\n\r\n let internalTexture: InternalTexture | undefined;\r\n\r\n if (hasInternalTextureUniqueId) {\r\n const cache = scene.getEngine().getLoadedTexturesCache();\r\n for (const texture of cache) {\r\n if (texture.uniqueId === parsedTexture.internalTextureUniqueId) {\r\n internalTexture = texture;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n const onLoaded = (texture: Texture | null) => {\r\n // Clear cache\r\n if (texture && texture._texture) {\r\n texture._texture._cachedWrapU = null;\r\n texture._texture._cachedWrapV = null;\r\n texture._texture._cachedWrapR = null;\r\n }\r\n\r\n // Update Sampling Mode\r\n if (parsedTexture.samplingMode) {\r\n const sampling: number = parsedTexture.samplingMode;\r\n if (texture && texture.samplingMode !== sampling) {\r\n texture.updateSamplingMode(sampling);\r\n }\r\n }\r\n // Animations\r\n if (texture && parsedTexture.animations) {\r\n for (let animationIndex = 0; animationIndex < parsedTexture.animations.length; animationIndex++) {\r\n const parsedAnimation = parsedTexture.animations[animationIndex];\r\n const internalClass = GetClass(\"BABYLON.Animation\");\r\n if (internalClass) {\r\n texture.animations.push(internalClass.Parse(parsedAnimation));\r\n }\r\n }\r\n }\r\n\r\n if (hasInternalTextureUniqueId && !internalTexture) {\r\n texture?._texture?._setUniqueId(parsedTexture.internalTextureUniqueId);\r\n }\r\n };\r\n\r\n const texture = SerializationHelper.Parse(\r\n () => {\r\n let generateMipMaps: boolean = true;\r\n if (parsedTexture.noMipmap) {\r\n generateMipMaps = false;\r\n }\r\n if (parsedTexture.mirrorPlane) {\r\n const mirrorTexture = Texture._CreateMirror(parsedTexture.name, parsedTexture.renderTargetSize, scene, generateMipMaps);\r\n mirrorTexture._waitingRenderList = parsedTexture.renderList;\r\n mirrorTexture.mirrorPlane = Plane.FromArray(parsedTexture.mirrorPlane);\r\n onLoaded(mirrorTexture);\r\n return mirrorTexture;\r\n } else if (parsedTexture.isRenderTarget) {\r\n let renderTargetTexture: Nullable<RenderTargetTexture> = null;\r\n if (parsedTexture.isCube) {\r\n // Search for an existing reflection probe (which contains a cube render target texture)\r\n if (scene.reflectionProbes) {\r\n for (let index = 0; index < scene.reflectionProbes.length; index++) {\r\n const probe = scene.reflectionProbes[index];\r\n if (probe.name === parsedTexture.name) {\r\n return probe.cubeTexture;\r\n }\r\n }\r\n }\r\n } else {\r\n renderTargetTexture = Texture._CreateRenderTargetTexture(\r\n parsedTexture.name,\r\n parsedTexture.renderTargetSize,\r\n scene,\r\n generateMipMaps,\r\n parsedTexture._creationFlags ?? 0\r\n );\r\n renderTargetTexture._waitingRenderList = parsedTexture.renderList;\r\n }\r\n onLoaded(renderTargetTexture);\r\n return renderTargetTexture;\r\n } else {\r\n let texture: Texture;\r\n\r\n if (parsedTexture.base64String && !internalTexture) {\r\n // name and url are the same to ensure caching happens from the actual base64 string\r\n texture = Texture.CreateFromBase64String(\r\n parsedTexture.base64String,\r\n parsedTexture.base64String,\r\n scene,\r\n !generateMipMaps,\r\n parsedTexture.invertY,\r\n parsedTexture.samplingMode,\r\n () => {\r\n onLoaded(texture);\r\n },\r\n parsedTexture._creationFlags ?? 0,\r\n parsedTexture._useSRGBBuffer ?? false\r\n );\r\n\r\n // prettier name to fit with the loaded data\r\n texture.name = parsedTexture.name;\r\n } else {\r\n let url: string;\r\n if (parsedTexture.name && parsedTexture.name.indexOf(\"://\") > 0) {\r\n url = parsedTexture.name;\r\n } else {\r\n url = rootUrl + parsedTexture.name;\r\n }\r\n\r\n if (parsedTexture.url && (parsedTexture.url.startsWith(\"data:\") || Texture.UseSerializedUrlIfAny)) {\r\n url = parsedTexture.url;\r\n }\r\n\r\n const options: ITextureCreationOptions = {\r\n noMipmap: !generateMipMaps,\r\n invertY: parsedTexture.invertY,\r\n samplingMode: parsedTexture.samplingMode,\r\n onLoad: () => {\r\n onLoaded(texture);\r\n },\r\n internalTexture,\r\n };\r\n\r\n texture = new Texture(url, scene, options);\r\n }\r\n\r\n return texture;\r\n }\r\n },\r\n parsedTexture,\r\n scene\r\n );\r\n\r\n return texture;\r\n }\r\n\r\n /**\r\n * Creates a texture from its base 64 representation.\r\n * @param data Define the base64 payload without the data: prefix\r\n * @param name Define the name of the texture in the scene useful fo caching purpose for instance\r\n * @param scene Define the scene the texture should belong to\r\n * @param noMipmapOrOptions defines if the texture will require mip maps or not or set of all options to create the texture\r\n * @param invertY define if the texture needs to be inverted on the y axis during loading\r\n * @param samplingMode define the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...)\r\n * @param onLoad define a callback triggered when the texture has been loaded\r\n * @param onError define a callback triggered when an error occurred during the loading session\r\n * @param format define the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @returns the created texture\r\n */\r\n public static CreateFromBase64String(\r\n data: string,\r\n name: string,\r\n scene: Scene,\r\n noMipmapOrOptions?: boolean | ITextureCreationOptions,\r\n invertY?: boolean,\r\n samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE,\r\n onLoad: Nullable<() => void> = null,\r\n onError: Nullable<() => void> = null,\r\n format: number = Constants.TEXTUREFORMAT_RGBA,\r\n creationFlags?: number\r\n ): Texture {\r\n return new Texture(\"data:\" + name, scene, noMipmapOrOptions, invertY, samplingMode, onLoad, onError, data, false, format, undefined, undefined, creationFlags);\r\n }\r\n\r\n /**\r\n * Creates a texture from its data: representation. (data: will be added in case only the payload has been passed in)\r\n * @param name Define the name of the texture in the scene useful fo caching purpose for instance\r\n * @param buffer define the buffer to load the texture from in case the texture is loaded from a buffer representation\r\n * @param scene Define the scene the texture should belong to\r\n * @param deleteBuffer define if the buffer we are loading the texture from should be deleted after load\r\n * @param noMipmapOrOptions defines if the texture will require mip maps or not or set of all options to create the texture\r\n * @param invertY define if the texture needs to be inverted on the y axis during loading\r\n * @param samplingMode define the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...)\r\n * @param onLoad define a callback triggered when the texture has been loaded\r\n * @param onError define a callback triggered when an error occurred during the loading session\r\n * @param format define the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @returns the created texture\r\n */\r\n public static LoadFromDataString(\r\n name: string,\r\n buffer: any,\r\n scene: Scene,\r\n deleteBuffer: boolean = false,\r\n noMipmapOrOptions?: boolean | ITextureCreationOptions,\r\n invertY: boolean = true,\r\n samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE,\r\n onLoad: Nullable<() => void> = null,\r\n onError: Nullable<(message?: string, exception?: any) => void> = null,\r\n format: number = Constants.TEXTUREFORMAT_RGBA,\r\n creationFlags?: number\r\n ): Texture {\r\n if (name.substr(0, 5) !== \"data:\") {\r\n name = \"data:\" + name;\r\n }\r\n\r\n return new Texture(name, scene, noMipmapOrOptions, invertY, samplingMode, onLoad, onError, buffer, deleteBuffer, format, undefined, undefined, creationFlags);\r\n }\r\n}\r\n\r\n// References the dependencies.\r\nRegisterClass(\"BABYLON.Texture\", Texture);\r\nSerializationHelper._TextureParser = Texture.Parse;\r\n"]}
|
|
@@ -23,6 +23,8 @@ export interface InternalTextureCreationOptions {
|
|
|
23
23
|
creationFlags?: number;
|
|
24
24
|
/** Creates the RTT in sRGB space */
|
|
25
25
|
useSRGBBuffer?: boolean;
|
|
26
|
+
/** Label of the texture (used for debugging only) */
|
|
27
|
+
label?: string;
|
|
26
28
|
}
|
|
27
29
|
/**
|
|
28
30
|
* Define options used to create a render target texture
|
|
@@ -53,6 +55,8 @@ export interface DepthTextureCreationOptions {
|
|
|
53
55
|
samples?: number;
|
|
54
56
|
/** Specifies the depth texture format to use */
|
|
55
57
|
depthTextureFormat?: number;
|
|
58
|
+
/** Label of the texture (used for debugging only) */
|
|
59
|
+
label?: string;
|
|
56
60
|
}
|
|
57
61
|
/**
|
|
58
62
|
* Type used to define a texture size (either with a number or with a rect width and height)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textureCreationOptions.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Materials/Textures/textureCreationOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { InternalTexture } from \"./internalTexture\";\r\n\r\n/**\r\n * Define options used to create an internal texture\r\n */\r\nexport interface InternalTextureCreationOptions {\r\n /**\r\n * Specifies if mipmaps must be created. If undefined, the value from generateMipMaps is taken instead\r\n */\r\n createMipMaps?: boolean;\r\n /**\r\n * Specifies if mipmaps must be generated\r\n */\r\n generateMipMaps?: boolean;\r\n /** Defines texture type (int by default) */\r\n type?: number;\r\n /** Defines sampling mode (trilinear by default) */\r\n samplingMode?: number;\r\n /** Defines format (RGBA by default) */\r\n format?: number;\r\n /** Defines sample count (1 by default) */\r\n samples?: number;\r\n /** Texture creation flags */\r\n creationFlags?: number;\r\n /** Creates the RTT in sRGB space */\r\n useSRGBBuffer?: boolean;\r\n}\r\n\r\n/**\r\n * Define options used to create a render target texture\r\n */\r\nexport interface RenderTargetCreationOptions extends InternalTextureCreationOptions {\r\n /** Specifies whether or not a depth should be allocated in the texture (true by default) */\r\n generateDepthBuffer?: boolean;\r\n /** Specifies whether or not a stencil should be allocated in the texture (false by default)*/\r\n generateStencilBuffer?: boolean;\r\n /** Specifies that no color target should be bound to the render target (useful if you only want to write to the depth buffer, for eg) */\r\n noColorAttachment?: boolean;\r\n /** Specifies the internal texture to use directly instead of creating one (ignores `noColorAttachment` flag when set) **/\r\n colorAttachment?: InternalTexture;\r\n}\r\n\r\n/**\r\n * Define options used to create a depth texture\r\n */\r\nexport interface DepthTextureCreationOptions {\r\n /** Specifies whether or not a stencil should be allocated in the texture */\r\n generateStencil?: boolean;\r\n /** Specifies whether or not bilinear filtering is enable on the texture */\r\n bilinearFiltering?: boolean;\r\n /** Specifies the comparison function to set on the texture. If 0 or undefined, the texture is not in comparison mode */\r\n comparisonFunction?: number;\r\n /** Specifies if the created texture is a cube texture */\r\n isCube?: boolean;\r\n /** Specifies the sample count of the depth/stencil texture texture */\r\n samples?: number;\r\n /** Specifies the depth texture format to use */\r\n depthTextureFormat?: number;\r\n}\r\n\r\n/**\r\n * Type used to define a texture size (either with a number or with a rect width and height)\r\n */\r\nexport type TextureSize = number | { width: number; height: number; layers?: number };\r\n"]}
|
|
1
|
+
{"version":3,"file":"textureCreationOptions.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Materials/Textures/textureCreationOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { InternalTexture } from \"./internalTexture\";\r\n\r\n/**\r\n * Define options used to create an internal texture\r\n */\r\nexport interface InternalTextureCreationOptions {\r\n /**\r\n * Specifies if mipmaps must be created. If undefined, the value from generateMipMaps is taken instead\r\n */\r\n createMipMaps?: boolean;\r\n /**\r\n * Specifies if mipmaps must be generated\r\n */\r\n generateMipMaps?: boolean;\r\n /** Defines texture type (int by default) */\r\n type?: number;\r\n /** Defines sampling mode (trilinear by default) */\r\n samplingMode?: number;\r\n /** Defines format (RGBA by default) */\r\n format?: number;\r\n /** Defines sample count (1 by default) */\r\n samples?: number;\r\n /** Texture creation flags */\r\n creationFlags?: number;\r\n /** Creates the RTT in sRGB space */\r\n useSRGBBuffer?: boolean;\r\n /** Label of the texture (used for debugging only) */\r\n label?: string;\r\n}\r\n\r\n/**\r\n * Define options used to create a render target texture\r\n */\r\nexport interface RenderTargetCreationOptions extends InternalTextureCreationOptions {\r\n /** Specifies whether or not a depth should be allocated in the texture (true by default) */\r\n generateDepthBuffer?: boolean;\r\n /** Specifies whether or not a stencil should be allocated in the texture (false by default)*/\r\n generateStencilBuffer?: boolean;\r\n /** Specifies that no color target should be bound to the render target (useful if you only want to write to the depth buffer, for eg) */\r\n noColorAttachment?: boolean;\r\n /** Specifies the internal texture to use directly instead of creating one (ignores `noColorAttachment` flag when set) **/\r\n colorAttachment?: InternalTexture;\r\n}\r\n\r\n/**\r\n * Define options used to create a depth texture\r\n */\r\nexport interface DepthTextureCreationOptions {\r\n /** Specifies whether or not a stencil should be allocated in the texture */\r\n generateStencil?: boolean;\r\n /** Specifies whether or not bilinear filtering is enable on the texture */\r\n bilinearFiltering?: boolean;\r\n /** Specifies the comparison function to set on the texture. If 0 or undefined, the texture is not in comparison mode */\r\n comparisonFunction?: number;\r\n /** Specifies if the created texture is a cube texture */\r\n isCube?: boolean;\r\n /** Specifies the sample count of the depth/stencil texture texture */\r\n samples?: number;\r\n /** Specifies the depth texture format to use */\r\n depthTextureFormat?: number;\r\n /** Label of the texture (used for debugging only) */\r\n label?: string;\r\n}\r\n\r\n/**\r\n * Type used to define a texture size (either with a number or with a rect width and height)\r\n */\r\nexport type TextureSize = number | { width: number; height: number; layers?: number };\r\n"]}
|
|
@@ -179,8 +179,9 @@ export declare class MaterialPluginBase {
|
|
|
179
179
|
getUniforms(): {
|
|
180
180
|
ubo?: Array<{
|
|
181
181
|
name: string;
|
|
182
|
-
size
|
|
183
|
-
type
|
|
182
|
+
size?: number;
|
|
183
|
+
type?: string;
|
|
184
|
+
arraySize?: number;
|
|
184
185
|
}>;
|
|
185
186
|
vertex?: string;
|
|
186
187
|
fragment?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"materialPluginBase.js","sourceRoot":"","sources":["../../../../lts/core/generated/Materials/materialPluginBase.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AA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IAClE,CAAC;CACJ;AA9QG;IADC,SAAS,EAAE;gDACQ;AAMpB;IADC,SAAS,EAAE;oDACkB;AAM9B;IADC,SAAS,EAAE;kEACmC","sourcesContent":["import { SerializationHelper, serialize } from \"../Misc/decorators\";\r\nimport type { Nullable } from \"../types\";\r\nimport { MaterialPluginManager } from \"./materialPluginManager\";\r\nimport type { SmartArray } from \"../Misc/smartArray\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\ndeclare type Engine = import(\"../Engines/engine\").Engine;\r\ndeclare type Scene = import(\"../scene\").Scene;\r\ndeclare type AbstractMesh = import(\"../Meshes/abstractMesh\").AbstractMesh;\r\ndeclare type SubMesh = import(\"../Meshes/subMesh\").SubMesh;\r\ndeclare type IAnimatable = import(\"../Animations/animatable.interface\").IAnimatable;\r\ndeclare type UniformBuffer = import(\"./uniformBuffer\").UniformBuffer;\r\ndeclare type EffectFallbacks = import(\"./effectFallbacks\").EffectFallbacks;\r\ndeclare type MaterialDefines = import(\"./materialDefines\").MaterialDefines;\r\ndeclare type Material = import(\"./material\").Material;\r\ndeclare type BaseTexture = import(\"./Textures/baseTexture\").BaseTexture;\r\ndeclare type RenderTargetTexture = import(\"./Textures/renderTargetTexture\").RenderTargetTexture;\r\n\r\n/**\r\n * Base class for material plugins.\r\n * @since 5.0\r\n */\r\nexport class MaterialPluginBase {\r\n /**\r\n * Defines the name of the plugin\r\n */\r\n @serialize()\r\n public name: string;\r\n\r\n /**\r\n * Defines the priority of the plugin. Lower numbers run first.\r\n */\r\n @serialize()\r\n public priority: number = 500;\r\n\r\n /**\r\n * Indicates that this plugin should be notified for the extra events (HasRenderTargetTextures / FillRenderTargetTextures / HardBindForSubMesh)\r\n */\r\n @serialize()\r\n public registerForExtraEvents: boolean = false;\r\n\r\n protected _material: Material;\r\n protected _pluginManager: MaterialPluginManager;\r\n protected _pluginDefineNames?: { [name: string]: any };\r\n\r\n protected _enable(enable: boolean) {\r\n if (enable) {\r\n this._pluginManager._activatePlugin(this);\r\n }\r\n }\r\n\r\n /**\r\n * Helper function to mark defines as being dirty.\r\n */\r\n public readonly markAllDefinesAsDirty: () => void;\r\n\r\n /**\r\n * Creates a new material plugin\r\n * @param material parent material of the plugin\r\n * @param name name of the plugin\r\n * @param priority priority of the plugin\r\n * @param defines list of defines used by the plugin. The value of the property is the default value for this property\r\n * @param addToPluginList true to add the plugin to the list of plugins managed by the material plugin manager of the material (default: true)\r\n * @param enable true to enable the plugin (it is handy if the plugin does not handle properties to switch its current activation)\r\n */\r\n constructor(material: Material, name: string, priority: number, defines?: { [key: string]: any }, addToPluginList = true, enable = false) {\r\n this._material = material;\r\n this.name = name;\r\n this.priority = priority;\r\n\r\n if (!material.pluginManager) {\r\n material.pluginManager = new MaterialPluginManager(material);\r\n material.onDisposeObservable.add(() => {\r\n material.pluginManager = undefined;\r\n });\r\n }\r\n\r\n this._pluginDefineNames = defines;\r\n this._pluginManager = material.pluginManager;\r\n\r\n if (addToPluginList) {\r\n this._pluginManager._addPlugin(this);\r\n }\r\n\r\n if (enable) {\r\n this._enable(true);\r\n }\r\n\r\n this.markAllDefinesAsDirty = material._dirtyCallbacks[Constants.MATERIAL_AllDirtyFlag];\r\n }\r\n\r\n /**\r\n * Gets the current class name useful for serialization or dynamic coding.\r\n * @returns The class name.\r\n */\r\n public getClassName(): string {\r\n return \"MaterialPluginBase\";\r\n }\r\n\r\n /**\r\n * Specifies that the submesh is ready to be used.\r\n * @param defines the list of \"defines\" to update.\r\n * @param scene defines the scene the material belongs to.\r\n * @param engine the engine this scene belongs to.\r\n * @param subMesh the submesh to check for readiness\r\n * @returns - boolean indicating that the submesh is ready or not.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public isReadyForSubMesh(defines: MaterialDefines, scene: Scene, engine: Engine, subMesh: SubMesh): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Binds the material data (this function is called even if mustRebind() returns false)\r\n * @param uniformBuffer defines the Uniform buffer to fill in.\r\n * @param scene defines the scene the material belongs to.\r\n * @param engine defines the engine the material belongs to.\r\n * @param subMesh the submesh to bind data for\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public hardBindForSubMesh(uniformBuffer: UniformBuffer, scene: Scene, engine: Engine, subMesh: SubMesh): void {}\r\n\r\n /**\r\n * Binds the material data.\r\n * @param uniformBuffer defines the Uniform buffer to fill in.\r\n * @param scene defines the scene the material belongs to.\r\n * @param engine the engine this scene belongs to.\r\n * @param subMesh the submesh to bind data for\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public bindForSubMesh(uniformBuffer: UniformBuffer, scene: Scene, engine: Engine, subMesh: SubMesh): void {}\r\n\r\n /**\r\n * Disposes the resources of the material.\r\n * @param forceDisposeTextures - Forces the disposal of all textures.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public dispose(forceDisposeTextures?: boolean): void {}\r\n\r\n /**\r\n * Returns a list of custom shader code fragments to customize the shader.\r\n * @param shaderType \"vertex\" or \"fragment\"\r\n * @returns null if no code to be added, or a list of pointName => code.\r\n * Note that `pointName` can also be a regular expression if it starts with a `!`.\r\n * In that case, the string found by the regular expression (if any) will be\r\n * replaced by the code provided.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public getCustomCode(shaderType: string): Nullable<{ [pointName: string]: string }> {\r\n return null;\r\n }\r\n\r\n /**\r\n * Collects all defines.\r\n * @param defines The object to append to.\r\n */\r\n public collectDefines(defines: { [name: string]: { type: string; default: any } }): void {\r\n if (!this._pluginDefineNames) {\r\n return;\r\n }\r\n for (const key of Object.keys(this._pluginDefineNames)) {\r\n if (key[0] === \"_\") {\r\n continue;\r\n }\r\n\r\n const type = typeof this._pluginDefineNames[key];\r\n defines[key] = {\r\n type: type === \"number\" ? \"number\" : type === \"string\" ? \"string\" : type === \"boolean\" ? \"boolean\" : \"object\",\r\n default: this._pluginDefineNames[key],\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * Sets the defines for the next rendering. Called before MaterialHelper.PrepareDefinesForAttributes is called.\r\n * @param defines the list of \"defines\" to update.\r\n * @param scene defines the scene to the material belongs to.\r\n * @param mesh the mesh being rendered\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public prepareDefinesBeforeAttributes(defines: MaterialDefines, scene: Scene, mesh: AbstractMesh): void {}\r\n\r\n /**\r\n * Sets the defines for the next rendering\r\n * @param defines the list of \"defines\" to update.\r\n * @param scene defines the scene to the material belongs to.\r\n * @param mesh the mesh being rendered\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public prepareDefines(defines: MaterialDefines, scene: Scene, mesh: AbstractMesh): void {}\r\n\r\n /**\r\n * Checks to see if a texture is used in the material.\r\n * @param texture - Base texture to use.\r\n * @returns - Boolean specifying if a texture is used in the material.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public hasTexture(texture: BaseTexture): boolean {\r\n return false;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating that current material needs to register RTT\r\n * @returns true if this uses a render target otherwise false.\r\n */\r\n public hasRenderTargetTextures(): boolean {\r\n return false;\r\n }\r\n\r\n /**\r\n * Fills the list of render target textures.\r\n * @param renderTargets the list of render targets to update\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public fillRenderTargetTextures(renderTargets: SmartArray<RenderTargetTexture>): void {}\r\n\r\n /**\r\n * Returns an array of the actively used textures.\r\n * @param activeTextures Array of BaseTextures\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public getActiveTextures(activeTextures: BaseTexture[]): void {}\r\n\r\n /**\r\n * Returns the animatable textures.\r\n * @param animatables Array of animatable textures.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public getAnimatables(animatables: IAnimatable[]): void {}\r\n\r\n /**\r\n * Add fallbacks to the effect fallbacks list.\r\n * @param defines defines the Base texture to use.\r\n * @param fallbacks defines the current fallback list.\r\n * @param currentRank defines the current fallback rank.\r\n * @returns the new fallback rank.\r\n */\r\n public addFallbacks(defines: MaterialDefines, fallbacks: EffectFallbacks, currentRank: number): number {\r\n return currentRank;\r\n }\r\n\r\n /**\r\n * Gets the samplers used by the plugin.\r\n * @param samplers list that the sampler names should be added to.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public getSamplers(samplers: string[]): void {}\r\n\r\n /**\r\n * Gets the attributes used by the plugin.\r\n * @param attributes list that the attribute names should be added to.\r\n * @param scene the scene that the material belongs to.\r\n * @param mesh the mesh being rendered.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public getAttributes(attributes: string[], scene: Scene, mesh: AbstractMesh): void {}\r\n\r\n /**\r\n * Gets the uniform buffers names added by the plugin.\r\n * @param ubos list that the ubo names should be added to.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public getUniformBuffersNames(ubos: string[]): void {}\r\n\r\n /**\r\n * Gets the description of the uniforms to add to the ubo (if engine supports ubos) or to inject directly in the vertex/fragment shaders (if engine does not support ubos)\r\n * @returns the description of the uniforms\r\n */\r\n public getUniforms(): { ubo?: Array<{ name: string; size: number; type: string }>; vertex?: string; fragment?: string } {\r\n return {};\r\n }\r\n\r\n /**\r\n * Makes a duplicate of the current configuration into another one.\r\n * @param plugin define the config where to copy the info\r\n */\r\n public copyTo(plugin: MaterialPluginBase): void {\r\n SerializationHelper.Clone(() => plugin, this);\r\n }\r\n\r\n /**\r\n * Serializes this clear coat configuration.\r\n * @returns - An object with the serialized config.\r\n */\r\n public serialize(): any {\r\n return SerializationHelper.Serialize(this);\r\n }\r\n\r\n /**\r\n * Parses a anisotropy Configuration from a serialized object.\r\n * @param source - Serialized object.\r\n * @param scene Defines the scene we are parsing for\r\n * @param rootUrl Defines the rootUrl to load from\r\n */\r\n public parse(source: any, scene: Scene, rootUrl: string): void {\r\n SerializationHelper.Parse(() => this, source, scene, rootUrl);\r\n }\r\n}\r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CAAC;IAClD,CAAC;IAED;;;OAGG;IACI,SAAS;QACZ,OAAO,mBAAmB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,MAAW,EAAE,KAAY,EAAE,OAAe;QACnD,mBAAmB,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;CACJ;AA9QG;IADC,SAAS,EAAE;gDACQ;AAMpB;IADC,SAAS,EAAE;oDACkB;AAM9B;IADC,SAAS,EAAE;kEACmC","sourcesContent":["import { SerializationHelper, serialize } from \"../Misc/decorators\";\r\nimport type { Nullable } from \"../types\";\r\nimport { MaterialPluginManager } from \"./materialPluginManager\";\r\nimport type { SmartArray } from \"../Misc/smartArray\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\ndeclare type Engine = import(\"../Engines/engine\").Engine;\r\ndeclare type Scene = import(\"../scene\").Scene;\r\ndeclare type AbstractMesh = import(\"../Meshes/abstractMesh\").AbstractMesh;\r\ndeclare type SubMesh = import(\"../Meshes/subMesh\").SubMesh;\r\ndeclare type IAnimatable = import(\"../Animations/animatable.interface\").IAnimatable;\r\ndeclare type UniformBuffer = import(\"./uniformBuffer\").UniformBuffer;\r\ndeclare type EffectFallbacks = import(\"./effectFallbacks\").EffectFallbacks;\r\ndeclare type MaterialDefines = import(\"./materialDefines\").MaterialDefines;\r\ndeclare type Material = import(\"./material\").Material;\r\ndeclare type BaseTexture = import(\"./Textures/baseTexture\").BaseTexture;\r\ndeclare type RenderTargetTexture = import(\"./Textures/renderTargetTexture\").RenderTargetTexture;\r\n\r\n/**\r\n * Base class for material plugins.\r\n * @since 5.0\r\n */\r\nexport class MaterialPluginBase {\r\n /**\r\n * Defines the name of the plugin\r\n */\r\n @serialize()\r\n public name: string;\r\n\r\n /**\r\n * Defines the priority of the plugin. Lower numbers run first.\r\n */\r\n @serialize()\r\n public priority: number = 500;\r\n\r\n /**\r\n * Indicates that this plugin should be notified for the extra events (HasRenderTargetTextures / FillRenderTargetTextures / HardBindForSubMesh)\r\n */\r\n @serialize()\r\n public registerForExtraEvents: boolean = false;\r\n\r\n protected _material: Material;\r\n protected _pluginManager: MaterialPluginManager;\r\n protected _pluginDefineNames?: { [name: string]: any };\r\n\r\n protected _enable(enable: boolean) {\r\n if (enable) {\r\n this._pluginManager._activatePlugin(this);\r\n }\r\n }\r\n\r\n /**\r\n * Helper function to mark defines as being dirty.\r\n */\r\n public readonly markAllDefinesAsDirty: () => void;\r\n\r\n /**\r\n * Creates a new material plugin\r\n * @param material parent material of the plugin\r\n * @param name name of the plugin\r\n * @param priority priority of the plugin\r\n * @param defines list of defines used by the plugin. The value of the property is the default value for this property\r\n * @param addToPluginList true to add the plugin to the list of plugins managed by the material plugin manager of the material (default: true)\r\n * @param enable true to enable the plugin (it is handy if the plugin does not handle properties to switch its current activation)\r\n */\r\n constructor(material: Material, name: string, priority: number, defines?: { [key: string]: any }, addToPluginList = true, enable = false) {\r\n this._material = material;\r\n this.name = name;\r\n this.priority = priority;\r\n\r\n if (!material.pluginManager) {\r\n material.pluginManager = new MaterialPluginManager(material);\r\n material.onDisposeObservable.add(() => {\r\n material.pluginManager = undefined;\r\n });\r\n }\r\n\r\n this._pluginDefineNames = defines;\r\n this._pluginManager = material.pluginManager;\r\n\r\n if (addToPluginList) {\r\n this._pluginManager._addPlugin(this);\r\n }\r\n\r\n if (enable) {\r\n this._enable(true);\r\n }\r\n\r\n this.markAllDefinesAsDirty = material._dirtyCallbacks[Constants.MATERIAL_AllDirtyFlag];\r\n }\r\n\r\n /**\r\n * Gets the current class name useful for serialization or dynamic coding.\r\n * @returns The class name.\r\n */\r\n public getClassName(): string {\r\n return \"MaterialPluginBase\";\r\n }\r\n\r\n /**\r\n * Specifies that the submesh is ready to be used.\r\n * @param defines the list of \"defines\" to update.\r\n * @param scene defines the scene the material belongs to.\r\n * @param engine the engine this scene belongs to.\r\n * @param subMesh the submesh to check for readiness\r\n * @returns - boolean indicating that the submesh is ready or not.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public isReadyForSubMesh(defines: MaterialDefines, scene: Scene, engine: Engine, subMesh: SubMesh): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Binds the material data (this function is called even if mustRebind() returns false)\r\n * @param uniformBuffer defines the Uniform buffer to fill in.\r\n * @param scene defines the scene the material belongs to.\r\n * @param engine defines the engine the material belongs to.\r\n * @param subMesh the submesh to bind data for\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public hardBindForSubMesh(uniformBuffer: UniformBuffer, scene: Scene, engine: Engine, subMesh: SubMesh): void {}\r\n\r\n /**\r\n * Binds the material data.\r\n * @param uniformBuffer defines the Uniform buffer to fill in.\r\n * @param scene defines the scene the material belongs to.\r\n * @param engine the engine this scene belongs to.\r\n * @param subMesh the submesh to bind data for\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public bindForSubMesh(uniformBuffer: UniformBuffer, scene: Scene, engine: Engine, subMesh: SubMesh): void {}\r\n\r\n /**\r\n * Disposes the resources of the material.\r\n * @param forceDisposeTextures - Forces the disposal of all textures.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public dispose(forceDisposeTextures?: boolean): void {}\r\n\r\n /**\r\n * Returns a list of custom shader code fragments to customize the shader.\r\n * @param shaderType \"vertex\" or \"fragment\"\r\n * @returns null if no code to be added, or a list of pointName => code.\r\n * Note that `pointName` can also be a regular expression if it starts with a `!`.\r\n * In that case, the string found by the regular expression (if any) will be\r\n * replaced by the code provided.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public getCustomCode(shaderType: string): Nullable<{ [pointName: string]: string }> {\r\n return null;\r\n }\r\n\r\n /**\r\n * Collects all defines.\r\n * @param defines The object to append to.\r\n */\r\n public collectDefines(defines: { [name: string]: { type: string; default: any } }): void {\r\n if (!this._pluginDefineNames) {\r\n return;\r\n }\r\n for (const key of Object.keys(this._pluginDefineNames)) {\r\n if (key[0] === \"_\") {\r\n continue;\r\n }\r\n\r\n const type = typeof this._pluginDefineNames[key];\r\n defines[key] = {\r\n type: type === \"number\" ? \"number\" : type === \"string\" ? \"string\" : type === \"boolean\" ? \"boolean\" : \"object\",\r\n default: this._pluginDefineNames[key],\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * Sets the defines for the next rendering. Called before MaterialHelper.PrepareDefinesForAttributes is called.\r\n * @param defines the list of \"defines\" to update.\r\n * @param scene defines the scene to the material belongs to.\r\n * @param mesh the mesh being rendered\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public prepareDefinesBeforeAttributes(defines: MaterialDefines, scene: Scene, mesh: AbstractMesh): void {}\r\n\r\n /**\r\n * Sets the defines for the next rendering\r\n * @param defines the list of \"defines\" to update.\r\n * @param scene defines the scene to the material belongs to.\r\n * @param mesh the mesh being rendered\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public prepareDefines(defines: MaterialDefines, scene: Scene, mesh: AbstractMesh): void {}\r\n\r\n /**\r\n * Checks to see if a texture is used in the material.\r\n * @param texture - Base texture to use.\r\n * @returns - Boolean specifying if a texture is used in the material.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public hasTexture(texture: BaseTexture): boolean {\r\n return false;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating that current material needs to register RTT\r\n * @returns true if this uses a render target otherwise false.\r\n */\r\n public hasRenderTargetTextures(): boolean {\r\n return false;\r\n }\r\n\r\n /**\r\n * Fills the list of render target textures.\r\n * @param renderTargets the list of render targets to update\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public fillRenderTargetTextures(renderTargets: SmartArray<RenderTargetTexture>): void {}\r\n\r\n /**\r\n * Returns an array of the actively used textures.\r\n * @param activeTextures Array of BaseTextures\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public getActiveTextures(activeTextures: BaseTexture[]): void {}\r\n\r\n /**\r\n * Returns the animatable textures.\r\n * @param animatables Array of animatable textures.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public getAnimatables(animatables: IAnimatable[]): void {}\r\n\r\n /**\r\n * Add fallbacks to the effect fallbacks list.\r\n * @param defines defines the Base texture to use.\r\n * @param fallbacks defines the current fallback list.\r\n * @param currentRank defines the current fallback rank.\r\n * @returns the new fallback rank.\r\n */\r\n public addFallbacks(defines: MaterialDefines, fallbacks: EffectFallbacks, currentRank: number): number {\r\n return currentRank;\r\n }\r\n\r\n /**\r\n * Gets the samplers used by the plugin.\r\n * @param samplers list that the sampler names should be added to.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public getSamplers(samplers: string[]): void {}\r\n\r\n /**\r\n * Gets the attributes used by the plugin.\r\n * @param attributes list that the attribute names should be added to.\r\n * @param scene the scene that the material belongs to.\r\n * @param mesh the mesh being rendered.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public getAttributes(attributes: string[], scene: Scene, mesh: AbstractMesh): void {}\r\n\r\n /**\r\n * Gets the uniform buffers names added by the plugin.\r\n * @param ubos list that the ubo names should be added to.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public getUniformBuffersNames(ubos: string[]): void {}\r\n\r\n /**\r\n * Gets the description of the uniforms to add to the ubo (if engine supports ubos) or to inject directly in the vertex/fragment shaders (if engine does not support ubos)\r\n * @returns the description of the uniforms\r\n */\r\n public getUniforms(): { ubo?: Array<{ name: string; size?: number; type?: string; arraySize?: number }>; vertex?: string; fragment?: string } {\r\n return {};\r\n }\r\n\r\n /**\r\n * Makes a duplicate of the current configuration into another one.\r\n * @param plugin define the config where to copy the info\r\n */\r\n public copyTo(plugin: MaterialPluginBase): void {\r\n SerializationHelper.Clone(() => plugin, this);\r\n }\r\n\r\n /**\r\n * Serializes this clear coat configuration.\r\n * @returns - An object with the serialized config.\r\n */\r\n public serialize(): any {\r\n return SerializationHelper.Serialize(this);\r\n }\r\n\r\n /**\r\n * Parses a anisotropy Configuration from a serialized object.\r\n * @param source - Serialized object.\r\n * @param scene Defines the scene we are parsing for\r\n * @param rootUrl Defines the rootUrl to load from\r\n */\r\n public parse(source: any, scene: Scene, rootUrl: string): void {\r\n SerializationHelper.Parse(() => this, source, scene, rootUrl);\r\n }\r\n}\r\n"]}
|
|
@@ -126,6 +126,7 @@ export class MaterialPluginManager {
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
_handlePluginEvent(id, info) {
|
|
129
|
+
var _a;
|
|
129
130
|
switch (id) {
|
|
130
131
|
case MaterialPluginEvent.GetActiveTextures: {
|
|
131
132
|
const eventData = info;
|
|
@@ -196,8 +197,11 @@ export class MaterialPluginManager {
|
|
|
196
197
|
if (uniforms) {
|
|
197
198
|
if (uniforms.ubo) {
|
|
198
199
|
for (const uniform of uniforms.ubo) {
|
|
199
|
-
|
|
200
|
-
|
|
200
|
+
if (uniform.size && uniform.type) {
|
|
201
|
+
const arraySize = (_a = uniform.arraySize) !== null && _a !== void 0 ? _a : 0;
|
|
202
|
+
eventData.ubo.addUniform(uniform.name, uniform.size, arraySize);
|
|
203
|
+
this._uboDeclaration += `${uniform.type} ${uniform.name}${arraySize > 0 ? `[${arraySize}]` : ""};\r\n`;
|
|
204
|
+
}
|
|
201
205
|
this._uniformList.push(uniform.name);
|
|
202
206
|
}
|
|
203
207
|
}
|
|
@@ -302,6 +306,7 @@ MaterialPluginManager._MaterialPluginClassToMainDefine = {};
|
|
|
302
306
|
MaterialPluginManager._MaterialPluginCounter = 0;
|
|
303
307
|
const plugins = [];
|
|
304
308
|
let inited = false;
|
|
309
|
+
let observer = null;
|
|
305
310
|
/**
|
|
306
311
|
* Registers a new material plugin through a factory, or updates it. This makes the plugin available to all materials instantiated after its registration.
|
|
307
312
|
* @param pluginName The plugin name
|
|
@@ -310,7 +315,7 @@ let inited = false;
|
|
|
310
315
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
311
316
|
export function RegisterMaterialPlugin(pluginName, factory) {
|
|
312
317
|
if (!inited) {
|
|
313
|
-
Material.OnEventObservable.add((material) => {
|
|
318
|
+
observer = Material.OnEventObservable.add((material) => {
|
|
314
319
|
for (const [, factory] of plugins) {
|
|
315
320
|
factory(material);
|
|
316
321
|
}
|
|
@@ -335,6 +340,9 @@ export function UnregisterMaterialPlugin(pluginName) {
|
|
|
335
340
|
for (let i = 0; i < plugins.length; ++i) {
|
|
336
341
|
if (plugins[i][0] === pluginName) {
|
|
337
342
|
plugins.splice(i, 1);
|
|
343
|
+
if (plugins.length === 0) {
|
|
344
|
+
UnregisterAllMaterialPlugins();
|
|
345
|
+
}
|
|
338
346
|
return true;
|
|
339
347
|
}
|
|
340
348
|
}
|
|
@@ -346,5 +354,7 @@ export function UnregisterMaterialPlugin(pluginName) {
|
|
|
346
354
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
347
355
|
export function UnregisterAllMaterialPlugins() {
|
|
348
356
|
plugins.length = 0;
|
|
357
|
+
inited = false;
|
|
358
|
+
Material.OnEventObservable.remove(observer);
|
|
349
359
|
}
|
|
350
360
|
//# sourceMappingURL=materialPluginManager.js.map
|