@babylonjs/core 5.35.0 → 5.36.0
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/Audio/sound.d.ts +5 -0
- package/Audio/sound.js +7 -0
- package/Audio/sound.js.map +1 -1
- package/Debug/physicsViewer.d.ts +4 -3
- package/Debug/physicsViewer.js +2 -2
- package/Debug/physicsViewer.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +15 -15
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/Extensions/engine.renderTargetCube.d.ts +1 -1
- package/Engines/Extensions/engine.renderTargetCube.js.map +1 -1
- package/Engines/Extensions/engine.views.d.ts +4 -0
- package/Engines/Extensions/engine.views.js +61 -42
- package/Engines/Extensions/engine.views.js.map +1 -1
- package/Engines/Native/nativeHardwareTexture.d.ts +14 -0
- package/Engines/Native/nativeHardwareTexture.js +24 -0
- package/Engines/Native/nativeHardwareTexture.js.map +1 -0
- package/Engines/Native/nativeInterfaces.d.ts +22 -15
- package/Engines/Native/nativeInterfaces.js.map +1 -1
- package/Engines/Native/nativePipelineContext.d.ts +252 -0
- package/Engines/Native/nativePipelineContext.js +502 -0
- package/Engines/Native/nativePipelineContext.js.map +1 -0
- package/Engines/Native/nativeRenderTargetWrapper.d.ts +16 -0
- package/Engines/Native/nativeRenderTargetWrapper.js +33 -0
- package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -0
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +3 -3
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTargetCube.js.map +1 -1
- package/Engines/engine.d.ts +1 -0
- package/Engines/engine.js +24 -18
- package/Engines/engine.js.map +1 -1
- package/Engines/nativeEngine.d.ts +18 -17
- package/Engines/nativeEngine.js +100 -598
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.d.ts +1 -1
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/thinEngine.d.ts +1 -1
- package/Engines/thinEngine.js +41 -38
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js.map +1 -1
- package/Gizmos/planeRotationGizmo.js +3 -1
- package/Gizmos/planeRotationGizmo.js.map +1 -1
- package/Inputs/scene.inputManager.js +4 -4
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +3 -3
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Materials/Node/Blocks/Dual/textureBlock.js +1 -1
- package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +19 -1
- package/Materials/Node/nodeMaterial.js +30 -0
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildStateSharedData.d.ts +2 -8
- package/Materials/Node/nodeMaterialBuildStateSharedData.js.map +1 -1
- package/Materials/Textures/baseTexture.d.ts +2 -1
- package/Materials/Textures/baseTexture.js +3 -2
- package/Materials/Textures/baseTexture.js.map +1 -1
- package/Materials/Textures/internalTexture.d.ts +2 -0
- package/Materials/Textures/internalTexture.js +4 -0
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/mirrorTexture.js +0 -2
- package/Materials/Textures/mirrorTexture.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +53 -3
- package/Materials/Textures/renderTargetTexture.js +25 -25
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/texture.d.ts +2 -0
- package/Materials/Textures/texture.js +35 -7
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/Textures/textureCreationOptions.d.ts +4 -1
- package/Materials/Textures/textureCreationOptions.js.map +1 -1
- package/Materials/material.js +1 -1
- package/Materials/material.js.map +1 -1
- package/Meshes/abstractMesh.d.ts +4 -4
- package/Meshes/abstractMesh.js +4 -4
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/mesh.d.ts +2 -2
- package/Meshes/mesh.js +1 -1
- package/Meshes/mesh.js.map +1 -1
- package/Misc/copyTextureToTexture.d.ts +9 -2
- package/Misc/copyTextureToTexture.js +23 -1
- package/Misc/copyTextureToTexture.js.map +1 -1
- package/Particles/IParticleSystem.d.ts +15 -1
- package/Particles/IParticleSystem.js.map +1 -1
- package/Particles/gpuParticleSystem.d.ts +24 -2
- package/Particles/gpuParticleSystem.js +98 -43
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/particleSystem.d.ts +6 -1
- package/Particles/particleSystem.js +7 -2
- package/Particles/particleSystem.js.map +1 -1
- package/Physics/IPhysicsEngine.d.ts +8 -108
- package/Physics/IPhysicsEngine.js.map +1 -1
- package/Physics/Plugins/ammoJSPlugin.d.ts +1 -389
- package/Physics/Plugins/ammoJSPlugin.js +2 -1414
- package/Physics/Plugins/ammoJSPlugin.js.map +1 -1
- package/Physics/Plugins/cannonJSPlugin.d.ts +1 -75
- package/Physics/Plugins/cannonJSPlugin.js +2 -664
- package/Physics/Plugins/cannonJSPlugin.js.map +1 -1
- package/Physics/Plugins/oimoJSPlugin.d.ts +1 -59
- package/Physics/Plugins/oimoJSPlugin.js +2 -432
- package/Physics/Plugins/oimoJSPlugin.js.map +1 -1
- package/Physics/index.d.ts +3 -6
- package/Physics/index.js +3 -6
- package/Physics/index.js.map +1 -1
- package/Physics/physicsEngine.d.ts +1 -135
- package/Physics/physicsEngine.js +2 -221
- package/Physics/physicsEngine.js.map +1 -1
- package/Physics/physicsEngineComponent.d.ts +7 -42
- package/Physics/physicsEngineComponent.js +11 -71
- package/Physics/physicsEngineComponent.js.map +1 -1
- package/Physics/physicsHelper.d.ts +1 -411
- package/Physics/physicsHelper.js +2 -708
- package/Physics/physicsHelper.js.map +1 -1
- package/Physics/physicsImpostor.d.ts +1 -640
- package/Physics/physicsImpostor.js +2 -1004
- package/Physics/physicsImpostor.js.map +1 -1
- package/Physics/physicsJoint.d.ts +1 -275
- package/Physics/physicsJoint.js +2 -222
- package/Physics/physicsJoint.js.map +1 -1
- package/Physics/v1/IPhysicsEnginePlugin.d.ts +73 -0
- package/Physics/v1/IPhysicsEnginePlugin.js +2 -0
- package/Physics/v1/IPhysicsEnginePlugin.js.map +1 -0
- package/Physics/v1/Plugins/ammoJSPlugin.d.ts +401 -0
- package/Physics/v1/Plugins/ammoJSPlugin.js +1431 -0
- package/Physics/v1/Plugins/ammoJSPlugin.js.map +1 -0
- package/Physics/v1/Plugins/cannonJSPlugin.d.ts +87 -0
- package/Physics/v1/Plugins/cannonJSPlugin.js +683 -0
- package/Physics/v1/Plugins/cannonJSPlugin.js.map +1 -0
- package/Physics/{Plugins → v1/Plugins}/index.d.ts +0 -0
- package/Physics/{Plugins → v1/Plugins}/index.js +0 -0
- package/Physics/v1/Plugins/index.js.map +1 -0
- package/Physics/v1/Plugins/oimoJSPlugin.d.ts +71 -0
- package/Physics/v1/Plugins/oimoJSPlugin.js +450 -0
- package/Physics/v1/Plugins/oimoJSPlugin.js.map +1 -0
- package/Physics/v1/index.d.ts +7 -0
- package/Physics/v1/index.js +9 -0
- package/Physics/v1/index.js.map +1 -0
- package/Physics/v1/physicsEngine.d.ts +147 -0
- package/Physics/v1/physicsEngine.js +237 -0
- package/Physics/v1/physicsEngine.js.map +1 -0
- package/Physics/v1/physicsEngineComponent.d.ts +45 -0
- package/Physics/v1/physicsEngineComponent.js +70 -0
- package/Physics/v1/physicsEngineComponent.js.map +1 -0
- package/Physics/v1/physicsHelper.d.ts +411 -0
- package/Physics/v1/physicsHelper.js +709 -0
- package/Physics/v1/physicsHelper.js.map +1 -0
- package/Physics/v1/physicsImpostor.d.ts +636 -0
- package/Physics/v1/physicsImpostor.js +1001 -0
- package/Physics/v1/physicsImpostor.js.map +1 -0
- package/Physics/v1/physicsJoint.d.ts +275 -0
- package/Physics/v1/physicsJoint.js +223 -0
- package/Physics/v1/physicsJoint.js.map +1 -0
- package/Physics/v2/IPhysicsEnginePlugin.d.ts +170 -0
- package/Physics/v2/IPhysicsEnginePlugin.js +47 -0
- package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -0
- package/Physics/v2/Plugins/index.d.ts +0 -0
- package/Physics/v2/Plugins/index.js +2 -0
- package/Physics/v2/Plugins/index.js.map +1 -0
- package/Physics/v2/index.d.ts +6 -0
- package/Physics/v2/index.js +8 -0
- package/Physics/v2/index.js.map +1 -0
- package/Physics/v2/physicsAggregate.d.ts +114 -0
- package/Physics/v2/physicsAggregate.js +46 -0
- package/Physics/v2/physicsAggregate.js.map +1 -0
- package/Physics/v2/physicsBody.d.ts +109 -0
- package/Physics/v2/physicsBody.js +158 -0
- package/Physics/v2/physicsBody.js.map +1 -0
- package/Physics/v2/physicsConstraint.d.ts +184 -0
- package/Physics/v2/physicsConstraint.js +257 -0
- package/Physics/v2/physicsConstraint.js.map +1 -0
- package/Physics/v2/physicsEngine.d.ts +103 -0
- package/Physics/v2/physicsEngine.js +146 -0
- package/Physics/v2/physicsEngine.js.map +1 -0
- package/Physics/v2/physicsEngineComponent.d.ts +31 -0
- package/Physics/v2/physicsEngineComponent.js +50 -0
- package/Physics/v2/physicsEngineComponent.js.map +1 -0
- package/Physics/v2/physicsMaterial.d.ts +45 -0
- package/Physics/v2/physicsMaterial.js +67 -0
- package/Physics/v2/physicsMaterial.js.map +1 -0
- package/Physics/v2/physicsShape.d.ts +182 -0
- package/Physics/v2/physicsShape.js +229 -0
- package/Physics/v2/physicsShape.js.map +1 -0
- package/PostProcesses/postProcess.d.ts +3 -1
- package/PostProcesses/postProcess.js +4 -1
- package/PostProcesses/postProcess.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderer.d.ts +153 -0
- package/Rendering/fluidRenderer/fluidRenderer.js +410 -0
- package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -0
- package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.d.ts +13 -0
- package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js +31 -0
- package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js.map +1 -0
- package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +81 -0
- package/Rendering/fluidRenderer/fluidRenderingObject.js +180 -0
- package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -0
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.d.ts +63 -0
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js +130 -0
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js.map +1 -0
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.d.ts +64 -0
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +104 -0
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -0
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.d.ts +234 -0
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +690 -0
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -0
- package/Rendering/fluidRenderer/fluidRenderingTextures.d.ts +56 -0
- package/Rendering/fluidRenderer/fluidRenderingTextures.js +261 -0
- package/Rendering/fluidRenderer/fluidRenderingTextures.js.map +1 -0
- package/Rendering/fluidRenderer/index.d.ts +5 -0
- package/Rendering/fluidRenderer/index.js +6 -0
- package/Rendering/fluidRenderer/index.js.map +1 -0
- package/Rendering/index.d.ts +1 -0
- package/Rendering/index.js +2 -0
- package/Rendering/index.js.map +1 -1
- package/Shaders/copyTextureToTexture.fragment.js +4 -1
- package/Shaders/copyTextureToTexture.fragment.js.map +1 -1
- package/Shaders/fluidRenderingBilateralBlur.fragment.d.ts +5 -0
- package/Shaders/fluidRenderingBilateralBlur.fragment.js +9 -0
- package/Shaders/fluidRenderingBilateralBlur.fragment.js.map +1 -0
- package/Shaders/fluidRenderingParticleDepth.fragment.d.ts +5 -0
- package/Shaders/fluidRenderingParticleDepth.fragment.js +17 -0
- package/Shaders/fluidRenderingParticleDepth.fragment.js.map +1 -0
- package/Shaders/fluidRenderingParticleDepth.vertex.d.ts +5 -0
- package/Shaders/fluidRenderingParticleDepth.vertex.js +13 -0
- package/Shaders/fluidRenderingParticleDepth.vertex.js.map +1 -0
- package/Shaders/fluidRenderingParticleDiffuse.fragment.d.ts +5 -0
- package/Shaders/fluidRenderingParticleDiffuse.fragment.js +9 -0
- package/Shaders/fluidRenderingParticleDiffuse.fragment.js.map +1 -0
- package/Shaders/fluidRenderingParticleDiffuse.vertex.d.ts +5 -0
- package/Shaders/fluidRenderingParticleDiffuse.vertex.js +4 -0
- package/Shaders/fluidRenderingParticleDiffuse.vertex.js.map +1 -0
- package/Shaders/fluidRenderingParticleThickness.fragment.d.ts +5 -0
- package/Shaders/fluidRenderingParticleThickness.fragment.js +9 -0
- package/Shaders/fluidRenderingParticleThickness.fragment.js.map +1 -0
- package/Shaders/fluidRenderingParticleThickness.vertex.d.ts +5 -0
- package/Shaders/fluidRenderingParticleThickness.vertex.js +9 -0
- package/Shaders/fluidRenderingParticleThickness.vertex.js.map +1 -0
- package/Shaders/fluidRenderingRender.fragment.d.ts +5 -0
- package/Shaders/fluidRenderingRender.fragment.js +46 -0
- package/Shaders/fluidRenderingRender.fragment.js.map +1 -0
- package/Shaders/fluidRenderingStandardBlur.fragment.d.ts +5 -0
- package/Shaders/fluidRenderingStandardBlur.fragment.js +9 -0
- package/Shaders/fluidRenderingStandardBlur.fragment.js.map +1 -0
- package/XR/features/WebXRControllerPhysics.d.ts +1 -1
- package/XR/features/WebXRControllerPhysics.js +1 -1
- package/XR/features/WebXRControllerPhysics.js.map +1 -1
- package/XR/features/WebXRHandTracking.js +1 -1
- package/XR/features/WebXRHandTracking.js.map +1 -1
- package/package.json +1 -1
- package/scene.js +6 -1
- package/scene.js.map +1 -1
- package/sceneComponent.d.ts +3 -0
- package/sceneComponent.js +3 -0
- package/sceneComponent.js.map +1 -1
- package/Physics/Plugins/index.js.map +0 -1
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import type { NodeMaterialConnectionPoint } from "./nodeMaterialBlockConnectionPoint";
|
|
2
2
|
import type { NodeMaterialBlock } from "./nodeMaterialBlock";
|
|
3
3
|
import type { InputBlock } from "./Blocks/Input/inputBlock";
|
|
4
|
-
import type { TextureBlock } from "./Blocks/Dual/textureBlock";
|
|
5
|
-
import type { ReflectionTextureBaseBlock } from "./Blocks/Dual/reflectionTextureBaseBlock";
|
|
6
|
-
import type { RefractionBlock } from "./Blocks/PBR/refractionBlock";
|
|
7
|
-
import type { CurrentScreenBlock } from "./Blocks/Dual/currentScreenBlock";
|
|
8
|
-
import type { ParticleTextureBlock } from "./Blocks/Particle/particleTextureBlock";
|
|
9
4
|
import type { Scene } from "../../scene";
|
|
10
|
-
import type { ImageSourceBlock } from "./Blocks/Dual/imageSourceBlock";
|
|
11
|
-
import type { TriPlanarBlock } from "./Blocks/triPlanarBlock";
|
|
12
5
|
import type { Immutable } from "../../types";
|
|
6
|
+
import type { NodeMaterialTextureBlocks } from "./nodeMaterial";
|
|
13
7
|
/**
|
|
14
8
|
* Class used to store shared data between 2 NodeMaterialBuildState
|
|
15
9
|
*/
|
|
@@ -37,7 +31,7 @@ export declare class NodeMaterialBuildStateSharedData {
|
|
|
37
31
|
/**
|
|
38
32
|
* Input blocks
|
|
39
33
|
*/
|
|
40
|
-
textureBlocks:
|
|
34
|
+
textureBlocks: NodeMaterialTextureBlocks[];
|
|
41
35
|
/**
|
|
42
36
|
* Bindable blocks (Blocks that need to set data to the effect)
|
|
43
37
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeMaterialBuildStateSharedData.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Materials/Node/nodeMaterialBuildStateSharedData.ts"],"names":[],"mappings":"AAaA;;GAEG;AACH,MAAM,OAAO,gCAAgC;IAmHzC,gCAAgC;IAChC;QAnHA;;WAEG;QACI,UAAK,GAAG,IAAI,KAAK,EAAU,CAAC;QAEnC;;WAEG;QACI,aAAQ,GAAG,IAAI,KAAK,EAAU,CAAC;QAEtC;;WAEG;QACI,uBAAkB,GAAG,EA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C;QAChC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAChC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAChC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAChC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAChC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;IAED;;OAEG;IACI,UAAU;QACb,IAAI,YAAY,GAAG,EAAE,CAAC;QAEtB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE;YAC1D,YAAY,IAAI,qHAAqH,CAAC;SACzI;QACD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE;YAC3B,YAAY,IAAI,wHAAwH,CAAC;SAC5I;QACD,KAAK,MAAM,iBAAiB,IAAI,IAAI,CAAC,MAAM,CAAC,6BAA6B,EAAE;YACvE,YAAY,IAAI,SAAS,iBAAiB,CAAC,IAAI,eAC3C,iBAAiB,CAAC,UAAU,CAAC,IACjC,IAAI,iBAAiB,CAAC,UAAU,CAAC,YAAY,EAAE,6CAA6C,CAAC;SAChG;QAED,IAAI,YAAY,EAAE;YACd,MAAM,mCAAmC,GAAG,YAAY,CAAC;SAC5D;IACL,CAAC;CACJ","sourcesContent":["import type { NodeMaterialConnectionPoint } from \"./nodeMaterialBlockConnectionPoint\";\r\nimport type { NodeMaterialBlock } from \"./nodeMaterialBlock\";\r\nimport type { InputBlock } from \"./Blocks/Input/inputBlock\";\r\nimport type { TextureBlock } from \"./Blocks/Dual/textureBlock\";\r\nimport type { ReflectionTextureBaseBlock } from \"./Blocks/Dual/reflectionTextureBaseBlock\";\r\nimport type { RefractionBlock } from \"./Blocks/PBR/refractionBlock\";\r\nimport type { CurrentScreenBlock } from \"./Blocks/Dual/currentScreenBlock\";\r\nimport type { ParticleTextureBlock } from \"./Blocks/Particle/particleTextureBlock\";\r\nimport type { Scene } from \"../../scene\";\r\nimport type { ImageSourceBlock } from \"./Blocks/Dual/imageSourceBlock\";\r\nimport type { TriPlanarBlock } from \"./Blocks/triPlanarBlock\";\r\nimport type { Immutable } from \"../../types\";\r\n\r\n/**\r\n * Class used to store shared data between 2 NodeMaterialBuildState\r\n */\r\nexport class NodeMaterialBuildStateSharedData {\r\n /**\r\n * Gets the list of emitted varyings\r\n */\r\n public temps = new Array<string>();\r\n\r\n /**\r\n * Gets the list of emitted varyings\r\n */\r\n public varyings = new Array<string>();\r\n\r\n /**\r\n * Gets the varying declaration string\r\n */\r\n public varyingDeclaration = \"\";\r\n\r\n /**\r\n * List of the fragment output nodes\r\n */\r\n public fragmentOutputNodes: Immutable<Array<NodeMaterialBlock>>;\r\n\r\n /**\r\n * Input blocks\r\n */\r\n public inputBlocks = new Array<InputBlock>();\r\n\r\n /**\r\n * Input blocks\r\n */\r\n public textureBlocks = new Array<TextureBlock | ReflectionTextureBaseBlock | RefractionBlock | CurrentScreenBlock | ParticleTextureBlock | ImageSourceBlock | TriPlanarBlock>();\r\n\r\n /**\r\n * Bindable blocks (Blocks that need to set data to the effect)\r\n */\r\n public bindableBlocks = new Array<NodeMaterialBlock>();\r\n\r\n /**\r\n * Bindable blocks (Blocks that need to set data to the effect) that will always be called (by bindForSubMesh), contrary to bindableBlocks that won't be called if _mustRebind() returns false\r\n */\r\n public forcedBindableBlocks = new Array<NodeMaterialBlock>();\r\n\r\n /**\r\n * List of blocks that can provide a compilation fallback\r\n */\r\n public blocksWithFallbacks = new Array<NodeMaterialBlock>();\r\n\r\n /**\r\n * List of blocks that can provide a define update\r\n */\r\n public blocksWithDefines = new Array<NodeMaterialBlock>();\r\n\r\n /**\r\n * List of blocks that can provide a repeatable content\r\n */\r\n public repeatableContentBlocks = new Array<NodeMaterialBlock>();\r\n\r\n /**\r\n * List of blocks that can provide a dynamic list of uniforms\r\n */\r\n public dynamicUniformBlocks = new Array<NodeMaterialBlock>();\r\n\r\n /**\r\n * List of blocks that can block the isReady function for the material\r\n */\r\n public blockingBlocks = new Array<NodeMaterialBlock>();\r\n\r\n /**\r\n * Gets the list of animated inputs\r\n */\r\n public animatedInputs = new Array<InputBlock>();\r\n\r\n /**\r\n * Build Id used to avoid multiple recompilations\r\n */\r\n public buildId: number;\r\n\r\n /** List of emitted variables */\r\n public variableNames: { [key: string]: number } = {};\r\n\r\n /** List of emitted defines */\r\n public defineNames: { [key: string]: number } = {};\r\n\r\n /** Should emit comments? */\r\n public emitComments: boolean;\r\n\r\n /** Emit build activity */\r\n public verbose: boolean;\r\n\r\n /** Gets or sets the hosting scene */\r\n public scene: Scene;\r\n\r\n /**\r\n * Gets the compilation hints emitted at compilation time\r\n */\r\n public hints = {\r\n needWorldViewMatrix: false,\r\n needWorldViewProjectionMatrix: false,\r\n needAlphaBlending: false,\r\n needAlphaTesting: false,\r\n };\r\n\r\n /**\r\n * List of compilation checks\r\n */\r\n public checks = {\r\n emitVertex: false,\r\n emitFragment: false,\r\n notConnectedNonOptionalInputs: new Array<NodeMaterialConnectionPoint>(),\r\n };\r\n\r\n /**\r\n * Is vertex program allowed to be empty?\r\n */\r\n public allowEmptyVertexProgram: boolean = false;\r\n\r\n /** Creates a new shared data */\r\n public constructor() {\r\n // Exclude usual attributes from free variable names\r\n this.variableNames[\"position\"] = 0;\r\n this.variableNames[\"normal\"] = 0;\r\n this.variableNames[\"tangent\"] = 0;\r\n this.variableNames[\"uv\"] = 0;\r\n this.variableNames[\"uv2\"] = 0;\r\n this.variableNames[\"uv3\"] = 0;\r\n this.variableNames[\"uv4\"] = 0;\r\n this.variableNames[\"uv5\"] = 0;\r\n this.variableNames[\"uv6\"] = 0;\r\n this.variableNames[\"color\"] = 0;\r\n this.variableNames[\"matricesIndices\"] = 0;\r\n this.variableNames[\"matricesWeights\"] = 0;\r\n this.variableNames[\"matricesIndicesExtra\"] = 0;\r\n this.variableNames[\"matricesWeightsExtra\"] = 0;\r\n this.variableNames[\"diffuseBase\"] = 0;\r\n this.variableNames[\"specularBase\"] = 0;\r\n this.variableNames[\"worldPos\"] = 0;\r\n this.variableNames[\"shadow\"] = 0;\r\n this.variableNames[\"view\"] = 0;\r\n\r\n // Exclude known varyings\r\n this.variableNames[\"vTBN\"] = 0;\r\n\r\n // Exclude defines\r\n this.defineNames[\"MAINUV0\"] = 0;\r\n this.defineNames[\"MAINUV1\"] = 0;\r\n this.defineNames[\"MAINUV2\"] = 0;\r\n this.defineNames[\"MAINUV3\"] = 0;\r\n this.defineNames[\"MAINUV4\"] = 0;\r\n this.defineNames[\"MAINUV5\"] = 0;\r\n this.defineNames[\"MAINUV6\"] = 0;\r\n this.defineNames[\"MAINUV7\"] = 0;\r\n }\r\n\r\n /**\r\n * Emits console errors and exceptions if there is a failing check\r\n */\r\n public emitErrors() {\r\n let errorMessage = \"\";\r\n\r\n if (!this.checks.emitVertex && !this.allowEmptyVertexProgram) {\r\n errorMessage += \"NodeMaterial does not have a vertex output. You need to at least add a block that generates a glPosition value.\\r\\n\";\r\n }\r\n if (!this.checks.emitFragment) {\r\n errorMessage += \"NodeMaterial does not have a fragment output. You need to at least add a block that generates a glFragColor value.\\r\\n\";\r\n }\r\n for (const notConnectedInput of this.checks.notConnectedNonOptionalInputs) {\r\n errorMessage += `input ${notConnectedInput.name} from block ${\r\n notConnectedInput.ownerBlock.name\r\n }[${notConnectedInput.ownerBlock.getClassName()}] is not connected and is not optional.\\r\\n`;\r\n }\r\n\r\n if (errorMessage) {\r\n throw \"Build of NodeMaterial failed:\\r\\n\" + errorMessage;\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"nodeMaterialBuildStateSharedData.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Materials/Node/nodeMaterialBuildStateSharedData.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,OAAO,gCAAgC;IAmHzC,gCAAgC;IAChC;QAnHA;;W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C,GAAG,CAAC,CAAC;QAChC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAChC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAChC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAChC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAChC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAChC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAChC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;IAED;;OAEG;IACI,UAAU;QACb,IAAI,YAAY,GAAG,EAAE,CAAC;QAEtB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE;YAC1D,YAAY,IAAI,qHAAqH,CAAC;SACzI;QACD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE;YAC3B,YAAY,IAAI,wHAAwH,CAAC;SAC5I;QACD,KAAK,MAAM,iBAAiB,IAAI,IAAI,CAAC,MAAM,CAAC,6BAA6B,EAAE;YACvE,YAAY,IAAI,SAAS,iBAAiB,CAAC,IAAI,eAC3C,iBAAiB,CAAC,UAAU,CAAC,IACjC,IAAI,iBAAiB,CAAC,UAAU,CAAC,YAAY,EAAE,6CAA6C,CAAC;SAChG;QAED,IAAI,YAAY,EAAE;YACd,MAAM,mCAAmC,GAAG,YAAY,CAAC;SAC5D;IACL,CAAC;CACJ","sourcesContent":["import type { NodeMaterialConnectionPoint } from \"./nodeMaterialBlockConnectionPoint\";\r\nimport type { NodeMaterialBlock } from \"./nodeMaterialBlock\";\r\nimport type { InputBlock } from \"./Blocks/Input/inputBlock\";\r\nimport type { Scene } from \"../../scene\";\r\nimport type { Immutable } from \"../../types\";\r\nimport type { NodeMaterialTextureBlocks } from \"./nodeMaterial\";\r\n\r\n/**\r\n * Class used to store shared data between 2 NodeMaterialBuildState\r\n */\r\nexport class NodeMaterialBuildStateSharedData {\r\n /**\r\n * Gets the list of emitted varyings\r\n */\r\n public temps = new Array<string>();\r\n\r\n /**\r\n * Gets the list of emitted varyings\r\n */\r\n public varyings = new Array<string>();\r\n\r\n /**\r\n * Gets the varying declaration string\r\n */\r\n public varyingDeclaration = \"\";\r\n\r\n /**\r\n * List of the fragment output nodes\r\n */\r\n public fragmentOutputNodes: Immutable<Array<NodeMaterialBlock>>;\r\n\r\n /**\r\n * Input blocks\r\n */\r\n public inputBlocks = new Array<InputBlock>();\r\n\r\n /**\r\n * Input blocks\r\n */\r\n public textureBlocks = new Array<NodeMaterialTextureBlocks>();\r\n\r\n /**\r\n * Bindable blocks (Blocks that need to set data to the effect)\r\n */\r\n public bindableBlocks = new Array<NodeMaterialBlock>();\r\n\r\n /**\r\n * Bindable blocks (Blocks that need to set data to the effect) that will always be called (by bindForSubMesh), contrary to bindableBlocks that won't be called if _mustRebind() returns false\r\n */\r\n public forcedBindableBlocks = new Array<NodeMaterialBlock>();\r\n\r\n /**\r\n * List of blocks that can provide a compilation fallback\r\n */\r\n public blocksWithFallbacks = new Array<NodeMaterialBlock>();\r\n\r\n /**\r\n * List of blocks that can provide a define update\r\n */\r\n public blocksWithDefines = new Array<NodeMaterialBlock>();\r\n\r\n /**\r\n * List of blocks that can provide a repeatable content\r\n */\r\n public repeatableContentBlocks = new Array<NodeMaterialBlock>();\r\n\r\n /**\r\n * List of blocks that can provide a dynamic list of uniforms\r\n */\r\n public dynamicUniformBlocks = new Array<NodeMaterialBlock>();\r\n\r\n /**\r\n * List of blocks that can block the isReady function for the material\r\n */\r\n public blockingBlocks = new Array<NodeMaterialBlock>();\r\n\r\n /**\r\n * Gets the list of animated inputs\r\n */\r\n public animatedInputs = new Array<InputBlock>();\r\n\r\n /**\r\n * Build Id used to avoid multiple recompilations\r\n */\r\n public buildId: number;\r\n\r\n /** List of emitted variables */\r\n public variableNames: { [key: string]: number } = {};\r\n\r\n /** List of emitted defines */\r\n public defineNames: { [key: string]: number } = {};\r\n\r\n /** Should emit comments? */\r\n public emitComments: boolean;\r\n\r\n /** Emit build activity */\r\n public verbose: boolean;\r\n\r\n /** Gets or sets the hosting scene */\r\n public scene: Scene;\r\n\r\n /**\r\n * Gets the compilation hints emitted at compilation time\r\n */\r\n public hints = {\r\n needWorldViewMatrix: false,\r\n needWorldViewProjectionMatrix: false,\r\n needAlphaBlending: false,\r\n needAlphaTesting: false,\r\n };\r\n\r\n /**\r\n * List of compilation checks\r\n */\r\n public checks = {\r\n emitVertex: false,\r\n emitFragment: false,\r\n notConnectedNonOptionalInputs: new Array<NodeMaterialConnectionPoint>(),\r\n };\r\n\r\n /**\r\n * Is vertex program allowed to be empty?\r\n */\r\n public allowEmptyVertexProgram: boolean = false;\r\n\r\n /** Creates a new shared data */\r\n public constructor() {\r\n // Exclude usual attributes from free variable names\r\n this.variableNames[\"position\"] = 0;\r\n this.variableNames[\"normal\"] = 0;\r\n this.variableNames[\"tangent\"] = 0;\r\n this.variableNames[\"uv\"] = 0;\r\n this.variableNames[\"uv2\"] = 0;\r\n this.variableNames[\"uv3\"] = 0;\r\n this.variableNames[\"uv4\"] = 0;\r\n this.variableNames[\"uv5\"] = 0;\r\n this.variableNames[\"uv6\"] = 0;\r\n this.variableNames[\"color\"] = 0;\r\n this.variableNames[\"matricesIndices\"] = 0;\r\n this.variableNames[\"matricesWeights\"] = 0;\r\n this.variableNames[\"matricesIndicesExtra\"] = 0;\r\n this.variableNames[\"matricesWeightsExtra\"] = 0;\r\n this.variableNames[\"diffuseBase\"] = 0;\r\n this.variableNames[\"specularBase\"] = 0;\r\n this.variableNames[\"worldPos\"] = 0;\r\n this.variableNames[\"shadow\"] = 0;\r\n this.variableNames[\"view\"] = 0;\r\n\r\n // Exclude known varyings\r\n this.variableNames[\"vTBN\"] = 0;\r\n\r\n // Exclude defines\r\n this.defineNames[\"MAINUV0\"] = 0;\r\n this.defineNames[\"MAINUV1\"] = 0;\r\n this.defineNames[\"MAINUV2\"] = 0;\r\n this.defineNames[\"MAINUV3\"] = 0;\r\n this.defineNames[\"MAINUV4\"] = 0;\r\n this.defineNames[\"MAINUV5\"] = 0;\r\n this.defineNames[\"MAINUV6\"] = 0;\r\n this.defineNames[\"MAINUV7\"] = 0;\r\n }\r\n\r\n /**\r\n * Emits console errors and exceptions if there is a failing check\r\n */\r\n public emitErrors() {\r\n let errorMessage = \"\";\r\n\r\n if (!this.checks.emitVertex && !this.allowEmptyVertexProgram) {\r\n errorMessage += \"NodeMaterial does not have a vertex output. You need to at least add a block that generates a glPosition value.\\r\\n\";\r\n }\r\n if (!this.checks.emitFragment) {\r\n errorMessage += \"NodeMaterial does not have a fragment output. You need to at least add a block that generates a glFragColor value.\\r\\n\";\r\n }\r\n for (const notConnectedInput of this.checks.notConnectedNonOptionalInputs) {\r\n errorMessage += `input ${notConnectedInput.name} from block ${\r\n notConnectedInput.ownerBlock.name\r\n }[${notConnectedInput.ownerBlock.getClassName()}] is not connected and is not optional.\\r\\n`;\r\n }\r\n\r\n if (errorMessage) {\r\n throw \"Build of NodeMaterial failed:\\r\\n\" + errorMessage;\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -345,9 +345,10 @@ export declare class BaseTexture extends ThinTexture implements IAnimatable {
|
|
|
345
345
|
dispose(): void;
|
|
346
346
|
/**
|
|
347
347
|
* Serialize the texture into a JSON representation that can be parsed later on.
|
|
348
|
+
* @param allowEmptyName True to force serialization even if name is empty. Default: false
|
|
348
349
|
* @returns the JSON representation of the texture
|
|
349
350
|
*/
|
|
350
|
-
serialize(): any;
|
|
351
|
+
serialize(allowEmptyName?: boolean): any;
|
|
351
352
|
/**
|
|
352
353
|
* Helper function to be called back once a list of texture contains only ready textures.
|
|
353
354
|
* @param textures Define the list of textures to wait for
|
|
@@ -672,10 +672,11 @@ export class BaseTexture extends ThinTexture {
|
|
|
672
672
|
}
|
|
673
673
|
/**
|
|
674
674
|
* Serialize the texture into a JSON representation that can be parsed later on.
|
|
675
|
+
* @param allowEmptyName True to force serialization even if name is empty. Default: false
|
|
675
676
|
* @returns the JSON representation of the texture
|
|
676
677
|
*/
|
|
677
|
-
serialize() {
|
|
678
|
-
if (!this.name) {
|
|
678
|
+
serialize(allowEmptyName = false) {
|
|
679
|
+
if (!this.name && !allowEmptyName) {
|
|
679
680
|
return null;
|
|
680
681
|
}
|
|
681
682
|
const serializationObject = SerializationHelper.Serialize(this);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseTexture.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Materials/Textures/baseTexture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3F,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAK5C;;;;GAIG;AACH,MAAM,OAAO,WAAY,SAAQ,WAAW;IA0exC;;;;;;;OAOG;IACH,YAAY,aAA4C,EAAE,kBAA6C,IAAI;QACvG,KAAK,CAAC,IAAI,CAAC,CAAC;QAhehB;;WAEG;QAEI,aAAQ,GAAQ,IAAI,CAAC;QAE5B;;WAEG;QACI,sBAAiB,GAAQ,IAAI,CAAC;QAG7B,cAAS,GAAG,KAAK,CAAC;QAoBlB,qBAAgB,GAAG,KAAK,CAAC;QAoBjC;;;WAGG;QAEI,UAAK,GAAG,CAAC,CAAC;Q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AAC;;AAx2BD;;;GAGG;AACW,+CAAmC,GAAG,CAAC,CAAC;AAMtD;IADC,SAAS,EAAE;6CACY;AAMxB;IADC,SAAS,EAAE;yCACQ;AAMpB;IADC,SAAS,EAAE;6CACgB;AAQ5B;IADC,SAAS,CAAC,UAAU,CAAC;8CACI;AAoB1B;IADC,SAAS,CAAC,iBAAiB,CAAC;qDACI;AAyBjC;IADC,SAAS,EAAE;0CACK;AAGjB;IADC,SAAS,CAAC,kBAAkB,CAAC;sDACE;AAOhC;IADC,SAAS,EAAE;yDACuB;AAsBnC;IADC,SAAS,CAAC,iBAAiB,CAAC;qDACgC;AAyC7D;IADC,SAAS,EAAE;wCAGX;AAaD;IADC,SAAS,EAAE;wCAGX;AAaD;IADC,SAAS,EAAE;0CACsC;AAQlD;IADC,SAAS,EAAE;8DACuE;AAQnF;IADC,SAAS,EAAE;yCAOX;AAcD;IADC,SAAS,EAAE;uCAOX;AAcD;IADC,SAAS,EAAE;4CAOX;AAiBD;IADC,SAAS,EAAE;6CAWX;AAmCD;IADC,SAAS,EAAE;4CACW;AAavB;IADC,SAAS,EAAE;oDACmB;AAM/B;IADC,SAAS,EAAE;sDAOX;AAWD;IADC,SAAS,EAAE;qDAOX;AAaD;IADC,SAAS,EAAE;oDAOX;AAaD;IADC,kBAAkB,EAAE;oDAOpB;AAWD;IADC,SAAS,EAAE;mDACkB","sourcesContent":["import { serialize, SerializationHelper, serializeAsTexture } from \"../../Misc/decorators\";\r\nimport type { Observer } from \"../../Misc/observable\";\r\nimport { Observable } from \"../../Misc/observable\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { Matrix } from \"../../Maths/math.vector\";\r\nimport { EngineStore } from \"../../Engines/engineStore\";\r\nimport type { InternalTexture } from \"../../Materials/Textures/internalTexture\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport type { IAnimatable } from \"../../Animations/animatable.interface\";\r\nimport { RandomGUID } from \"../../Misc/guid\";\r\n\r\nimport \"../../Misc/fileTools\";\r\nimport type { ThinEngine } from \"../../Engines/thinEngine\";\r\nimport { ThinTexture } from \"./thinTexture\";\r\nimport type { AbstractScene } from \"../../abstractScene\";\r\n\r\ndeclare type Animation = import(\"../../Animations/animation\").Animation;\r\n\r\n/**\r\n * Base class of all the textures in babylon.\r\n * It groups all the common properties the materials, post process, lights... might need\r\n * in order to make a correct use of the texture.\r\n */\r\nexport class BaseTexture extends ThinTexture implements IAnimatable {\r\n /**\r\n * Default anisotropic filtering level for the application.\r\n * It is set to 4 as a good tradeoff between perf and quality.\r\n */\r\n public static DEFAULT_ANISOTROPIC_FILTERING_LEVEL = 4;\r\n\r\n /**\r\n * Gets or sets the unique id of the texture\r\n */\r\n @serialize()\r\n public uniqueId: number;\r\n\r\n /**\r\n * Define the name of the texture.\r\n */\r\n @serialize()\r\n public name: string;\r\n\r\n /**\r\n * Gets or sets an object used to store user defined information.\r\n */\r\n @serialize()\r\n public metadata: any = null;\r\n\r\n /**\r\n * For internal use only. Please do not use.\r\n */\r\n public reservedDataStore: any = null;\r\n\r\n @serialize(\"hasAlpha\")\r\n private _hasAlpha = false;\r\n /**\r\n * Define if the texture is having a usable alpha value (can be use for transparency or glossiness for instance).\r\n */\r\n public set hasAlpha(value: boolean) {\r\n if (this._hasAlpha === value) {\r\n return;\r\n }\r\n this._hasAlpha = value;\r\n if (this._scene) {\r\n this._scene.markAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag, (mat) => {\r\n return mat.hasTexture(this);\r\n });\r\n }\r\n }\r\n public get hasAlpha(): boolean {\r\n return this._hasAlpha;\r\n }\r\n\r\n @serialize(\"getAlphaFromRGB\")\r\n private _getAlphaFromRGB = false;\r\n /**\r\n * Defines if the alpha value should be determined via the rgb values.\r\n * If true the luminance of the pixel might be used to find the corresponding alpha value.\r\n */\r\n public set getAlphaFromRGB(value: boolean) {\r\n if (this._getAlphaFromRGB === value) {\r\n return;\r\n }\r\n this._getAlphaFromRGB = value;\r\n if (this._scene) {\r\n this._scene.markAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag, (mat) => {\r\n return mat.hasTexture(this);\r\n });\r\n }\r\n }\r\n public get getAlphaFromRGB(): boolean {\r\n return this._getAlphaFromRGB;\r\n }\r\n\r\n /**\r\n * Intensity or strength of the texture.\r\n * It is commonly used by materials to fine tune the intensity of the texture\r\n */\r\n @serialize()\r\n public level = 1;\r\n\r\n @serialize(\"coordinatesIndex\")\r\n protected _coordinatesIndex = 0;\r\n\r\n /**\r\n * Gets or sets a boolean indicating that the texture should try to reduce shader code if there is no UV manipulation.\r\n * (ie. when texture.getTextureMatrix().isIdentityAs3x2() returns true)\r\n */\r\n @serialize()\r\n public optimizeUVAllocation = true;\r\n\r\n /**\r\n * Define the UV channel to use starting from 0 and defaulting to 0.\r\n * This is part of the texture as textures usually maps to one uv set.\r\n */\r\n public set coordinatesIndex(value: number) {\r\n if (this._coordinatesIndex === value) {\r\n return;\r\n }\r\n this._coordinatesIndex = value;\r\n if (this._scene) {\r\n this._scene.markAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag, (mat) => {\r\n return mat.hasTexture(this);\r\n });\r\n }\r\n }\r\n public get coordinatesIndex(): number {\r\n return this._coordinatesIndex;\r\n }\r\n\r\n @serialize(\"coordinatesMode\")\r\n protected _coordinatesMode = Constants.TEXTURE_EXPLICIT_MODE;\r\n\r\n /**\r\n * How a texture is mapped.\r\n *\r\n * | Value | Type | Description |\r\n * | ----- | ----------------------------------- | ----------- |\r\n * | 0 | EXPLICIT_MODE | |\r\n * | 1 | SPHERICAL_MODE | |\r\n * | 2 | PLANAR_MODE | |\r\n * | 3 | CUBIC_MODE | |\r\n * | 4 | PROJECTION_MODE | |\r\n * | 5 | SKYBOX_MODE | |\r\n * | 6 | INVCUBIC_MODE | |\r\n * | 7 | EQUIRECTANGULAR_MODE | |\r\n * | 8 | FIXED_EQUIRECTANGULAR_MODE | |\r\n * | 9 | FIXED_EQUIRECTANGULAR_MIRRORED_MODE | |\r\n */\r\n public set coordinatesMode(value: number) {\r\n if (this._coordinatesMode === value) {\r\n return;\r\n }\r\n this._coordinatesMode = value;\r\n if (this._scene) {\r\n this._scene.markAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag, (mat) => {\r\n return mat.hasTexture(this);\r\n });\r\n }\r\n }\r\n public get coordinatesMode(): number {\r\n return this._coordinatesMode;\r\n }\r\n\r\n /**\r\n * | Value | Type | Description |\r\n * | ----- | ------------------ | ----------- |\r\n * | 0 | CLAMP_ADDRESSMODE | |\r\n * | 1 | WRAP_ADDRESSMODE | |\r\n * | 2 | MIRROR_ADDRESSMODE | |\r\n */\r\n @serialize()\r\n public get wrapU() {\r\n return this._wrapU;\r\n }\r\n public set wrapU(value: number) {\r\n this._wrapU = value;\r\n }\r\n\r\n /**\r\n * | Value | Type | Description |\r\n * | ----- | ------------------ | ----------- |\r\n * | 0 | CLAMP_ADDRESSMODE | |\r\n * | 1 | WRAP_ADDRESSMODE | |\r\n * | 2 | MIRROR_ADDRESSMODE | |\r\n */\r\n @serialize()\r\n public get wrapV() {\r\n return this._wrapV;\r\n }\r\n public set wrapV(value: number) {\r\n this._wrapV = value;\r\n }\r\n\r\n /**\r\n * | Value | Type | Description |\r\n * | ----- | ------------------ | ----------- |\r\n * | 0 | CLAMP_ADDRESSMODE | |\r\n * | 1 | WRAP_ADDRESSMODE | |\r\n * | 2 | MIRROR_ADDRESSMODE | |\r\n */\r\n @serialize()\r\n public wrapR = Constants.TEXTURE_WRAP_ADDRESSMODE;\r\n\r\n /**\r\n * With compliant hardware and browser (supporting anisotropic filtering)\r\n * this defines the level of anisotropic filtering in the texture.\r\n * The higher the better but the slower. This defaults to 4 as it seems to be the best tradeoff.\r\n */\r\n @serialize()\r\n public anisotropicFilteringLevel = BaseTexture.DEFAULT_ANISOTROPIC_FILTERING_LEVEL;\r\n\r\n /** @internal */\r\n public _isCube = false;\r\n /**\r\n * Define if the texture is a cube texture or if false a 2d texture.\r\n */\r\n @serialize()\r\n public get isCube(): boolean {\r\n if (!this._texture) {\r\n return this._isCube;\r\n }\r\n\r\n return this._texture.isCube;\r\n }\r\n\r\n protected set isCube(value: boolean) {\r\n if (!this._texture) {\r\n this._isCube = value;\r\n } else {\r\n this._texture.isCube = value;\r\n }\r\n }\r\n\r\n /**\r\n * Define if the texture is a 3d texture (webgl 2) or if false a 2d texture.\r\n */\r\n @serialize()\r\n public get is3D(): boolean {\r\n if (!this._texture) {\r\n return false;\r\n }\r\n\r\n return this._texture.is3D;\r\n }\r\n\r\n protected set is3D(value: boolean) {\r\n if (!this._texture) {\r\n return;\r\n }\r\n\r\n this._texture.is3D = value;\r\n }\r\n\r\n /**\r\n * Define if the texture is a 2d array texture (webgl 2) or if false a 2d texture.\r\n */\r\n @serialize()\r\n public get is2DArray(): boolean {\r\n if (!this._texture) {\r\n return false;\r\n }\r\n\r\n return this._texture.is2DArray;\r\n }\r\n\r\n protected set is2DArray(value: boolean) {\r\n if (!this._texture) {\r\n return;\r\n }\r\n\r\n this._texture.is2DArray = value;\r\n }\r\n\r\n private _gammaSpace = true;\r\n /**\r\n * Define if the texture contains data in gamma space (most of the png/jpg aside bump).\r\n * HDR texture are usually stored in linear space.\r\n * This only impacts the PBR and Background materials\r\n */\r\n @serialize()\r\n public get gammaSpace(): boolean {\r\n if (!this._texture) {\r\n return this._gammaSpace;\r\n } else {\r\n if (this._texture._gammaSpace === null) {\r\n this._texture._gammaSpace = this._gammaSpace;\r\n }\r\n }\r\n\r\n return this._texture._gammaSpace && !this._texture._useSRGBBuffer;\r\n }\r\n\r\n public set gammaSpace(gamma: boolean) {\r\n if (!this._texture) {\r\n if (this._gammaSpace === gamma) {\r\n return;\r\n }\r\n\r\n this._gammaSpace = gamma;\r\n } else {\r\n if (this._texture._gammaSpace === gamma) {\r\n return;\r\n }\r\n this._texture._gammaSpace = gamma;\r\n }\r\n\r\n this._markAllSubMeshesAsTexturesDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets whether or not the texture contains RGBD data.\r\n */\r\n public get isRGBD(): boolean {\r\n return this._texture != null && this._texture._isRGBD;\r\n }\r\n public set isRGBD(value: boolean) {\r\n if (this._texture) {\r\n this._texture._isRGBD = value;\r\n }\r\n }\r\n\r\n /**\r\n * Is Z inverted in the texture (useful in a cube texture).\r\n */\r\n @serialize()\r\n public invertZ = false;\r\n\r\n /**\r\n * Are mip maps generated for this texture or not.\r\n */\r\n public get noMipmap(): boolean {\r\n return false;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n @serialize()\r\n public lodLevelInAlpha = false;\r\n\r\n /**\r\n * With prefiltered texture, defined the offset used during the prefiltering steps.\r\n */\r\n @serialize()\r\n public get lodGenerationOffset(): number {\r\n if (this._texture) {\r\n return this._texture._lodGenerationOffset;\r\n }\r\n\r\n return 0.0;\r\n }\r\n public set lodGenerationOffset(value: number) {\r\n if (this._texture) {\r\n this._texture._lodGenerationOffset = value;\r\n }\r\n }\r\n\r\n /**\r\n * With prefiltered texture, defined the scale used during the prefiltering steps.\r\n */\r\n @serialize()\r\n public get lodGenerationScale(): number {\r\n if (this._texture) {\r\n return this._texture._lodGenerationScale;\r\n }\r\n\r\n return 0.0;\r\n }\r\n public set lodGenerationScale(value: number) {\r\n if (this._texture) {\r\n this._texture._lodGenerationScale = value;\r\n }\r\n }\r\n\r\n /**\r\n * With prefiltered texture, defined if the specular generation is based on a linear ramp.\r\n * By default we are using a log2 of the linear roughness helping to keep a better resolution for\r\n * average roughness values.\r\n */\r\n @serialize()\r\n public get linearSpecularLOD(): boolean {\r\n if (this._texture) {\r\n return this._texture._linearSpecularLOD;\r\n }\r\n\r\n return false;\r\n }\r\n public set linearSpecularLOD(value: boolean) {\r\n if (this._texture) {\r\n this._texture._linearSpecularLOD = value;\r\n }\r\n }\r\n\r\n /**\r\n * In case a better definition than spherical harmonics is required for the diffuse part of the environment.\r\n * You can set the irradiance texture to rely on a texture instead of the spherical approach.\r\n * This texture need to have the same characteristics than its parent (Cube vs 2d, coordinates mode, Gamma/Linear, RGBD).\r\n */\r\n @serializeAsTexture()\r\n public get irradianceTexture(): Nullable<BaseTexture> {\r\n if (this._texture) {\r\n return this._texture._irradianceTexture;\r\n }\r\n\r\n return null;\r\n }\r\n public set irradianceTexture(value: Nullable<BaseTexture>) {\r\n if (this._texture) {\r\n this._texture._irradianceTexture = value;\r\n }\r\n }\r\n\r\n /**\r\n * Define if the texture is a render target.\r\n */\r\n @serialize()\r\n public isRenderTarget = false;\r\n\r\n /**\r\n * Define the unique id of the texture in the scene.\r\n */\r\n public get uid(): string {\r\n if (!this._uid) {\r\n this._uid = RandomGUID();\r\n }\r\n return this._uid;\r\n }\r\n\r\n /** @internal */\r\n public _prefiltered: boolean = false;\r\n /** @internal */\r\n public _forceSerialize: boolean = false;\r\n\r\n /**\r\n * Return a string representation of the texture.\r\n * @returns the texture as a string\r\n */\r\n public toString(): string {\r\n return this.name;\r\n }\r\n\r\n /**\r\n * Get the class name of the texture.\r\n * @returns \"BaseTexture\"\r\n */\r\n public getClassName(): string {\r\n return \"BaseTexture\";\r\n }\r\n\r\n /**\r\n * Define the list of animation attached to the texture.\r\n */\r\n public animations = new Array<Animation>();\r\n\r\n /**\r\n * An event triggered when the texture is disposed.\r\n */\r\n public onDisposeObservable = new Observable<BaseTexture>();\r\n\r\n private _onDisposeObserver: Nullable<Observer<BaseTexture>> = null;\r\n /**\r\n * Callback triggered when the texture has been disposed.\r\n * Kept for back compatibility, you can use the onDisposeObservable instead.\r\n */\r\n public set onDispose(callback: () => void) {\r\n if (this._onDisposeObserver) {\r\n this.onDisposeObservable.remove(this._onDisposeObserver);\r\n }\r\n this._onDisposeObserver = this.onDisposeObservable.add(callback);\r\n }\r\n\r\n protected _scene: Nullable<Scene> = null;\r\n\r\n /** @internal */\r\n private _uid: Nullable<string> = null;\r\n\r\n /**\r\n * Define if the texture is preventing a material to render or not.\r\n * If not and the texture is not ready, the engine will use a default black texture instead.\r\n */\r\n public get isBlocking(): boolean {\r\n return true;\r\n }\r\n\r\n /** @internal */\r\n public _parentContainer: Nullable<AbstractScene> = null;\r\n\r\n protected _loadingError: boolean = false;\r\n protected _errorObject?: {\r\n message?: string;\r\n exception?: any;\r\n };\r\n\r\n /**\r\n * Was there any loading error?\r\n */\r\n public get loadingError(): boolean {\r\n return this._loadingError;\r\n }\r\n\r\n /**\r\n * If a loading error occurred this object will be populated with information about the error.\r\n */\r\n public get errorObject():\r\n | {\r\n message?: string;\r\n exception?: any;\r\n }\r\n | undefined {\r\n return this._errorObject;\r\n }\r\n\r\n /**\r\n * Instantiates a new BaseTexture.\r\n * Base class of all the textures in babylon.\r\n * It groups all the common properties the materials, post process, lights... might need\r\n * in order to make a correct use of the texture.\r\n * @param sceneOrEngine Define the scene or engine the texture belongs to\r\n * @param internalTexture Define the internal texture associated with the texture\r\n */\r\n constructor(sceneOrEngine?: Nullable<Scene | ThinEngine>, internalTexture: Nullable<InternalTexture> = null) {\r\n super(null);\r\n\r\n if (sceneOrEngine) {\r\n if (BaseTexture._IsScene(sceneOrEngine)) {\r\n this._scene = sceneOrEngine;\r\n } else {\r\n this._engine = sceneOrEngine;\r\n }\r\n } else {\r\n this._scene = EngineStore.LastCreatedScene;\r\n }\r\n\r\n if (this._scene) {\r\n this.uniqueId = this._scene.getUniqueId();\r\n this._scene.addTexture(this);\r\n this._engine = this._scene.getEngine();\r\n }\r\n\r\n this._texture = internalTexture;\r\n\r\n this._uid = null;\r\n }\r\n\r\n /**\r\n * Get the scene the texture belongs to.\r\n * @returns the scene or null if undefined\r\n */\r\n public getScene(): Nullable<Scene> {\r\n return this._scene;\r\n }\r\n\r\n /** @internal */\r\n protected _getEngine(): Nullable<ThinEngine> {\r\n return this._engine;\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<BaseTexture>): boolean {\r\n return texture !== null;\r\n }\r\n\r\n /**\r\n * Get the texture transform matrix used to offset tile the texture for instance.\r\n * @returns the transformation matrix\r\n */\r\n public getTextureMatrix(): Matrix {\r\n return <Matrix>Matrix.IdentityReadOnly;\r\n }\r\n\r\n /**\r\n * Get the texture reflection matrix used to rotate/transform the reflection.\r\n * @returns the reflection matrix\r\n */\r\n public getReflectionTextureMatrix(): Matrix {\r\n return <Matrix>Matrix.IdentityReadOnly;\r\n }\r\n\r\n /**\r\n * Get if the texture is ready to be consumed (either it is ready or it is not blocking)\r\n * @returns true if ready, not blocking or if there was an error loading the texture\r\n */\r\n public isReadyOrNotBlocking(): boolean {\r\n return !this.isBlocking || this.isReady() || this.loadingError;\r\n }\r\n\r\n /**\r\n * Scales the texture if is `canRescale()`\r\n * @param ratio the resize factor we want to use to rescale\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public scale(ratio: number): void {}\r\n\r\n /**\r\n * Get if the texture can rescale.\r\n */\r\n public get canRescale(): boolean {\r\n return false;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _getFromCache(url: Nullable<string>, noMipmap: boolean, sampling?: number, invertY?: boolean, useSRGBBuffer?: boolean, isCube?: boolean): Nullable<InternalTexture> {\r\n const engine = this._getEngine();\r\n if (!engine) {\r\n return null;\r\n }\r\n\r\n const correctedUseSRGBBuffer = engine._getUseSRGBBuffer(!!useSRGBBuffer, noMipmap);\r\n\r\n const texturesCache = engine.getLoadedTexturesCache();\r\n for (let index = 0; index < texturesCache.length; index++) {\r\n const texturesCacheEntry = texturesCache[index];\r\n\r\n if (useSRGBBuffer === undefined || correctedUseSRGBBuffer === texturesCacheEntry._useSRGBBuffer) {\r\n if (invertY === undefined || invertY === texturesCacheEntry.invertY) {\r\n if (texturesCacheEntry.url === url && texturesCacheEntry.generateMipMaps === !noMipmap) {\r\n if (!sampling || sampling === texturesCacheEntry.samplingMode) {\r\n if (isCube === undefined || isCube === texturesCacheEntry.isCube) {\r\n texturesCacheEntry.incrementReferences();\r\n return texturesCacheEntry;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /** @internal */\r\n public _rebuild(): void {}\r\n\r\n /**\r\n * Clones the texture.\r\n * @returns the cloned texture\r\n */\r\n public clone(): Nullable<BaseTexture> {\r\n return null;\r\n }\r\n\r\n /**\r\n * Get the texture underlying type (INT, FLOAT...)\r\n */\r\n public get textureType(): number {\r\n if (!this._texture) {\r\n return Constants.TEXTURETYPE_UNSIGNED_INT;\r\n }\r\n\r\n return this._texture.type !== undefined ? this._texture.type : Constants.TEXTURETYPE_UNSIGNED_INT;\r\n }\r\n\r\n /**\r\n * Get the texture underlying format (RGB, RGBA...)\r\n */\r\n public get textureFormat(): number {\r\n if (!this._texture) {\r\n return Constants.TEXTUREFORMAT_RGBA;\r\n }\r\n\r\n return this._texture.format !== undefined ? this._texture.format : Constants.TEXTUREFORMAT_RGBA;\r\n }\r\n\r\n /**\r\n * Indicates that textures need to be re-calculated for all materials\r\n */\r\n protected _markAllSubMeshesAsTexturesDirty() {\r\n const scene = this.getScene();\r\n\r\n if (!scene) {\r\n return;\r\n }\r\n\r\n scene.markAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);\r\n }\r\n\r\n /**\r\n * Reads the pixels stored in the webgl texture and returns them as an ArrayBuffer.\r\n * This will returns an RGBA array buffer containing either in values (0-255) or\r\n * float values (0-1) depending of the underlying buffer type.\r\n * @param faceIndex defines the face of the texture to read (in case of cube texture)\r\n * @param level defines the LOD level of the texture to read (in case of Mip Maps)\r\n * @param buffer defines a user defined buffer to fill with data (can be null)\r\n * @param flushRenderer true to flush the renderer from the pending commands before reading the pixels\r\n * @param noDataConversion false to convert the data to Uint8Array (if texture type is UNSIGNED_BYTE) or to Float32Array (if texture type is anything but UNSIGNED_BYTE). If true, the type of the generated buffer (if buffer==null) will depend on the type of the texture\r\n * @param x defines the region x coordinates to start reading from (default to 0)\r\n * @param y defines the region y coordinates to start reading from (default to 0)\r\n * @param width defines the region width to read from (default to the texture size at level)\r\n * @param height defines the region width to read from (default to the texture size at level)\r\n * @returns The Array buffer promise containing the pixels data.\r\n */\r\n public readPixels(\r\n faceIndex = 0,\r\n level = 0,\r\n buffer: Nullable<ArrayBufferView> = null,\r\n flushRenderer = true,\r\n noDataConversion = false,\r\n x = 0,\r\n y = 0,\r\n width = Number.MAX_VALUE,\r\n height = Number.MAX_VALUE\r\n ): Nullable<Promise<ArrayBufferView>> {\r\n if (!this._texture) {\r\n return null;\r\n }\r\n\r\n const engine = this._getEngine();\r\n if (!engine) {\r\n return null;\r\n }\r\n\r\n const size = this.getSize();\r\n let maxWidth = size.width;\r\n let maxHeight = size.height;\r\n if (level !== 0) {\r\n maxWidth = maxWidth / Math.pow(2, level);\r\n maxHeight = maxHeight / Math.pow(2, level);\r\n maxWidth = Math.round(maxWidth);\r\n maxHeight = Math.round(maxHeight);\r\n }\r\n\r\n width = Math.min(maxWidth, width);\r\n height = Math.min(maxHeight, height);\r\n\r\n try {\r\n if (this._texture.isCube) {\r\n return engine._readTexturePixels(this._texture, width, height, faceIndex, level, buffer, flushRenderer, noDataConversion, x, y);\r\n }\r\n\r\n return engine._readTexturePixels(this._texture, width, height, -1, level, buffer, flushRenderer, noDataConversion, x, y);\r\n } catch (e) {\r\n return null;\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _readPixelsSync(faceIndex = 0, level = 0, buffer: Nullable<ArrayBufferView> = null, flushRenderer = true, noDataConversion = false): Nullable<ArrayBufferView> {\r\n if (!this._texture) {\r\n return null;\r\n }\r\n\r\n const size = this.getSize();\r\n let width = size.width;\r\n let height = size.height;\r\n\r\n const engine = this._getEngine();\r\n if (!engine) {\r\n return null;\r\n }\r\n\r\n if (level != 0) {\r\n width = width / Math.pow(2, level);\r\n height = height / Math.pow(2, level);\r\n\r\n width = Math.round(width);\r\n height = Math.round(height);\r\n }\r\n\r\n try {\r\n if (this._texture.isCube) {\r\n return engine._readTexturePixelsSync(this._texture, width, height, faceIndex, level, buffer, flushRenderer, noDataConversion);\r\n }\r\n\r\n return engine._readTexturePixelsSync(this._texture, width, height, -1, level, buffer, flushRenderer, noDataConversion);\r\n } catch (e) {\r\n return null;\r\n }\r\n }\r\n\r\n /** @internal */\r\n public get _lodTextureHigh(): Nullable<BaseTexture> {\r\n if (this._texture) {\r\n return this._texture._lodTextureHigh;\r\n }\r\n return null;\r\n }\r\n\r\n /** @internal */\r\n public get _lodTextureMid(): Nullable<BaseTexture> {\r\n if (this._texture) {\r\n return this._texture._lodTextureMid;\r\n }\r\n return null;\r\n }\r\n\r\n /** @internal */\r\n public get _lodTextureLow(): Nullable<BaseTexture> {\r\n if (this._texture) {\r\n return this._texture._lodTextureLow;\r\n }\r\n return null;\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 if (this._scene) {\r\n // Animations\r\n if (this._scene.stopAnimation) {\r\n this._scene.stopAnimation(this);\r\n }\r\n\r\n // Remove from scene\r\n this._scene.removePendingData(this);\r\n const index = this._scene.textures.indexOf(this);\r\n\r\n if (index >= 0) {\r\n this._scene.textures.splice(index, 1);\r\n }\r\n this._scene.onTextureRemovedObservable.notifyObservers(this);\r\n this._scene = null;\r\n\r\n if (this._parentContainer) {\r\n const index = this._parentContainer.textures.indexOf(this);\r\n if (index > -1) {\r\n this._parentContainer.textures.splice(index, 1);\r\n }\r\n this._parentContainer = null;\r\n }\r\n }\r\n\r\n // Callback\r\n this.onDisposeObservable.notifyObservers(this);\r\n this.onDisposeObservable.clear();\r\n\r\n this.metadata = null;\r\n\r\n super.dispose();\r\n }\r\n\r\n /**\r\n * Serialize the texture into a JSON representation that can be parsed later on.\r\n * @returns the JSON representation of the texture\r\n */\r\n public serialize(): any {\r\n if (!this.name) {\r\n return null;\r\n }\r\n\r\n const serializationObject = SerializationHelper.Serialize(this);\r\n\r\n // Animations\r\n SerializationHelper.AppendSerializedAnimations(this, serializationObject);\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Helper function to be called back once a list of texture contains only ready textures.\r\n * @param textures Define the list of textures to wait for\r\n * @param callback Define the callback triggered once the entire list will be ready\r\n */\r\n public static WhenAllReady(textures: BaseTexture[], callback: () => void): void {\r\n let numRemaining = textures.length;\r\n if (numRemaining === 0) {\r\n callback();\r\n return;\r\n }\r\n\r\n for (let i = 0; i < textures.length; i++) {\r\n const texture = textures[i];\r\n\r\n if (texture.isReady()) {\r\n if (--numRemaining === 0) {\r\n callback();\r\n }\r\n } else {\r\n const onLoadObservable = (texture as any).onLoadObservable as Observable<BaseTexture>;\r\n\r\n if (onLoadObservable) {\r\n onLoadObservable.addOnce(() => {\r\n if (--numRemaining === 0) {\r\n callback();\r\n }\r\n });\r\n } else {\r\n if (--numRemaining === 0) {\r\n callback();\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n private static _IsScene(sceneOrEngine: Scene | ThinEngine): sceneOrEngine is Scene {\r\n return sceneOrEngine.getClassName() === \"Scene\";\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"baseTexture.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Materials/Textures/baseTexture.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3F,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAK5C;;;;GAIG;AACH,MAAM,OAAO,WAAY,SAAQ,WAAW;IA0exC;;;;;;;OAOG;IACH,YAAY,aAA4C,EAAE,kBAA6C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AY,KAAK,CAAC,EAAE;4BACtB,QAAQ,EAAE,CAAC;yBACd;oBACL,CAAC,CAAC,CAAC;iBACN;qBAAM;oBACH,IAAI,EAAE,YAAY,KAAK,CAAC,EAAE;wBACtB,QAAQ,EAAE,CAAC;qBACd;iBACJ;aACJ;SACJ;IACL,CAAC;IAEO,MAAM,CAAC,QAAQ,CAAC,aAAiC;QACrD,OAAO,aAAa,CAAC,YAAY,EAAE,KAAK,OAAO,CAAC;IACpD,CAAC;;AAz2BD;;;GAGG;AACW,+CAAmC,GAAG,CAAC,CAAC;AAMtD;IADC,SAAS,EAAE;6CACY;AAMxB;IADC,SAAS,EAAE;yCACQ;AAMpB;IADC,SAAS,EAAE;6CACgB;AAQ5B;IADC,SAAS,CAAC,UAAU,CAAC;8CACI;AAoB1B;IADC,SAAS,CAAC,iBAAiB,CAAC;qDACI;AAyBjC;IADC,SAAS,EAAE;0CACK;AAGjB;IADC,SAAS,CAAC,kBAAkB,CAAC;sDACE;AAOhC;IADC,SAAS,EAAE;yDACuB;AAsBnC;IADC,SAAS,CAAC,iBAAiB,CAAC;qDACgC;AAyC7D;IADC,SAAS,EAAE;wCAGX;AAaD;IADC,SAAS,EAAE;wCAGX;AAaD;IADC,SAAS,EAAE;0CACsC;AAQlD;IADC,SAAS,EAAE;8DACuE;AAQnF;IADC,SAAS,EAAE;yCAOX;AAcD;IADC,SAAS,EAAE;uCAOX;AAcD;IADC,SAAS,EAAE;4CAOX;AAiBD;IADC,SAAS,EAAE;6CAWX;AAmCD;IADC,SAAS,EAAE;4CACW;AAavB;IADC,SAAS,EAAE;oDACmB;AAM/B;IADC,SAAS,EAAE;sDAOX;AAWD;IADC,SAAS,EAAE;qDAOX;AAaD;IADC,SAAS,EAAE;oDAOX;AAaD;IADC,kBAAkB,EAAE;oDAOpB;AAWD;IADC,SAAS,EAAE;mDACkB","sourcesContent":["import { serialize, SerializationHelper, serializeAsTexture } from \"../../Misc/decorators\";\r\nimport type { Observer } from \"../../Misc/observable\";\r\nimport { Observable } from \"../../Misc/observable\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { Matrix } from \"../../Maths/math.vector\";\r\nimport { EngineStore } from \"../../Engines/engineStore\";\r\nimport type { InternalTexture } from \"../../Materials/Textures/internalTexture\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport type { IAnimatable } from \"../../Animations/animatable.interface\";\r\nimport { RandomGUID } from \"../../Misc/guid\";\r\n\r\nimport \"../../Misc/fileTools\";\r\nimport type { ThinEngine } from \"../../Engines/thinEngine\";\r\nimport { ThinTexture } from \"./thinTexture\";\r\nimport type { AbstractScene } from \"../../abstractScene\";\r\n\r\ndeclare type Animation = import(\"../../Animations/animation\").Animation;\r\n\r\n/**\r\n * Base class of all the textures in babylon.\r\n * It groups all the common properties the materials, post process, lights... might need\r\n * in order to make a correct use of the texture.\r\n */\r\nexport class BaseTexture extends ThinTexture implements IAnimatable {\r\n /**\r\n * Default anisotropic filtering level for the application.\r\n * It is set to 4 as a good tradeoff between perf and quality.\r\n */\r\n public static DEFAULT_ANISOTROPIC_FILTERING_LEVEL = 4;\r\n\r\n /**\r\n * Gets or sets the unique id of the texture\r\n */\r\n @serialize()\r\n public uniqueId: number;\r\n\r\n /**\r\n * Define the name of the texture.\r\n */\r\n @serialize()\r\n public name: string;\r\n\r\n /**\r\n * Gets or sets an object used to store user defined information.\r\n */\r\n @serialize()\r\n public metadata: any = null;\r\n\r\n /**\r\n * For internal use only. Please do not use.\r\n */\r\n public reservedDataStore: any = null;\r\n\r\n @serialize(\"hasAlpha\")\r\n private _hasAlpha = false;\r\n /**\r\n * Define if the texture is having a usable alpha value (can be use for transparency or glossiness for instance).\r\n */\r\n public set hasAlpha(value: boolean) {\r\n if (this._hasAlpha === value) {\r\n return;\r\n }\r\n this._hasAlpha = value;\r\n if (this._scene) {\r\n this._scene.markAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag, (mat) => {\r\n return mat.hasTexture(this);\r\n });\r\n }\r\n }\r\n public get hasAlpha(): boolean {\r\n return this._hasAlpha;\r\n }\r\n\r\n @serialize(\"getAlphaFromRGB\")\r\n private _getAlphaFromRGB = false;\r\n /**\r\n * Defines if the alpha value should be determined via the rgb values.\r\n * If true the luminance of the pixel might be used to find the corresponding alpha value.\r\n */\r\n public set getAlphaFromRGB(value: boolean) {\r\n if (this._getAlphaFromRGB === value) {\r\n return;\r\n }\r\n this._getAlphaFromRGB = value;\r\n if (this._scene) {\r\n this._scene.markAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag, (mat) => {\r\n return mat.hasTexture(this);\r\n });\r\n }\r\n }\r\n public get getAlphaFromRGB(): boolean {\r\n return this._getAlphaFromRGB;\r\n }\r\n\r\n /**\r\n * Intensity or strength of the texture.\r\n * It is commonly used by materials to fine tune the intensity of the texture\r\n */\r\n @serialize()\r\n public level = 1;\r\n\r\n @serialize(\"coordinatesIndex\")\r\n protected _coordinatesIndex = 0;\r\n\r\n /**\r\n * Gets or sets a boolean indicating that the texture should try to reduce shader code if there is no UV manipulation.\r\n * (ie. when texture.getTextureMatrix().isIdentityAs3x2() returns true)\r\n */\r\n @serialize()\r\n public optimizeUVAllocation = true;\r\n\r\n /**\r\n * Define the UV channel to use starting from 0 and defaulting to 0.\r\n * This is part of the texture as textures usually maps to one uv set.\r\n */\r\n public set coordinatesIndex(value: number) {\r\n if (this._coordinatesIndex === value) {\r\n return;\r\n }\r\n this._coordinatesIndex = value;\r\n if (this._scene) {\r\n this._scene.markAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag, (mat) => {\r\n return mat.hasTexture(this);\r\n });\r\n }\r\n }\r\n public get coordinatesIndex(): number {\r\n return this._coordinatesIndex;\r\n }\r\n\r\n @serialize(\"coordinatesMode\")\r\n protected _coordinatesMode = Constants.TEXTURE_EXPLICIT_MODE;\r\n\r\n /**\r\n * How a texture is mapped.\r\n *\r\n * | Value | Type | Description |\r\n * | ----- | ----------------------------------- | ----------- |\r\n * | 0 | EXPLICIT_MODE | |\r\n * | 1 | SPHERICAL_MODE | |\r\n * | 2 | PLANAR_MODE | |\r\n * | 3 | CUBIC_MODE | |\r\n * | 4 | PROJECTION_MODE | |\r\n * | 5 | SKYBOX_MODE | |\r\n * | 6 | INVCUBIC_MODE | |\r\n * | 7 | EQUIRECTANGULAR_MODE | |\r\n * | 8 | FIXED_EQUIRECTANGULAR_MODE | |\r\n * | 9 | FIXED_EQUIRECTANGULAR_MIRRORED_MODE | |\r\n */\r\n public set coordinatesMode(value: number) {\r\n if (this._coordinatesMode === value) {\r\n return;\r\n }\r\n this._coordinatesMode = value;\r\n if (this._scene) {\r\n this._scene.markAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag, (mat) => {\r\n return mat.hasTexture(this);\r\n });\r\n }\r\n }\r\n public get coordinatesMode(): number {\r\n return this._coordinatesMode;\r\n }\r\n\r\n /**\r\n * | Value | Type | Description |\r\n * | ----- | ------------------ | ----------- |\r\n * | 0 | CLAMP_ADDRESSMODE | |\r\n * | 1 | WRAP_ADDRESSMODE | |\r\n * | 2 | MIRROR_ADDRESSMODE | |\r\n */\r\n @serialize()\r\n public get wrapU() {\r\n return this._wrapU;\r\n }\r\n public set wrapU(value: number) {\r\n this._wrapU = value;\r\n }\r\n\r\n /**\r\n * | Value | Type | Description |\r\n * | ----- | ------------------ | ----------- |\r\n * | 0 | CLAMP_ADDRESSMODE | |\r\n * | 1 | WRAP_ADDRESSMODE | |\r\n * | 2 | MIRROR_ADDRESSMODE | |\r\n */\r\n @serialize()\r\n public get wrapV() {\r\n return this._wrapV;\r\n }\r\n public set wrapV(value: number) {\r\n this._wrapV = value;\r\n }\r\n\r\n /**\r\n * | Value | Type | Description |\r\n * | ----- | ------------------ | ----------- |\r\n * | 0 | CLAMP_ADDRESSMODE | |\r\n * | 1 | WRAP_ADDRESSMODE | |\r\n * | 2 | MIRROR_ADDRESSMODE | |\r\n */\r\n @serialize()\r\n public wrapR = Constants.TEXTURE_WRAP_ADDRESSMODE;\r\n\r\n /**\r\n * With compliant hardware and browser (supporting anisotropic filtering)\r\n * this defines the level of anisotropic filtering in the texture.\r\n * The higher the better but the slower. This defaults to 4 as it seems to be the best tradeoff.\r\n */\r\n @serialize()\r\n public anisotropicFilteringLevel = BaseTexture.DEFAULT_ANISOTROPIC_FILTERING_LEVEL;\r\n\r\n /** @internal */\r\n public _isCube = false;\r\n /**\r\n * Define if the texture is a cube texture or if false a 2d texture.\r\n */\r\n @serialize()\r\n public get isCube(): boolean {\r\n if (!this._texture) {\r\n return this._isCube;\r\n }\r\n\r\n return this._texture.isCube;\r\n }\r\n\r\n protected set isCube(value: boolean) {\r\n if (!this._texture) {\r\n this._isCube = value;\r\n } else {\r\n this._texture.isCube = value;\r\n }\r\n }\r\n\r\n /**\r\n * Define if the texture is a 3d texture (webgl 2) or if false a 2d texture.\r\n */\r\n @serialize()\r\n public get is3D(): boolean {\r\n if (!this._texture) {\r\n return false;\r\n }\r\n\r\n return this._texture.is3D;\r\n }\r\n\r\n protected set is3D(value: boolean) {\r\n if (!this._texture) {\r\n return;\r\n }\r\n\r\n this._texture.is3D = value;\r\n }\r\n\r\n /**\r\n * Define if the texture is a 2d array texture (webgl 2) or if false a 2d texture.\r\n */\r\n @serialize()\r\n public get is2DArray(): boolean {\r\n if (!this._texture) {\r\n return false;\r\n }\r\n\r\n return this._texture.is2DArray;\r\n }\r\n\r\n protected set is2DArray(value: boolean) {\r\n if (!this._texture) {\r\n return;\r\n }\r\n\r\n this._texture.is2DArray = value;\r\n }\r\n\r\n private _gammaSpace = true;\r\n /**\r\n * Define if the texture contains data in gamma space (most of the png/jpg aside bump).\r\n * HDR texture are usually stored in linear space.\r\n * This only impacts the PBR and Background materials\r\n */\r\n @serialize()\r\n public get gammaSpace(): boolean {\r\n if (!this._texture) {\r\n return this._gammaSpace;\r\n } else {\r\n if (this._texture._gammaSpace === null) {\r\n this._texture._gammaSpace = this._gammaSpace;\r\n }\r\n }\r\n\r\n return this._texture._gammaSpace && !this._texture._useSRGBBuffer;\r\n }\r\n\r\n public set gammaSpace(gamma: boolean) {\r\n if (!this._texture) {\r\n if (this._gammaSpace === gamma) {\r\n return;\r\n }\r\n\r\n this._gammaSpace = gamma;\r\n } else {\r\n if (this._texture._gammaSpace === gamma) {\r\n return;\r\n }\r\n this._texture._gammaSpace = gamma;\r\n }\r\n\r\n this._markAllSubMeshesAsTexturesDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets whether or not the texture contains RGBD data.\r\n */\r\n public get isRGBD(): boolean {\r\n return this._texture != null && this._texture._isRGBD;\r\n }\r\n public set isRGBD(value: boolean) {\r\n if (this._texture) {\r\n this._texture._isRGBD = value;\r\n }\r\n }\r\n\r\n /**\r\n * Is Z inverted in the texture (useful in a cube texture).\r\n */\r\n @serialize()\r\n public invertZ = false;\r\n\r\n /**\r\n * Are mip maps generated for this texture or not.\r\n */\r\n public get noMipmap(): boolean {\r\n return false;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n @serialize()\r\n public lodLevelInAlpha = false;\r\n\r\n /**\r\n * With prefiltered texture, defined the offset used during the prefiltering steps.\r\n */\r\n @serialize()\r\n public get lodGenerationOffset(): number {\r\n if (this._texture) {\r\n return this._texture._lodGenerationOffset;\r\n }\r\n\r\n return 0.0;\r\n }\r\n public set lodGenerationOffset(value: number) {\r\n if (this._texture) {\r\n this._texture._lodGenerationOffset = value;\r\n }\r\n }\r\n\r\n /**\r\n * With prefiltered texture, defined the scale used during the prefiltering steps.\r\n */\r\n @serialize()\r\n public get lodGenerationScale(): number {\r\n if (this._texture) {\r\n return this._texture._lodGenerationScale;\r\n }\r\n\r\n return 0.0;\r\n }\r\n public set lodGenerationScale(value: number) {\r\n if (this._texture) {\r\n this._texture._lodGenerationScale = value;\r\n }\r\n }\r\n\r\n /**\r\n * With prefiltered texture, defined if the specular generation is based on a linear ramp.\r\n * By default we are using a log2 of the linear roughness helping to keep a better resolution for\r\n * average roughness values.\r\n */\r\n @serialize()\r\n public get linearSpecularLOD(): boolean {\r\n if (this._texture) {\r\n return this._texture._linearSpecularLOD;\r\n }\r\n\r\n return false;\r\n }\r\n public set linearSpecularLOD(value: boolean) {\r\n if (this._texture) {\r\n this._texture._linearSpecularLOD = value;\r\n }\r\n }\r\n\r\n /**\r\n * In case a better definition than spherical harmonics is required for the diffuse part of the environment.\r\n * You can set the irradiance texture to rely on a texture instead of the spherical approach.\r\n * This texture need to have the same characteristics than its parent (Cube vs 2d, coordinates mode, Gamma/Linear, RGBD).\r\n */\r\n @serializeAsTexture()\r\n public get irradianceTexture(): Nullable<BaseTexture> {\r\n if (this._texture) {\r\n return this._texture._irradianceTexture;\r\n }\r\n\r\n return null;\r\n }\r\n public set irradianceTexture(value: Nullable<BaseTexture>) {\r\n if (this._texture) {\r\n this._texture._irradianceTexture = value;\r\n }\r\n }\r\n\r\n /**\r\n * Define if the texture is a render target.\r\n */\r\n @serialize()\r\n public isRenderTarget = false;\r\n\r\n /**\r\n * Define the unique id of the texture in the scene.\r\n */\r\n public get uid(): string {\r\n if (!this._uid) {\r\n this._uid = RandomGUID();\r\n }\r\n return this._uid;\r\n }\r\n\r\n /** @internal */\r\n public _prefiltered: boolean = false;\r\n /** @internal */\r\n public _forceSerialize: boolean = false;\r\n\r\n /**\r\n * Return a string representation of the texture.\r\n * @returns the texture as a string\r\n */\r\n public toString(): string {\r\n return this.name;\r\n }\r\n\r\n /**\r\n * Get the class name of the texture.\r\n * @returns \"BaseTexture\"\r\n */\r\n public getClassName(): string {\r\n return \"BaseTexture\";\r\n }\r\n\r\n /**\r\n * Define the list of animation attached to the texture.\r\n */\r\n public animations = new Array<Animation>();\r\n\r\n /**\r\n * An event triggered when the texture is disposed.\r\n */\r\n public onDisposeObservable = new Observable<BaseTexture>();\r\n\r\n private _onDisposeObserver: Nullable<Observer<BaseTexture>> = null;\r\n /**\r\n * Callback triggered when the texture has been disposed.\r\n * Kept for back compatibility, you can use the onDisposeObservable instead.\r\n */\r\n public set onDispose(callback: () => void) {\r\n if (this._onDisposeObserver) {\r\n this.onDisposeObservable.remove(this._onDisposeObserver);\r\n }\r\n this._onDisposeObserver = this.onDisposeObservable.add(callback);\r\n }\r\n\r\n protected _scene: Nullable<Scene> = null;\r\n\r\n /** @internal */\r\n private _uid: Nullable<string> = null;\r\n\r\n /**\r\n * Define if the texture is preventing a material to render or not.\r\n * If not and the texture is not ready, the engine will use a default black texture instead.\r\n */\r\n public get isBlocking(): boolean {\r\n return true;\r\n }\r\n\r\n /** @internal */\r\n public _parentContainer: Nullable<AbstractScene> = null;\r\n\r\n protected _loadingError: boolean = false;\r\n protected _errorObject?: {\r\n message?: string;\r\n exception?: any;\r\n };\r\n\r\n /**\r\n * Was there any loading error?\r\n */\r\n public get loadingError(): boolean {\r\n return this._loadingError;\r\n }\r\n\r\n /**\r\n * If a loading error occurred this object will be populated with information about the error.\r\n */\r\n public get errorObject():\r\n | {\r\n message?: string;\r\n exception?: any;\r\n }\r\n | undefined {\r\n return this._errorObject;\r\n }\r\n\r\n /**\r\n * Instantiates a new BaseTexture.\r\n * Base class of all the textures in babylon.\r\n * It groups all the common properties the materials, post process, lights... might need\r\n * in order to make a correct use of the texture.\r\n * @param sceneOrEngine Define the scene or engine the texture belongs to\r\n * @param internalTexture Define the internal texture associated with the texture\r\n */\r\n constructor(sceneOrEngine?: Nullable<Scene | ThinEngine>, internalTexture: Nullable<InternalTexture> = null) {\r\n super(null);\r\n\r\n if (sceneOrEngine) {\r\n if (BaseTexture._IsScene(sceneOrEngine)) {\r\n this._scene = sceneOrEngine;\r\n } else {\r\n this._engine = sceneOrEngine;\r\n }\r\n } else {\r\n this._scene = EngineStore.LastCreatedScene;\r\n }\r\n\r\n if (this._scene) {\r\n this.uniqueId = this._scene.getUniqueId();\r\n this._scene.addTexture(this);\r\n this._engine = this._scene.getEngine();\r\n }\r\n\r\n this._texture = internalTexture;\r\n\r\n this._uid = null;\r\n }\r\n\r\n /**\r\n * Get the scene the texture belongs to.\r\n * @returns the scene or null if undefined\r\n */\r\n public getScene(): Nullable<Scene> {\r\n return this._scene;\r\n }\r\n\r\n /** @internal */\r\n protected _getEngine(): Nullable<ThinEngine> {\r\n return this._engine;\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<BaseTexture>): boolean {\r\n return texture !== null;\r\n }\r\n\r\n /**\r\n * Get the texture transform matrix used to offset tile the texture for instance.\r\n * @returns the transformation matrix\r\n */\r\n public getTextureMatrix(): Matrix {\r\n return <Matrix>Matrix.IdentityReadOnly;\r\n }\r\n\r\n /**\r\n * Get the texture reflection matrix used to rotate/transform the reflection.\r\n * @returns the reflection matrix\r\n */\r\n public getReflectionTextureMatrix(): Matrix {\r\n return <Matrix>Matrix.IdentityReadOnly;\r\n }\r\n\r\n /**\r\n * Get if the texture is ready to be consumed (either it is ready or it is not blocking)\r\n * @returns true if ready, not blocking or if there was an error loading the texture\r\n */\r\n public isReadyOrNotBlocking(): boolean {\r\n return !this.isBlocking || this.isReady() || this.loadingError;\r\n }\r\n\r\n /**\r\n * Scales the texture if is `canRescale()`\r\n * @param ratio the resize factor we want to use to rescale\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public scale(ratio: number): void {}\r\n\r\n /**\r\n * Get if the texture can rescale.\r\n */\r\n public get canRescale(): boolean {\r\n return false;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _getFromCache(url: Nullable<string>, noMipmap: boolean, sampling?: number, invertY?: boolean, useSRGBBuffer?: boolean, isCube?: boolean): Nullable<InternalTexture> {\r\n const engine = this._getEngine();\r\n if (!engine) {\r\n return null;\r\n }\r\n\r\n const correctedUseSRGBBuffer = engine._getUseSRGBBuffer(!!useSRGBBuffer, noMipmap);\r\n\r\n const texturesCache = engine.getLoadedTexturesCache();\r\n for (let index = 0; index < texturesCache.length; index++) {\r\n const texturesCacheEntry = texturesCache[index];\r\n\r\n if (useSRGBBuffer === undefined || correctedUseSRGBBuffer === texturesCacheEntry._useSRGBBuffer) {\r\n if (invertY === undefined || invertY === texturesCacheEntry.invertY) {\r\n if (texturesCacheEntry.url === url && texturesCacheEntry.generateMipMaps === !noMipmap) {\r\n if (!sampling || sampling === texturesCacheEntry.samplingMode) {\r\n if (isCube === undefined || isCube === texturesCacheEntry.isCube) {\r\n texturesCacheEntry.incrementReferences();\r\n return texturesCacheEntry;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /** @internal */\r\n public _rebuild(): void {}\r\n\r\n /**\r\n * Clones the texture.\r\n * @returns the cloned texture\r\n */\r\n public clone(): Nullable<BaseTexture> {\r\n return null;\r\n }\r\n\r\n /**\r\n * Get the texture underlying type (INT, FLOAT...)\r\n */\r\n public get textureType(): number {\r\n if (!this._texture) {\r\n return Constants.TEXTURETYPE_UNSIGNED_INT;\r\n }\r\n\r\n return this._texture.type !== undefined ? this._texture.type : Constants.TEXTURETYPE_UNSIGNED_INT;\r\n }\r\n\r\n /**\r\n * Get the texture underlying format (RGB, RGBA...)\r\n */\r\n public get textureFormat(): number {\r\n if (!this._texture) {\r\n return Constants.TEXTUREFORMAT_RGBA;\r\n }\r\n\r\n return this._texture.format !== undefined ? this._texture.format : Constants.TEXTUREFORMAT_RGBA;\r\n }\r\n\r\n /**\r\n * Indicates that textures need to be re-calculated for all materials\r\n */\r\n protected _markAllSubMeshesAsTexturesDirty() {\r\n const scene = this.getScene();\r\n\r\n if (!scene) {\r\n return;\r\n }\r\n\r\n scene.markAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);\r\n }\r\n\r\n /**\r\n * Reads the pixels stored in the webgl texture and returns them as an ArrayBuffer.\r\n * This will returns an RGBA array buffer containing either in values (0-255) or\r\n * float values (0-1) depending of the underlying buffer type.\r\n * @param faceIndex defines the face of the texture to read (in case of cube texture)\r\n * @param level defines the LOD level of the texture to read (in case of Mip Maps)\r\n * @param buffer defines a user defined buffer to fill with data (can be null)\r\n * @param flushRenderer true to flush the renderer from the pending commands before reading the pixels\r\n * @param noDataConversion false to convert the data to Uint8Array (if texture type is UNSIGNED_BYTE) or to Float32Array (if texture type is anything but UNSIGNED_BYTE). If true, the type of the generated buffer (if buffer==null) will depend on the type of the texture\r\n * @param x defines the region x coordinates to start reading from (default to 0)\r\n * @param y defines the region y coordinates to start reading from (default to 0)\r\n * @param width defines the region width to read from (default to the texture size at level)\r\n * @param height defines the region width to read from (default to the texture size at level)\r\n * @returns The Array buffer promise containing the pixels data.\r\n */\r\n public readPixels(\r\n faceIndex = 0,\r\n level = 0,\r\n buffer: Nullable<ArrayBufferView> = null,\r\n flushRenderer = true,\r\n noDataConversion = false,\r\n x = 0,\r\n y = 0,\r\n width = Number.MAX_VALUE,\r\n height = Number.MAX_VALUE\r\n ): Nullable<Promise<ArrayBufferView>> {\r\n if (!this._texture) {\r\n return null;\r\n }\r\n\r\n const engine = this._getEngine();\r\n if (!engine) {\r\n return null;\r\n }\r\n\r\n const size = this.getSize();\r\n let maxWidth = size.width;\r\n let maxHeight = size.height;\r\n if (level !== 0) {\r\n maxWidth = maxWidth / Math.pow(2, level);\r\n maxHeight = maxHeight / Math.pow(2, level);\r\n maxWidth = Math.round(maxWidth);\r\n maxHeight = Math.round(maxHeight);\r\n }\r\n\r\n width = Math.min(maxWidth, width);\r\n height = Math.min(maxHeight, height);\r\n\r\n try {\r\n if (this._texture.isCube) {\r\n return engine._readTexturePixels(this._texture, width, height, faceIndex, level, buffer, flushRenderer, noDataConversion, x, y);\r\n }\r\n\r\n return engine._readTexturePixels(this._texture, width, height, -1, level, buffer, flushRenderer, noDataConversion, x, y);\r\n } catch (e) {\r\n return null;\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _readPixelsSync(faceIndex = 0, level = 0, buffer: Nullable<ArrayBufferView> = null, flushRenderer = true, noDataConversion = false): Nullable<ArrayBufferView> {\r\n if (!this._texture) {\r\n return null;\r\n }\r\n\r\n const size = this.getSize();\r\n let width = size.width;\r\n let height = size.height;\r\n\r\n const engine = this._getEngine();\r\n if (!engine) {\r\n return null;\r\n }\r\n\r\n if (level != 0) {\r\n width = width / Math.pow(2, level);\r\n height = height / Math.pow(2, level);\r\n\r\n width = Math.round(width);\r\n height = Math.round(height);\r\n }\r\n\r\n try {\r\n if (this._texture.isCube) {\r\n return engine._readTexturePixelsSync(this._texture, width, height, faceIndex, level, buffer, flushRenderer, noDataConversion);\r\n }\r\n\r\n return engine._readTexturePixelsSync(this._texture, width, height, -1, level, buffer, flushRenderer, noDataConversion);\r\n } catch (e) {\r\n return null;\r\n }\r\n }\r\n\r\n /** @internal */\r\n public get _lodTextureHigh(): Nullable<BaseTexture> {\r\n if (this._texture) {\r\n return this._texture._lodTextureHigh;\r\n }\r\n return null;\r\n }\r\n\r\n /** @internal */\r\n public get _lodTextureMid(): Nullable<BaseTexture> {\r\n if (this._texture) {\r\n return this._texture._lodTextureMid;\r\n }\r\n return null;\r\n }\r\n\r\n /** @internal */\r\n public get _lodTextureLow(): Nullable<BaseTexture> {\r\n if (this._texture) {\r\n return this._texture._lodTextureLow;\r\n }\r\n return null;\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 if (this._scene) {\r\n // Animations\r\n if (this._scene.stopAnimation) {\r\n this._scene.stopAnimation(this);\r\n }\r\n\r\n // Remove from scene\r\n this._scene.removePendingData(this);\r\n const index = this._scene.textures.indexOf(this);\r\n\r\n if (index >= 0) {\r\n this._scene.textures.splice(index, 1);\r\n }\r\n this._scene.onTextureRemovedObservable.notifyObservers(this);\r\n this._scene = null;\r\n\r\n if (this._parentContainer) {\r\n const index = this._parentContainer.textures.indexOf(this);\r\n if (index > -1) {\r\n this._parentContainer.textures.splice(index, 1);\r\n }\r\n this._parentContainer = null;\r\n }\r\n }\r\n\r\n // Callback\r\n this.onDisposeObservable.notifyObservers(this);\r\n this.onDisposeObservable.clear();\r\n\r\n this.metadata = null;\r\n\r\n super.dispose();\r\n }\r\n\r\n /**\r\n * Serialize the texture into a JSON representation that can be parsed later on.\r\n * @param allowEmptyName True to force serialization even if name is empty. Default: false\r\n * @returns the JSON representation of the texture\r\n */\r\n public serialize(allowEmptyName = false): any {\r\n if (!this.name && !allowEmptyName) {\r\n return null;\r\n }\r\n\r\n const serializationObject = SerializationHelper.Serialize(this);\r\n\r\n // Animations\r\n SerializationHelper.AppendSerializedAnimations(this, serializationObject);\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Helper function to be called back once a list of texture contains only ready textures.\r\n * @param textures Define the list of textures to wait for\r\n * @param callback Define the callback triggered once the entire list will be ready\r\n */\r\n public static WhenAllReady(textures: BaseTexture[], callback: () => void): void {\r\n let numRemaining = textures.length;\r\n if (numRemaining === 0) {\r\n callback();\r\n return;\r\n }\r\n\r\n for (let i = 0; i < textures.length; i++) {\r\n const texture = textures[i];\r\n\r\n if (texture.isReady()) {\r\n if (--numRemaining === 0) {\r\n callback();\r\n }\r\n } else {\r\n const onLoadObservable = (texture as any).onLoadObservable as Observable<BaseTexture>;\r\n\r\n if (onLoadObservable) {\r\n onLoadObservable.addOnce(() => {\r\n if (--numRemaining === 0) {\r\n callback();\r\n }\r\n });\r\n } else {\r\n if (--numRemaining === 0) {\r\n callback();\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n private static _IsScene(sceneOrEngine: Scene | ThinEngine): sceneOrEngine is Scene {\r\n return sceneOrEngine.getClassName() === \"Scene\";\r\n }\r\n}\r\n"]}
|
|
@@ -239,6 +239,8 @@ export declare class InternalTexture extends TextureSampler {
|
|
|
239
239
|
static _Counter: number;
|
|
240
240
|
/** Gets the unique id of the internal texture */
|
|
241
241
|
get uniqueId(): number;
|
|
242
|
+
/** @internal */
|
|
243
|
+
_setUniqueId(id: number): void;
|
|
242
244
|
/**
|
|
243
245
|
* Gets the Engine the texture belongs to.
|
|
244
246
|
* @returns The babylon engine
|
|
@@ -246,6 +246,10 @@ export class InternalTexture extends TextureSampler {
|
|
|
246
246
|
get uniqueId() {
|
|
247
247
|
return this._uniqueId;
|
|
248
248
|
}
|
|
249
|
+
/** @internal */
|
|
250
|
+
_setUniqueId(id) {
|
|
251
|
+
this._uniqueId = id;
|
|
252
|
+
}
|
|
249
253
|
/**
|
|
250
254
|
* Gets the Engine the texture belongs to.
|
|
251
255
|
* @returns The babylon engine
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internalTexture.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Materials/Textures/internalTexture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAInD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMlD;;GAEG;AACH,MAAM,CAAN,IAAY,qBA6DX;AA7DD,WAAY,qBAAqB;IAC7B;;OAEG;IACH,uEAAO,CAAA;IACP;;OAEG;IACH,+DAAG,CAAA;IACH;;OAEG;IACH,iEAAI,CAAA;IACJ;;OAEG;IACH,+DAAG,CAAA;IACH;;OAEG;IACH,uEAAO,CAAA;IACP;;OAEG;IACH,iFAAY,CAAA;IACZ;;OAEG;IACH,2FAAiB,CAAA;IACjB;;OAEG;IACH,iEAAI,CAAA;IACJ;;OAEG;IACH,uEAAO,CAAA;IACP;;OAEG;IACH,uFAAe,CAAA;IACf;;OAEG;IACH,oEAAK,CAAA;IACL;;OAEG;IACH,8EAAU,CAAA;IACV;;OAEG;IACH,kFAAY,CAAA;IACZ;;OAEG;IACH,gFAAW,CAAA;IACX;;OAEG;IACH,oEAAK,CAAA;AACT,CAAC,EA7DW,qBAAqB,KAArB,qBAAqB,QA6DhC;AAED;;;GAGG;AACH,MAAM,OAAO,eAAgB,SAAQ,cAAc;IAuM/C;;;;;OAKG;IACH,YAAY,MAAkB,EAAE,MAA6B,EAAE,eAAe,GAAG,KAAK;QAClF,KAAK,EAAE,CAAC;QA7MZ;;WAEG;QACI,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,EAAE;YACd,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SACtB;IACL,CAAC;IAED;;OAEG;IACI,OAAO;QACV,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC;QAChC,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAC;QAC/B,IAAI,IAAI,CAAC,WAAW,KAAK,CAAC,EAAE;YACxB,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;YACnC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;SAChC;IACL,CAAC;;AAtTD,gBAAgB;AACF,wBAAQ,GAAG,CAAC,CAAC","sourcesContent":["import { Observable } from \"../../Misc/observable\";\r\nimport type { Nullable, int } from \"../../types\";\r\nimport type { ICanvas, ICanvasRenderingContext } from \"../../Engines/ICanvas\";\r\nimport type { HardwareTextureWrapper } from \"./hardwareTextureWrapper\";\r\nimport { TextureSampler } from \"./textureSampler\";\r\n\r\ndeclare type ThinEngine = import(\"../../Engines/thinEngine\").ThinEngine;\r\ndeclare type BaseTexture = import(\"../../Materials/Textures/baseTexture\").BaseTexture;\r\ndeclare type SphericalPolynomial = import(\"../../Maths/sphericalPolynomial\").SphericalPolynomial;\r\n\r\n/**\r\n * Defines the source of the internal texture\r\n */\r\nexport enum InternalTextureSource {\r\n /**\r\n * The source of the texture data is unknown\r\n */\r\n Unknown,\r\n /**\r\n * Texture data comes from an URL\r\n */\r\n Url,\r\n /**\r\n * Texture data is only used for temporary storage\r\n */\r\n Temp,\r\n /**\r\n * Texture data comes from raw data (ArrayBuffer)\r\n */\r\n Raw,\r\n /**\r\n * Texture content is dynamic (video or dynamic texture)\r\n */\r\n Dynamic,\r\n /**\r\n * Texture content is generated by rendering to it\r\n */\r\n RenderTarget,\r\n /**\r\n * Texture content is part of a multi render target process\r\n */\r\n MultiRenderTarget,\r\n /**\r\n * Texture data comes from a cube data file\r\n */\r\n Cube,\r\n /**\r\n * Texture data comes from a raw cube data\r\n */\r\n CubeRaw,\r\n /**\r\n * Texture data come from a prefiltered cube data file\r\n */\r\n CubePrefiltered,\r\n /**\r\n * Texture content is raw 3D data\r\n */\r\n Raw3D,\r\n /**\r\n * Texture content is raw 2D array data\r\n */\r\n Raw2DArray,\r\n /**\r\n * Texture content is a depth/stencil texture\r\n */\r\n DepthStencil,\r\n /**\r\n * Texture data comes from a raw cube data encoded with RGBD\r\n */\r\n CubeRawRGBD,\r\n /**\r\n * Texture content is a depth texture\r\n */\r\n Depth,\r\n}\r\n\r\n/**\r\n * Class used to store data associated with WebGL texture data for the engine\r\n * This class should not be used directly\r\n */\r\nexport class InternalTexture extends TextureSampler {\r\n /**\r\n * Defines if the texture is ready\r\n */\r\n public isReady: boolean = false;\r\n /**\r\n * Defines if the texture is a cube texture\r\n */\r\n public isCube: boolean = false;\r\n /**\r\n * Defines if the texture contains 3D data\r\n */\r\n public is3D: boolean = false;\r\n /**\r\n * Defines if the texture contains 2D array data\r\n */\r\n public is2DArray: boolean = false;\r\n /**\r\n * Defines if the texture contains multiview data\r\n */\r\n public isMultiview: boolean = false;\r\n /**\r\n * Gets the URL used to load this texture\r\n */\r\n public url: string = \"\";\r\n /** @internal */\r\n public _originalUrl: string; // not empty only if different from url\r\n /**\r\n * Gets a boolean indicating if the texture needs mipmaps generation\r\n */\r\n public generateMipMaps: boolean = false;\r\n /**\r\n * Gets a boolean indicating if the texture uses mipmaps\r\n * TODO implements useMipMaps as a separate setting from generateMipMaps\r\n */\r\n public get useMipMaps() {\r\n return this.generateMipMaps;\r\n }\r\n public set useMipMaps(value: boolean) {\r\n this.generateMipMaps = value;\r\n }\r\n /**\r\n * Gets the number of samples used by the texture (WebGL2+ only)\r\n */\r\n public samples: number = 0;\r\n /**\r\n * Gets the type of the texture (int, float...)\r\n */\r\n public type: number = -1;\r\n /**\r\n * Gets the format of the texture (RGB, RGBA...)\r\n */\r\n public format: number = -1;\r\n /**\r\n * Observable called when the texture is loaded\r\n */\r\n public onLoadedObservable = new Observable<InternalTexture>();\r\n /**\r\n * Observable called when the texture load is raising an error\r\n */\r\n public onErrorObservable = new Observable<Partial<{ message: string; exception: any }>>();\r\n /**\r\n * If this callback is defined it will be called instead of the default _rebuild function\r\n */\r\n public onRebuildCallback: Nullable<\r\n (internalTexture: InternalTexture) => {\r\n proxy: Nullable<InternalTexture | Promise<InternalTexture>>;\r\n isReady: boolean;\r\n isAsync: boolean;\r\n }\r\n > = null;\r\n /**\r\n * Gets the width of the texture\r\n */\r\n public width: number = 0;\r\n /**\r\n * Gets the height of the texture\r\n */\r\n public height: number = 0;\r\n /**\r\n * Gets the depth of the texture\r\n */\r\n public depth: number = 0;\r\n /**\r\n * Gets the initial width of the texture (It could be rescaled if the current system does not support non power of two textures)\r\n */\r\n public baseWidth: number = 0;\r\n /**\r\n * Gets the initial height of the texture (It could be rescaled if the current system does not support non power of two textures)\r\n */\r\n public baseHeight: number = 0;\r\n /**\r\n * Gets the initial depth of the texture (It could be rescaled if the current system does not support non power of two textures)\r\n */\r\n public baseDepth: number = 0;\r\n /**\r\n * Gets a boolean indicating if the texture is inverted on Y axis\r\n */\r\n public invertY: boolean = false;\r\n\r\n // Private\r\n /** @internal */\r\n public _invertVScale = false;\r\n /** @internal */\r\n public _associatedChannel = -1;\r\n /** @internal */\r\n public _source = InternalTextureSource.Unknown;\r\n /** @internal */\r\n public _buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob | ImageBitmap> = null;\r\n /** @internal */\r\n public _bufferView: Nullable<ArrayBufferView> = null;\r\n /** @internal */\r\n public _bufferViewArray: Nullable<ArrayBufferView[]> = null;\r\n /** @internal */\r\n public _bufferViewArrayArray: Nullable<ArrayBufferView[][]> = null;\r\n /** @internal */\r\n public _size: number = 0;\r\n /** @internal */\r\n public _extension: string = \"\";\r\n /** @internal */\r\n public _files: Nullable<string[]> = null;\r\n /** @internal */\r\n public _workingCanvas: Nullable<ICanvas> = null;\r\n /** @internal */\r\n public _workingContext: Nullable<ICanvasRenderingContext> = null;\r\n /** @internal */\r\n public _cachedCoordinatesMode: Nullable<number> = null;\r\n /** @internal */\r\n public _isDisabled: boolean = false;\r\n /** @internal */\r\n public _compression: Nullable<string> = null;\r\n /** @internal */\r\n public _sphericalPolynomial: Nullable<SphericalPolynomial> = null;\r\n /** @internal */\r\n public _sphericalPolynomialPromise: Nullable<Promise<SphericalPolynomial>> = null;\r\n /** @internal */\r\n public _sphericalPolynomialComputed = false;\r\n /** @internal */\r\n public _lodGenerationScale: number = 0;\r\n /** @internal */\r\n public _lodGenerationOffset: number = 0;\r\n /** @internal */\r\n public _useSRGBBuffer: boolean = false;\r\n\r\n // The following three fields helps sharing generated fixed LODs for texture filtering\r\n // In environment not supporting the textureLOD extension like EDGE. They are for internal use only.\r\n // They are at the level of the gl texture to benefit from the cache.\r\n /** @internal */\r\n public _lodTextureHigh: Nullable<BaseTexture> = null;\r\n /** @internal */\r\n public _lodTextureMid: Nullable<BaseTexture> = null;\r\n /** @internal */\r\n public _lodTextureLow: Nullable<BaseTexture> = null;\r\n /** @internal */\r\n public _isRGBD: boolean = false;\r\n\r\n /** @internal */\r\n public _linearSpecularLOD: boolean = false;\r\n /** @internal */\r\n public _irradianceTexture: Nullable<BaseTexture> = null;\r\n\r\n /** @internal */\r\n public _hardwareTexture: Nullable<HardwareTextureWrapper> = null;\r\n\r\n /** @internal */\r\n public _maxLodLevel: Nullable<number> = null;\r\n\r\n /** @internal */\r\n public _references: number = 1;\r\n\r\n /** @internal */\r\n public _gammaSpace: Nullable<boolean> = null;\r\n\r\n private _engine: ThinEngine;\r\n private _uniqueId: number;\r\n\r\n /** @internal */\r\n public static _Counter = 0;\r\n\r\n /** Gets the unique id of the internal texture */\r\n public get uniqueId() {\r\n return this._uniqueId;\r\n }\r\n\r\n /**\r\n * Gets the Engine the texture belongs to.\r\n * @returns The babylon engine\r\n */\r\n public getEngine(): ThinEngine {\r\n return this._engine;\r\n }\r\n\r\n /**\r\n * Gets the data source type of the texture\r\n */\r\n public get source(): InternalTextureSource {\r\n return this._source;\r\n }\r\n\r\n /**\r\n * Creates a new InternalTexture\r\n * @param engine defines the engine to use\r\n * @param source defines the type of data that will be used\r\n * @param delayAllocation if the texture allocation should be delayed (default: false)\r\n */\r\n constructor(engine: ThinEngine, source: InternalTextureSource, delayAllocation = false) {\r\n super();\r\n\r\n this._engine = engine;\r\n this._source = source;\r\n this._uniqueId = InternalTexture._Counter++;\r\n\r\n if (!delayAllocation) {\r\n this._hardwareTexture = engine._createHardwareTexture();\r\n }\r\n }\r\n\r\n /**\r\n * Increments the number of references (ie. the number of Texture that point to it)\r\n */\r\n public incrementReferences(): void {\r\n this._references++;\r\n }\r\n\r\n /**\r\n * Change the size of the texture (not the size of the content)\r\n * @param width defines the new width\r\n * @param height defines the new height\r\n * @param depth defines the new depth (1 by default)\r\n */\r\n public updateSize(width: int, height: int, depth: int = 1): void {\r\n this._engine.updateTextureDimensions(this, width, height, depth);\r\n\r\n this.width = width;\r\n this.height = height;\r\n this.depth = depth;\r\n\r\n this.baseWidth = width;\r\n this.baseHeight = height;\r\n this.baseDepth = depth;\r\n\r\n this._size = width * height * depth;\r\n }\r\n\r\n /** @internal */\r\n public _rebuild(): void {\r\n this.isReady = false;\r\n this._cachedCoordinatesMode = null;\r\n this._cachedWrapU = null;\r\n this._cachedWrapV = null;\r\n this._cachedWrapR = null;\r\n this._cachedAnisotropicFilteringLevel = null;\r\n if (this.onRebuildCallback) {\r\n const data = this.onRebuildCallback(this);\r\n const swapAndSetIsReady = (proxyInternalTexture: InternalTexture) => {\r\n proxyInternalTexture._swapAndDie(this, false);\r\n this.isReady = data.isReady;\r\n };\r\n if (data.isAsync) {\r\n (data.proxy as Promise<InternalTexture>).then(swapAndSetIsReady);\r\n } else {\r\n swapAndSetIsReady(data.proxy as InternalTexture);\r\n }\r\n return;\r\n }\r\n\r\n let proxy: InternalTexture;\r\n switch (this.source) {\r\n case InternalTextureSource.Temp:\r\n break;\r\n\r\n case InternalTextureSource.Url:\r\n proxy = this._engine.createTexture(\r\n this._originalUrl ?? this.url,\r\n !this.generateMipMaps,\r\n this.invertY,\r\n null,\r\n this.samplingMode,\r\n // Do not use Proxy here as it could be fully synchronous\r\n // and proxy would be undefined.\r\n (temp) => {\r\n temp._swapAndDie(this, false);\r\n this.isReady = true;\r\n },\r\n null,\r\n this._buffer,\r\n undefined,\r\n this.format,\r\n this._extension,\r\n undefined,\r\n undefined,\r\n undefined,\r\n this._useSRGBBuffer\r\n );\r\n return;\r\n\r\n case InternalTextureSource.Raw:\r\n proxy = this._engine.createRawTexture(\r\n this._bufferView,\r\n this.baseWidth,\r\n this.baseHeight,\r\n this.format,\r\n this.generateMipMaps,\r\n this.invertY,\r\n this.samplingMode,\r\n this._compression,\r\n this.type,\r\n undefined,\r\n this._useSRGBBuffer\r\n );\r\n proxy._swapAndDie(this, false);\r\n\r\n this.isReady = true;\r\n break;\r\n\r\n case InternalTextureSource.Raw3D:\r\n proxy = this._engine.createRawTexture3D(\r\n this._bufferView,\r\n this.baseWidth,\r\n this.baseHeight,\r\n this.baseDepth,\r\n this.format,\r\n this.generateMipMaps,\r\n this.invertY,\r\n this.samplingMode,\r\n this._compression,\r\n this.type\r\n );\r\n proxy._swapAndDie(this, false);\r\n\r\n this.isReady = true;\r\n break;\r\n\r\n case InternalTextureSource.Raw2DArray:\r\n proxy = this._engine.createRawTexture2DArray(\r\n this._bufferView,\r\n this.baseWidth,\r\n this.baseHeight,\r\n this.baseDepth,\r\n this.format,\r\n this.generateMipMaps,\r\n this.invertY,\r\n this.samplingMode,\r\n this._compression,\r\n this.type\r\n );\r\n proxy._swapAndDie(this, false);\r\n\r\n this.isReady = true;\r\n break;\r\n\r\n case InternalTextureSource.Dynamic:\r\n proxy = this._engine.createDynamicTexture(this.baseWidth, this.baseHeight, this.generateMipMaps, this.samplingMode);\r\n proxy._swapAndDie(this, false);\r\n this._engine.updateDynamicTexture(this, this._engine.getRenderingCanvas()!, this.invertY, undefined, undefined, true);\r\n\r\n // The engine will make sure to update content so no need to flag it as isReady = true\r\n break;\r\n\r\n case InternalTextureSource.Cube:\r\n proxy = this._engine.createCubeTexture(\r\n this.url,\r\n null,\r\n this._files,\r\n !this.generateMipMaps,\r\n () => {\r\n proxy._swapAndDie(this, false);\r\n this.isReady = true;\r\n },\r\n null,\r\n this.format,\r\n this._extension,\r\n false,\r\n 0,\r\n 0,\r\n null,\r\n undefined,\r\n this._useSRGBBuffer\r\n );\r\n return;\r\n\r\n case InternalTextureSource.CubeRaw:\r\n proxy = this._engine.createRawCubeTexture(\r\n this._bufferViewArray!,\r\n this.width,\r\n this.format,\r\n this.type,\r\n this.generateMipMaps,\r\n this.invertY,\r\n this.samplingMode,\r\n this._compression\r\n );\r\n proxy._swapAndDie(this, false);\r\n this.isReady = true;\r\n break;\r\n\r\n case InternalTextureSource.CubeRawRGBD:\r\n // This case is being handeled by the environment texture tools and is not a part of the rebuild process.\r\n // To use CubeRawRGBD use updateRGBDAsync on the cube texture.\r\n return;\r\n\r\n case InternalTextureSource.CubePrefiltered:\r\n proxy = this._engine.createPrefilteredCubeTexture(\r\n this.url,\r\n null,\r\n this._lodGenerationScale,\r\n this._lodGenerationOffset,\r\n (proxy) => {\r\n if (proxy) {\r\n proxy._swapAndDie(this, false);\r\n }\r\n this.isReady = true;\r\n },\r\n null,\r\n this.format,\r\n this._extension\r\n );\r\n proxy._sphericalPolynomial = this._sphericalPolynomial;\r\n return;\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _swapAndDie(target: InternalTexture, swapAll = true): void {\r\n // TODO what about refcount on target?\r\n\r\n this._hardwareTexture?.setUsage(target._source, this.generateMipMaps, this.isCube, this.width, this.height);\r\n\r\n target._hardwareTexture = this._hardwareTexture;\r\n if (swapAll) {\r\n target._isRGBD = this._isRGBD;\r\n }\r\n\r\n if (this._lodTextureHigh) {\r\n if (target._lodTextureHigh) {\r\n target._lodTextureHigh.dispose();\r\n }\r\n target._lodTextureHigh = this._lodTextureHigh;\r\n }\r\n\r\n if (this._lodTextureMid) {\r\n if (target._lodTextureMid) {\r\n target._lodTextureMid.dispose();\r\n }\r\n target._lodTextureMid = this._lodTextureMid;\r\n }\r\n\r\n if (this._lodTextureLow) {\r\n if (target._lodTextureLow) {\r\n target._lodTextureLow.dispose();\r\n }\r\n target._lodTextureLow = this._lodTextureLow;\r\n }\r\n\r\n if (this._irradianceTexture) {\r\n if (target._irradianceTexture) {\r\n target._irradianceTexture.dispose();\r\n }\r\n target._irradianceTexture = this._irradianceTexture;\r\n }\r\n\r\n const cache = this._engine.getLoadedTexturesCache();\r\n let index = cache.indexOf(this);\r\n if (index !== -1) {\r\n cache.splice(index, 1);\r\n }\r\n\r\n index = cache.indexOf(target);\r\n if (index === -1) {\r\n cache.push(target);\r\n }\r\n }\r\n\r\n /**\r\n * Dispose the current allocated resources\r\n */\r\n public dispose(): void {\r\n this._references--;\r\n this.onLoadedObservable.clear();\r\n this.onErrorObservable.clear();\r\n if (this._references === 0) {\r\n this._engine._releaseTexture(this);\r\n this._hardwareTexture = null;\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"internalTexture.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Materials/Textures/internalTexture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAInD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMlD;;GAEG;AACH,MAAM,CAAN,IAAY,qBA6DX;AA7DD,WAAY,qBAAqB;IAC7B;;OAEG;IACH,uEAAO,CAAA;IACP;;OAEG;IACH,+DAAG,CAAA;IACH;;OAEG;IACH,iEAAI,CAAA;IACJ;;OAEG;IACH,+DAAG,CAAA;IACH;;OAEG;IACH,uEAAO,CAAA;IACP;;OAEG;IACH,iFAAY,CAAA;IACZ;;OAEG;IACH,2FAAiB,CAAA;IACjB;;OAEG;IACH,iEAAI,CAAA;IACJ;;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AC,kBAAkB,EAAE;YACzB,IAAI,MAAM,CAAC,kBAAkB,EAAE;gBAC3B,MAAM,CAAC,kBAAkB,CAAC,OAAO,EAAE,CAAC;aACvC;YACD,MAAM,CAAC,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAC;SACvD;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,sBAAsB,EAAE,CAAC;QACpD,IAAI,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;YACd,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;SAC1B;QAED,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC9B,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;YACd,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SACtB;IACL,CAAC;IAED;;OAEG;IACI,OAAO;QACV,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC;QAChC,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAC;QAC/B,IAAI,IAAI,CAAC,WAAW,KAAK,CAAC,EAAE;YACxB,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;YACnC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;SAChC;IACL,CAAC;;AA3TD,gBAAgB;AACF,wBAAQ,GAAG,CAAC,CAAC","sourcesContent":["import { Observable } from \"../../Misc/observable\";\r\nimport type { Nullable, int } from \"../../types\";\r\nimport type { ICanvas, ICanvasRenderingContext } from \"../../Engines/ICanvas\";\r\nimport type { HardwareTextureWrapper } from \"./hardwareTextureWrapper\";\r\nimport { TextureSampler } from \"./textureSampler\";\r\n\r\ndeclare type ThinEngine = import(\"../../Engines/thinEngine\").ThinEngine;\r\ndeclare type BaseTexture = import(\"../../Materials/Textures/baseTexture\").BaseTexture;\r\ndeclare type SphericalPolynomial = import(\"../../Maths/sphericalPolynomial\").SphericalPolynomial;\r\n\r\n/**\r\n * Defines the source of the internal texture\r\n */\r\nexport enum InternalTextureSource {\r\n /**\r\n * The source of the texture data is unknown\r\n */\r\n Unknown,\r\n /**\r\n * Texture data comes from an URL\r\n */\r\n Url,\r\n /**\r\n * Texture data is only used for temporary storage\r\n */\r\n Temp,\r\n /**\r\n * Texture data comes from raw data (ArrayBuffer)\r\n */\r\n Raw,\r\n /**\r\n * Texture content is dynamic (video or dynamic texture)\r\n */\r\n Dynamic,\r\n /**\r\n * Texture content is generated by rendering to it\r\n */\r\n RenderTarget,\r\n /**\r\n * Texture content is part of a multi render target process\r\n */\r\n MultiRenderTarget,\r\n /**\r\n * Texture data comes from a cube data file\r\n */\r\n Cube,\r\n /**\r\n * Texture data comes from a raw cube data\r\n */\r\n CubeRaw,\r\n /**\r\n * Texture data come from a prefiltered cube data file\r\n */\r\n CubePrefiltered,\r\n /**\r\n * Texture content is raw 3D data\r\n */\r\n Raw3D,\r\n /**\r\n * Texture content is raw 2D array data\r\n */\r\n Raw2DArray,\r\n /**\r\n * Texture content is a depth/stencil texture\r\n */\r\n DepthStencil,\r\n /**\r\n * Texture data comes from a raw cube data encoded with RGBD\r\n */\r\n CubeRawRGBD,\r\n /**\r\n * Texture content is a depth texture\r\n */\r\n Depth,\r\n}\r\n\r\n/**\r\n * Class used to store data associated with WebGL texture data for the engine\r\n * This class should not be used directly\r\n */\r\nexport class InternalTexture extends TextureSampler {\r\n /**\r\n * Defines if the texture is ready\r\n */\r\n public isReady: boolean = false;\r\n /**\r\n * Defines if the texture is a cube texture\r\n */\r\n public isCube: boolean = false;\r\n /**\r\n * Defines if the texture contains 3D data\r\n */\r\n public is3D: boolean = false;\r\n /**\r\n * Defines if the texture contains 2D array data\r\n */\r\n public is2DArray: boolean = false;\r\n /**\r\n * Defines if the texture contains multiview data\r\n */\r\n public isMultiview: boolean = false;\r\n /**\r\n * Gets the URL used to load this texture\r\n */\r\n public url: string = \"\";\r\n /** @internal */\r\n public _originalUrl: string; // not empty only if different from url\r\n /**\r\n * Gets a boolean indicating if the texture needs mipmaps generation\r\n */\r\n public generateMipMaps: boolean = false;\r\n /**\r\n * Gets a boolean indicating if the texture uses mipmaps\r\n * TODO implements useMipMaps as a separate setting from generateMipMaps\r\n */\r\n public get useMipMaps() {\r\n return this.generateMipMaps;\r\n }\r\n public set useMipMaps(value: boolean) {\r\n this.generateMipMaps = value;\r\n }\r\n /**\r\n * Gets the number of samples used by the texture (WebGL2+ only)\r\n */\r\n public samples: number = 0;\r\n /**\r\n * Gets the type of the texture (int, float...)\r\n */\r\n public type: number = -1;\r\n /**\r\n * Gets the format of the texture (RGB, RGBA...)\r\n */\r\n public format: number = -1;\r\n /**\r\n * Observable called when the texture is loaded\r\n */\r\n public onLoadedObservable = new Observable<InternalTexture>();\r\n /**\r\n * Observable called when the texture load is raising an error\r\n */\r\n public onErrorObservable = new Observable<Partial<{ message: string; exception: any }>>();\r\n /**\r\n * If this callback is defined it will be called instead of the default _rebuild function\r\n */\r\n public onRebuildCallback: Nullable<\r\n (internalTexture: InternalTexture) => {\r\n proxy: Nullable<InternalTexture | Promise<InternalTexture>>;\r\n isReady: boolean;\r\n isAsync: boolean;\r\n }\r\n > = null;\r\n /**\r\n * Gets the width of the texture\r\n */\r\n public width: number = 0;\r\n /**\r\n * Gets the height of the texture\r\n */\r\n public height: number = 0;\r\n /**\r\n * Gets the depth of the texture\r\n */\r\n public depth: number = 0;\r\n /**\r\n * Gets the initial width of the texture (It could be rescaled if the current system does not support non power of two textures)\r\n */\r\n public baseWidth: number = 0;\r\n /**\r\n * Gets the initial height of the texture (It could be rescaled if the current system does not support non power of two textures)\r\n */\r\n public baseHeight: number = 0;\r\n /**\r\n * Gets the initial depth of the texture (It could be rescaled if the current system does not support non power of two textures)\r\n */\r\n public baseDepth: number = 0;\r\n /**\r\n * Gets a boolean indicating if the texture is inverted on Y axis\r\n */\r\n public invertY: boolean = false;\r\n\r\n // Private\r\n /** @internal */\r\n public _invertVScale = false;\r\n /** @internal */\r\n public _associatedChannel = -1;\r\n /** @internal */\r\n public _source = InternalTextureSource.Unknown;\r\n /** @internal */\r\n public _buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob | ImageBitmap> = null;\r\n /** @internal */\r\n public _bufferView: Nullable<ArrayBufferView> = null;\r\n /** @internal */\r\n public _bufferViewArray: Nullable<ArrayBufferView[]> = null;\r\n /** @internal */\r\n public _bufferViewArrayArray: Nullable<ArrayBufferView[][]> = null;\r\n /** @internal */\r\n public _size: number = 0;\r\n /** @internal */\r\n public _extension: string = \"\";\r\n /** @internal */\r\n public _files: Nullable<string[]> = null;\r\n /** @internal */\r\n public _workingCanvas: Nullable<ICanvas> = null;\r\n /** @internal */\r\n public _workingContext: Nullable<ICanvasRenderingContext> = null;\r\n /** @internal */\r\n public _cachedCoordinatesMode: Nullable<number> = null;\r\n /** @internal */\r\n public _isDisabled: boolean = false;\r\n /** @internal */\r\n public _compression: Nullable<string> = null;\r\n /** @internal */\r\n public _sphericalPolynomial: Nullable<SphericalPolynomial> = null;\r\n /** @internal */\r\n public _sphericalPolynomialPromise: Nullable<Promise<SphericalPolynomial>> = null;\r\n /** @internal */\r\n public _sphericalPolynomialComputed = false;\r\n /** @internal */\r\n public _lodGenerationScale: number = 0;\r\n /** @internal */\r\n public _lodGenerationOffset: number = 0;\r\n /** @internal */\r\n public _useSRGBBuffer: boolean = false;\r\n\r\n // The following three fields helps sharing generated fixed LODs for texture filtering\r\n // In environment not supporting the textureLOD extension like EDGE. They are for internal use only.\r\n // They are at the level of the gl texture to benefit from the cache.\r\n /** @internal */\r\n public _lodTextureHigh: Nullable<BaseTexture> = null;\r\n /** @internal */\r\n public _lodTextureMid: Nullable<BaseTexture> = null;\r\n /** @internal */\r\n public _lodTextureLow: Nullable<BaseTexture> = null;\r\n /** @internal */\r\n public _isRGBD: boolean = false;\r\n\r\n /** @internal */\r\n public _linearSpecularLOD: boolean = false;\r\n /** @internal */\r\n public _irradianceTexture: Nullable<BaseTexture> = null;\r\n\r\n /** @internal */\r\n public _hardwareTexture: Nullable<HardwareTextureWrapper> = null;\r\n\r\n /** @internal */\r\n public _maxLodLevel: Nullable<number> = null;\r\n\r\n /** @internal */\r\n public _references: number = 1;\r\n\r\n /** @internal */\r\n public _gammaSpace: Nullable<boolean> = null;\r\n\r\n private _engine: ThinEngine;\r\n private _uniqueId: number;\r\n\r\n /** @internal */\r\n public static _Counter = 0;\r\n\r\n /** Gets the unique id of the internal texture */\r\n public get uniqueId() {\r\n return this._uniqueId;\r\n }\r\n\r\n /** @internal */\r\n public _setUniqueId(id: number) {\r\n this._uniqueId = id;\r\n }\r\n\r\n /**\r\n * Gets the Engine the texture belongs to.\r\n * @returns The babylon engine\r\n */\r\n public getEngine(): ThinEngine {\r\n return this._engine;\r\n }\r\n\r\n /**\r\n * Gets the data source type of the texture\r\n */\r\n public get source(): InternalTextureSource {\r\n return this._source;\r\n }\r\n\r\n /**\r\n * Creates a new InternalTexture\r\n * @param engine defines the engine to use\r\n * @param source defines the type of data that will be used\r\n * @param delayAllocation if the texture allocation should be delayed (default: false)\r\n */\r\n constructor(engine: ThinEngine, source: InternalTextureSource, delayAllocation = false) {\r\n super();\r\n\r\n this._engine = engine;\r\n this._source = source;\r\n this._uniqueId = InternalTexture._Counter++;\r\n\r\n if (!delayAllocation) {\r\n this._hardwareTexture = engine._createHardwareTexture();\r\n }\r\n }\r\n\r\n /**\r\n * Increments the number of references (ie. the number of Texture that point to it)\r\n */\r\n public incrementReferences(): void {\r\n this._references++;\r\n }\r\n\r\n /**\r\n * Change the size of the texture (not the size of the content)\r\n * @param width defines the new width\r\n * @param height defines the new height\r\n * @param depth defines the new depth (1 by default)\r\n */\r\n public updateSize(width: int, height: int, depth: int = 1): void {\r\n this._engine.updateTextureDimensions(this, width, height, depth);\r\n\r\n this.width = width;\r\n this.height = height;\r\n this.depth = depth;\r\n\r\n this.baseWidth = width;\r\n this.baseHeight = height;\r\n this.baseDepth = depth;\r\n\r\n this._size = width * height * depth;\r\n }\r\n\r\n /** @internal */\r\n public _rebuild(): void {\r\n this.isReady = false;\r\n this._cachedCoordinatesMode = null;\r\n this._cachedWrapU = null;\r\n this._cachedWrapV = null;\r\n this._cachedWrapR = null;\r\n this._cachedAnisotropicFilteringLevel = null;\r\n if (this.onRebuildCallback) {\r\n const data = this.onRebuildCallback(this);\r\n const swapAndSetIsReady = (proxyInternalTexture: InternalTexture) => {\r\n proxyInternalTexture._swapAndDie(this, false);\r\n this.isReady = data.isReady;\r\n };\r\n if (data.isAsync) {\r\n (data.proxy as Promise<InternalTexture>).then(swapAndSetIsReady);\r\n } else {\r\n swapAndSetIsReady(data.proxy as InternalTexture);\r\n }\r\n return;\r\n }\r\n\r\n let proxy: InternalTexture;\r\n switch (this.source) {\r\n case InternalTextureSource.Temp:\r\n break;\r\n\r\n case InternalTextureSource.Url:\r\n proxy = this._engine.createTexture(\r\n this._originalUrl ?? this.url,\r\n !this.generateMipMaps,\r\n this.invertY,\r\n null,\r\n this.samplingMode,\r\n // Do not use Proxy here as it could be fully synchronous\r\n // and proxy would be undefined.\r\n (temp) => {\r\n temp._swapAndDie(this, false);\r\n this.isReady = true;\r\n },\r\n null,\r\n this._buffer,\r\n undefined,\r\n this.format,\r\n this._extension,\r\n undefined,\r\n undefined,\r\n undefined,\r\n this._useSRGBBuffer\r\n );\r\n return;\r\n\r\n case InternalTextureSource.Raw:\r\n proxy = this._engine.createRawTexture(\r\n this._bufferView,\r\n this.baseWidth,\r\n this.baseHeight,\r\n this.format,\r\n this.generateMipMaps,\r\n this.invertY,\r\n this.samplingMode,\r\n this._compression,\r\n this.type,\r\n undefined,\r\n this._useSRGBBuffer\r\n );\r\n proxy._swapAndDie(this, false);\r\n\r\n this.isReady = true;\r\n break;\r\n\r\n case InternalTextureSource.Raw3D:\r\n proxy = this._engine.createRawTexture3D(\r\n this._bufferView,\r\n this.baseWidth,\r\n this.baseHeight,\r\n this.baseDepth,\r\n this.format,\r\n this.generateMipMaps,\r\n this.invertY,\r\n this.samplingMode,\r\n this._compression,\r\n this.type\r\n );\r\n proxy._swapAndDie(this, false);\r\n\r\n this.isReady = true;\r\n break;\r\n\r\n case InternalTextureSource.Raw2DArray:\r\n proxy = this._engine.createRawTexture2DArray(\r\n this._bufferView,\r\n this.baseWidth,\r\n this.baseHeight,\r\n this.baseDepth,\r\n this.format,\r\n this.generateMipMaps,\r\n this.invertY,\r\n this.samplingMode,\r\n this._compression,\r\n this.type\r\n );\r\n proxy._swapAndDie(this, false);\r\n\r\n this.isReady = true;\r\n break;\r\n\r\n case InternalTextureSource.Dynamic:\r\n proxy = this._engine.createDynamicTexture(this.baseWidth, this.baseHeight, this.generateMipMaps, this.samplingMode);\r\n proxy._swapAndDie(this, false);\r\n this._engine.updateDynamicTexture(this, this._engine.getRenderingCanvas()!, this.invertY, undefined, undefined, true);\r\n\r\n // The engine will make sure to update content so no need to flag it as isReady = true\r\n break;\r\n\r\n case InternalTextureSource.Cube:\r\n proxy = this._engine.createCubeTexture(\r\n this.url,\r\n null,\r\n this._files,\r\n !this.generateMipMaps,\r\n () => {\r\n proxy._swapAndDie(this, false);\r\n this.isReady = true;\r\n },\r\n null,\r\n this.format,\r\n this._extension,\r\n false,\r\n 0,\r\n 0,\r\n null,\r\n undefined,\r\n this._useSRGBBuffer\r\n );\r\n return;\r\n\r\n case InternalTextureSource.CubeRaw:\r\n proxy = this._engine.createRawCubeTexture(\r\n this._bufferViewArray!,\r\n this.width,\r\n this.format,\r\n this.type,\r\n this.generateMipMaps,\r\n this.invertY,\r\n this.samplingMode,\r\n this._compression\r\n );\r\n proxy._swapAndDie(this, false);\r\n this.isReady = true;\r\n break;\r\n\r\n case InternalTextureSource.CubeRawRGBD:\r\n // This case is being handeled by the environment texture tools and is not a part of the rebuild process.\r\n // To use CubeRawRGBD use updateRGBDAsync on the cube texture.\r\n return;\r\n\r\n case InternalTextureSource.CubePrefiltered:\r\n proxy = this._engine.createPrefilteredCubeTexture(\r\n this.url,\r\n null,\r\n this._lodGenerationScale,\r\n this._lodGenerationOffset,\r\n (proxy) => {\r\n if (proxy) {\r\n proxy._swapAndDie(this, false);\r\n }\r\n this.isReady = true;\r\n },\r\n null,\r\n this.format,\r\n this._extension\r\n );\r\n proxy._sphericalPolynomial = this._sphericalPolynomial;\r\n return;\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _swapAndDie(target: InternalTexture, swapAll = true): void {\r\n // TODO what about refcount on target?\r\n\r\n this._hardwareTexture?.setUsage(target._source, this.generateMipMaps, this.isCube, this.width, this.height);\r\n\r\n target._hardwareTexture = this._hardwareTexture;\r\n if (swapAll) {\r\n target._isRGBD = this._isRGBD;\r\n }\r\n\r\n if (this._lodTextureHigh) {\r\n if (target._lodTextureHigh) {\r\n target._lodTextureHigh.dispose();\r\n }\r\n target._lodTextureHigh = this._lodTextureHigh;\r\n }\r\n\r\n if (this._lodTextureMid) {\r\n if (target._lodTextureMid) {\r\n target._lodTextureMid.dispose();\r\n }\r\n target._lodTextureMid = this._lodTextureMid;\r\n }\r\n\r\n if (this._lodTextureLow) {\r\n if (target._lodTextureLow) {\r\n target._lodTextureLow.dispose();\r\n }\r\n target._lodTextureLow = this._lodTextureLow;\r\n }\r\n\r\n if (this._irradianceTexture) {\r\n if (target._irradianceTexture) {\r\n target._irradianceTexture.dispose();\r\n }\r\n target._irradianceTexture = this._irradianceTexture;\r\n }\r\n\r\n const cache = this._engine.getLoadedTexturesCache();\r\n let index = cache.indexOf(this);\r\n if (index !== -1) {\r\n cache.splice(index, 1);\r\n }\r\n\r\n index = cache.indexOf(target);\r\n if (index === -1) {\r\n cache.push(target);\r\n }\r\n }\r\n\r\n /**\r\n * Dispose the current allocated resources\r\n */\r\n public dispose(): void {\r\n this._references--;\r\n this.onLoadedObservable.clear();\r\n this.onErrorObservable.clear();\r\n if (this._references === 0) {\r\n this._engine._releaseTexture(this);\r\n this._hardwareTexture = null;\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -74,7 +74,6 @@ export class MirrorTexture extends RenderTargetTexture {
|
|
|
74
74
|
scene.setTransformMatrix(this._transformMatrix, scene.getProjectionMatrix());
|
|
75
75
|
saveClipPlane = scene.clipPlane;
|
|
76
76
|
scene.clipPlane = this.mirrorPlane;
|
|
77
|
-
scene.getEngine().cullBackFaces = false;
|
|
78
77
|
scene._mirroredCameraPosition = Vector3.TransformCoordinates(scene.activeCamera.globalPosition, this._mirrorMatrix);
|
|
79
78
|
});
|
|
80
79
|
this.onAfterRenderObservable.add(() => {
|
|
@@ -82,7 +81,6 @@ export class MirrorTexture extends RenderTargetTexture {
|
|
|
82
81
|
scene.setSceneUniformBuffer(this._currentSceneUBO);
|
|
83
82
|
}
|
|
84
83
|
scene.updateTransformMatrix();
|
|
85
|
-
scene.getEngine().cullBackFaces = null;
|
|
86
84
|
scene._mirroredCameraPosition = null;
|
|
87
85
|
scene.clipPlane = saveClipPlane;
|
|
88
86
|
});
|