@babylonjs/core 8.47.2 → 8.48.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Audio/analyser.js.map +1 -1
- package/AudioV2/webAudio/subNodes/webAudioAnalyzerSubNode.js.map +1 -1
- package/Buffers/buffer.align.js +3 -3
- package/Buffers/buffer.align.js.map +1 -1
- package/Buffers/bufferUtils.d.ts +7 -0
- package/Buffers/bufferUtils.js +31 -13
- package/Buffers/bufferUtils.js.map +1 -1
- package/Engines/Extensions/engine.dynamicBuffer.js +3 -3
- package/Engines/Extensions/engine.dynamicBuffer.js.map +1 -1
- package/Engines/Native/nativeDataStream.d.ts +1 -1
- package/Engines/Native/nativeDataStream.js.map +1 -1
- package/Engines/Native/nativeInterfaces.d.ts +4 -4
- package/Engines/Native/nativeInterfaces.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.rawTexture.d.ts +13 -1
- package/Engines/WebGPU/Extensions/engine.rawTexture.js +26 -8
- package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.d.ts +2 -1
- package/Engines/WebGPU/webgpuTextureManager.js +19 -6
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/abstractEngine.d.ts +4 -2
- package/Engines/abstractEngine.functions.d.ts +1 -1
- package/Engines/abstractEngine.functions.js +8 -8
- package/Engines/abstractEngine.functions.js.map +1 -1
- package/Engines/abstractEngine.js +6 -4
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/engine.d.ts +12 -0
- package/Engines/thinNativeEngine.js +1 -1
- package/Engines/thinNativeEngine.js.map +1 -1
- package/Engines/thinWebGPUEngine.js +3 -0
- package/Engines/thinWebGPUEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +18 -18
- package/Engines/webgpuEngine.js.map +1 -1
- package/Lights/Clustered/clusteredLightContainer.js.map +1 -1
- package/Materials/Background/backgroundMaterial.d.ts +16 -8
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +14 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +16 -8
- package/Materials/PBR/openpbrMaterial.d.ts +16 -8
- package/Materials/PBR/pbrBaseMaterial.d.ts +16 -8
- package/Materials/Textures/Loaders/EXR/exrLoader.compression.rle.d.ts +1 -1
- package/Materials/Textures/Loaders/EXR/exrLoader.compression.rle.js.map +1 -1
- package/Materials/Textures/Loaders/EXR/exrLoader.core.d.ts +1 -1
- package/Materials/Textures/Loaders/EXR/exrLoader.core.js.map +1 -1
- package/Materials/Textures/internalTexture.d.ts +6 -0
- package/Materials/Textures/internalTexture.js +24 -2
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/rawTexture.d.ts +8 -1
- package/Materials/Textures/rawTexture.js +12 -3
- package/Materials/Textures/rawTexture.js.map +1 -1
- package/Materials/Textures/rawTexture2DArray.d.ts +8 -1
- package/Materials/Textures/rawTexture2DArray.js +14 -3
- package/Materials/Textures/rawTexture2DArray.js.map +1 -1
- package/Materials/imageProcessing.d.ts +47 -8
- package/Materials/standardMaterial.d.ts +16 -8
- package/Meshes/Builders/shapeBuilder.d.ts +4 -0
- package/Meshes/Builders/shapeBuilder.js +12 -9
- package/Meshes/Builders/shapeBuilder.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +68 -4
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +343 -26
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Misc/dds.js.map +1 -1
- package/Misc/environmentTextureTools.js +3 -1
- package/Misc/environmentTextureTools.js.map +1 -1
- package/Misc/fileTools.js +9 -1
- package/Misc/fileTools.js.map +1 -1
- package/Physics/v1/physicsImpostor.d.ts +2 -2
- package/Physics/v1/physicsImpostor.js.map +1 -1
- package/Shaders/ShadersInclude/gaussianSplatting.js +16 -3
- package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/Shaders/gaussianSplatting.vertex.js +17 -4
- package/Shaders/gaussianSplatting.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +11 -1
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/ShadersWGSL/gaussianSplatting.vertex.js +17 -4
- package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
- package/XR/native/nativeXRFrame.d.ts +1 -1
- package/XR/native/nativeXRFrame.js.map +1 -1
- package/package.json +1 -1
- package/types.d.ts +1 -1
- package/types.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exrLoader.compression.rle.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Materials/Textures/Loaders/EXR/exrLoader.compression.rle.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,KAAK;AACL,0CAA0C;AAC1C,uBAAuB;AAEvB,qEAAqE;AACrE,8EAA8E;AAC9E,uEAAuE;AACvE,sEAAsE;AACtE,0EAA0E;AAC1E,4EAA4E;AAC5E,6EAA6E;AAC7E,qDAAqD;AACrD,6EAA6E;AAC7E,8EAA8E;AAE9E,kFAAkF;AAClF,gFAAgF;AAChF,yEAAyE;AACzE,qEAAqE;AACrE,6EAA6E;AAC7E,+EAA+E;AAC/E,8EAA8E;AAC9E,6EAA6E;AAC7E,gFAAgF;AAChF,+DAA+D;AAC/D,KAAK;AAEL,8EAA8E;AAE9E,8EAA8E;AAC9E,KAAK;AACL,uEAAuE;AACvE,sBAAsB;AACtB,KAAK;AACL,0BAA0B;AAC1B,KAAK;AACL,wEAAwE;AACxE,4EAA4E;AAC5E,UAAU;AACV,4EAA4E;AAC5E,mEAAmE;AACnE,qEAAqE;AACrE,4EAA4E;AAC5E,mEAAmE;AACnE,mBAAmB;AACnB,2EAA2E;AAC3E,yEAAyE;AACzE,mEAAmE;AACnE,KAAK;AACL,yEAAyE;AACzE,uEAAuE;AACvE,2EAA2E;AAC3E,0EAA0E;AAC1E,2EAA2E;AAC3E,sEAAsE;AACtE,2EAA2E;AAC3E,2EAA2E;AAC3E,yEAAyE;AACzE,2EAA2E;AAC3E,0EAA0E;AAC1E,KAAK;AACL,8EAA8E;AAE9E,8EAA8E;AAE9E,gBAAgB;AAChB,MAAM,UAAU,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"exrLoader.compression.rle.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Materials/Textures/Loaders/EXR/exrLoader.compression.rle.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,KAAK;AACL,0CAA0C;AAC1C,uBAAuB;AAEvB,qEAAqE;AACrE,8EAA8E;AAC9E,uEAAuE;AACvE,sEAAsE;AACtE,0EAA0E;AAC1E,4EAA4E;AAC5E,6EAA6E;AAC7E,qDAAqD;AACrD,6EAA6E;AAC7E,8EAA8E;AAE9E,kFAAkF;AAClF,gFAAgF;AAChF,yEAAyE;AACzE,qEAAqE;AACrE,6EAA6E;AAC7E,+EAA+E;AAC/E,8EAA8E;AAC9E,6EAA6E;AAC7E,gFAAgF;AAChF,+DAA+D;AAC/D,KAAK;AAEL,8EAA8E;AAE9E,8EAA8E;AAC9E,KAAK;AACL,uEAAuE;AACvE,sBAAsB;AACtB,KAAK;AACL,0BAA0B;AAC1B,KAAK;AACL,wEAAwE;AACxE,4EAA4E;AAC5E,UAAU;AACV,4EAA4E;AAC5E,mEAAmE;AACnE,qEAAqE;AACrE,4EAA4E;AAC5E,mEAAmE;AACnE,mBAAmB;AACnB,2EAA2E;AAC3E,yEAAyE;AACzE,mEAAmE;AACnE,KAAK;AACL,yEAAyE;AACzE,uEAAuE;AACvE,2EAA2E;AAC3E,0EAA0E;AAC1E,2EAA2E;AAC3E,sEAAsE;AACtE,2EAA2E;AAC3E,2EAA2E;AAC3E,yEAAyE;AACzE,2EAA2E;AAC3E,0EAA0E;AAC1E,KAAK;AACL,8EAA8E;AAE9E,8EAA8E;AAE9E,gBAAgB;AAChB,MAAM,UAAU,eAAe,CAAC,MAAuB;IACnD,IAAI,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;IAC7B,MAAM,GAAG,GAAG,EAAE,CAAC;IACf,IAAI,CAAC,GAAG,CAAC,CAAC;IAEV,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEpC,OAAO,IAAI,GAAG,CAAC,EAAE,CAAC;QACd,MAAM,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;QAE9B,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YACR,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC;YACjB,IAAI,IAAI,KAAK,GAAG,CAAC,CAAC;YAElB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC7B,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YACnC,CAAC;QACL,CAAC;aAAM,CAAC;YACJ,MAAM,KAAK,GAAG,CAAC,CAAC;YAChB,IAAI,IAAI,CAAC,CAAC;YAEV,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;YAEnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;gBACjC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACpB,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO,GAAG,CAAC;AACf,CAAC","sourcesContent":["/**\r\n * Inspired by https://github.com/sciecode/three.js/blob/dev/examples/jsm/loaders/EXRLoader.js\r\n * Referred to the original Industrial Light & Magic OpenEXR implementation and the TinyEXR / Syoyo Fujita\r\n * implementation.\r\n */\r\n\r\n// /*\r\n// Copyright (c) 2014 - 2017, Syoyo Fujita\r\n// All rights reserved.\r\n\r\n// Redistribution and use in source and binary forms, with or without\r\n// modification, are permitted provided that the following conditions are met:\r\n// * Redistributions of source code must retain the above copyright\r\n// notice, this list of conditions and the following disclaimer.\r\n// * Redistributions in binary form must reproduce the above copyright\r\n// notice, this list of conditions and the following disclaimer in the\r\n// documentation and/or other materials provided with the distribution.\r\n// * Neither the name of the Syoyo Fujita nor the\r\n// names of its contributors may be used to endorse or promote products\r\n// derived from this software without specific prior written permission.\r\n\r\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\r\n// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r\n// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r\n// DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\r\n// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r\n// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r\n// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r\n// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r\n// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n// */\r\n\r\n// // TinyEXR contains some OpenEXR code, which is licensed under ------------\r\n\r\n// ///////////////////////////////////////////////////////////////////////////\r\n// //\r\n// // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas\r\n// // Digital Ltd. LLC\r\n// //\r\n// // All rights reserved.\r\n// //\r\n// // Redistribution and use in source and binary forms, with or without\r\n// // modification, are permitted provided that the following conditions are\r\n// // met:\r\n// // * Redistributions of source code must retain the above copyright\r\n// // notice, this list of conditions and the following disclaimer.\r\n// // * Redistributions in binary form must reproduce the above\r\n// // copyright notice, this list of conditions and the following disclaimer\r\n// // in the documentation and/or other materials provided with the\r\n// // distribution.\r\n// // * Neither the name of Industrial Light & Magic nor the names of\r\n// // its contributors may be used to endorse or promote products derived\r\n// // from this software without specific prior written permission.\r\n// //\r\n// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r\n// // \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r\n// // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r\n// // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r\n// // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n// // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r\n// // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r\n// // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r\n// // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r\n// // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r\n// // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n// //\r\n// ///////////////////////////////////////////////////////////////////////////\r\n\r\n// // End of OpenEXR license -------------------------------------------------\r\n\r\n/** @internal */\r\nexport function DecodeRunLength(source: ArrayBufferLike) {\r\n let size = source.byteLength;\r\n const out = [];\r\n let p = 0;\r\n\r\n const reader = new DataView(source);\r\n\r\n while (size > 0) {\r\n const l = reader.getInt8(p++);\r\n\r\n if (l < 0) {\r\n const count = -l;\r\n size -= count + 1;\r\n\r\n for (let i = 0; i < count; i++) {\r\n out.push(reader.getUint8(p++));\r\n }\r\n } else {\r\n const count = l;\r\n size -= 2;\r\n\r\n const value = reader.getUint8(p++);\r\n\r\n for (let i = 0; i < count + 1; i++) {\r\n out.push(value);\r\n }\r\n }\r\n }\r\n\r\n return out;\r\n}\r\n"]}
|
|
@@ -24,7 +24,7 @@ export interface DataCursor {
|
|
|
24
24
|
* @param offset current offset in the buffer
|
|
25
25
|
* @returns a string
|
|
26
26
|
*/
|
|
27
|
-
export declare function ParseNullTerminatedString(buffer:
|
|
27
|
+
export declare function ParseNullTerminatedString(buffer: ArrayBufferLike, offset: DataCursor): string;
|
|
28
28
|
/**
|
|
29
29
|
* Parse an int32 from the buffer
|
|
30
30
|
* @param dataView dataview on the data
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exrLoader.core.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Materials/Textures/Loaders/EXR/exrLoader.core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,mDAAyC;AACzD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAErG;;;;GAIG;AAEH,KAAK;AACL,0CAA0C;AAC1C,uBAAuB;AAEvB,qEAAqE;AACrE,8EAA8E;AAC9E,uEAAuE;AACvE,sEAAsE;AACtE,0EAA0E;AAC1E,4EAA4E;AAC5E,6EAA6E;AAC7E,qDAAqD;AACrD,6EAA6E;AAC7E,8EAA8E;AAE9E,kFAAkF;AAClF,gFAAgF;AAChF,yEAAyE;AACzE,qEAAqE;AACrE,6EAA6E;AAC7E,+EAA+E;AAC/E,8EAA8E;AAC9E,6EAA6E;AAC7E,gFAAgF;AAChF,+DAA+D;AAC/D,KAAK;AAEL,8EAA8E;AAE9E,8EAA8E;AAC9E,KAAK;AACL,uEAAuE;AACvE,sBAAsB;AACtB,KAAK;AACL,0BAA0B;AAC1B,KAAK;AACL,wEAAwE;AACxE,4EAA4E;AA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AE,CAAC;YACX,MAAM;QACV,CAAC;QACD,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;IAC5B,CAAC;AACL,CAAC","sourcesContent":["import { Clamp } from \"core/Maths/math.scalar.functions\";\r\nimport { FLOAT32_SIZE, INT16_SIZE, INT32_SIZE, INT8_SIZE, ULONG_SIZE } from \"./exrLoader.interfaces\";\r\n\r\n/**\r\n * Inspired by https://github.com/sciecode/three.js/blob/dev/examples/jsm/loaders/EXRLoader.js\r\n * Referred to the original Industrial Light & Magic OpenEXR implementation and the TinyEXR / Syoyo Fujita\r\n * implementation.\r\n */\r\n\r\n// /*\r\n// Copyright (c) 2014 - 2017, Syoyo Fujita\r\n// All rights reserved.\r\n\r\n// Redistribution and use in source and binary forms, with or without\r\n// modification, are permitted provided that the following conditions are met:\r\n// * Redistributions of source code must retain the above copyright\r\n// notice, this list of conditions and the following disclaimer.\r\n// * Redistributions in binary form must reproduce the above copyright\r\n// notice, this list of conditions and the following disclaimer in the\r\n// documentation and/or other materials provided with the distribution.\r\n// * Neither the name of the Syoyo Fujita nor the\r\n// names of its contributors may be used to endorse or promote products\r\n// derived from this software without specific prior written permission.\r\n\r\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\r\n// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r\n// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r\n// DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\r\n// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r\n// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r\n// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r\n// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r\n// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n// */\r\n\r\n// // TinyEXR contains some OpenEXR code, which is licensed under ------------\r\n\r\n// ///////////////////////////////////////////////////////////////////////////\r\n// //\r\n// // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas\r\n// // Digital Ltd. LLC\r\n// //\r\n// // All rights reserved.\r\n// //\r\n// // Redistribution and use in source and binary forms, with or without\r\n// // modification, are permitted provided that the following conditions are\r\n// // met:\r\n// // * Redistributions of source code must retain the above copyright\r\n// // notice, this list of conditions and the following disclaimer.\r\n// // * Redistributions in binary form must reproduce the above\r\n// // copyright notice, this list of conditions and the following disclaimer\r\n// // in the documentation and/or other materials provided with the\r\n// // distribution.\r\n// // * Neither the name of Industrial Light & Magic nor the names of\r\n// // its contributors may be used to endorse or promote products derived\r\n// // from this software without specific prior written permission.\r\n// //\r\n// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r\n// // \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r\n// // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r\n// // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r\n// // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n// // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r\n// // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r\n// // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r\n// // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r\n// // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r\n// // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n// //\r\n// ///////////////////////////////////////////////////////////////////////////\r\n\r\n// // End of OpenEXR license -------------------------------------------------\r\n\r\nexport enum CompressionCodes {\r\n NO_COMPRESSION,\r\n RLE_COMPRESSION,\r\n ZIPS_COMPRESSION,\r\n ZIP_COMPRESSION,\r\n PIZ_COMPRESSION,\r\n PXR24_COMPRESSION,\r\n}\r\n\r\nenum LineOrders {\r\n INCREASING_Y,\r\n DECREASING_Y,\r\n}\r\n\r\n/**\r\n * Interface used to define the cursor position in the data\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport interface DataCursor {\r\n /** Curosr position */\r\n value: number;\r\n}\r\n\r\nconst Tables = GenerateTables();\r\n\r\n// Fast Half Float Conversions, http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf\r\nfunction GenerateTables() {\r\n // float32 to float16 helpers\r\n\r\n const buffer = new ArrayBuffer(4);\r\n const floatView = new Float32Array(buffer);\r\n const uint32View = new Uint32Array(buffer);\r\n\r\n const baseTable = new Uint32Array(512);\r\n const shiftTable = new Uint32Array(512);\r\n\r\n for (let i = 0; i < 256; ++i) {\r\n const e = i - 127;\r\n\r\n // very small number (0, -0)\r\n\r\n if (e < -27) {\r\n baseTable[i] = 0x0000;\r\n baseTable[i | 0x100] = 0x8000;\r\n shiftTable[i] = 24;\r\n shiftTable[i | 0x100] = 24;\r\n\r\n // small number (denorm)\r\n } else if (e < -14) {\r\n baseTable[i] = 0x0400 >> (-e - 14);\r\n baseTable[i | 0x100] = (0x0400 >> (-e - 14)) | 0x8000;\r\n shiftTable[i] = -e - 1;\r\n shiftTable[i | 0x100] = -e - 1;\r\n\r\n // normal number\r\n } else if (e <= 15) {\r\n baseTable[i] = (e + 15) << 10;\r\n baseTable[i | 0x100] = ((e + 15) << 10) | 0x8000;\r\n shiftTable[i] = 13;\r\n shiftTable[i | 0x100] = 13;\r\n\r\n // large number (Infinity, -Infinity)\r\n } else if (e < 128) {\r\n baseTable[i] = 0x7c00;\r\n baseTable[i | 0x100] = 0xfc00;\r\n shiftTable[i] = 24;\r\n shiftTable[i | 0x100] = 24;\r\n\r\n // stay (NaN, Infinity, -Infinity)\r\n } else {\r\n baseTable[i] = 0x7c00;\r\n baseTable[i | 0x100] = 0xfc00;\r\n shiftTable[i] = 13;\r\n shiftTable[i | 0x100] = 13;\r\n }\r\n }\r\n\r\n // float16 to float32 helpers\r\n const mantissaTable = new Uint32Array(2048);\r\n const exponentTable = new Uint32Array(64);\r\n const offsetTable = new Uint32Array(64);\r\n\r\n for (let i = 1; i < 1024; ++i) {\r\n let m = i << 13; // zero pad mantissa bits\r\n let e = 0; // zero exponent\r\n\r\n // normalized\r\n while ((m & 0x00800000) === 0) {\r\n m <<= 1;\r\n e -= 0x00800000; // decrement exponent\r\n }\r\n\r\n m &= ~0x00800000; // clear leading 1 bit\r\n e += 0x38800000; // adjust bias\r\n\r\n mantissaTable[i] = m | e;\r\n }\r\n\r\n for (let i = 1024; i < 2048; ++i) {\r\n mantissaTable[i] = 0x38000000 + ((i - 1024) << 13);\r\n }\r\n\r\n for (let i = 1; i < 31; ++i) {\r\n exponentTable[i] = i << 23;\r\n }\r\n\r\n exponentTable[31] = 0x47800000;\r\n exponentTable[32] = 0x80000000;\r\n\r\n for (let i = 33; i < 63; ++i) {\r\n exponentTable[i] = 0x80000000 + ((i - 32) << 23);\r\n }\r\n\r\n exponentTable[63] = 0xc7800000;\r\n\r\n for (let i = 1; i < 64; ++i) {\r\n if (i !== 32) {\r\n offsetTable[i] = 1024;\r\n }\r\n }\r\n\r\n return {\r\n floatView: floatView,\r\n uint32View: uint32View,\r\n baseTable: baseTable,\r\n shiftTable: shiftTable,\r\n mantissaTable: mantissaTable,\r\n exponentTable: exponentTable,\r\n offsetTable: offsetTable,\r\n };\r\n}\r\n\r\n/**\r\n * Parse a null terminated string from the buffer\r\n * @param buffer buffer to read from\r\n * @param offset current offset in the buffer\r\n * @returns a string\r\n */\r\nexport function ParseNullTerminatedString(buffer: ArrayBuffer, offset: DataCursor) {\r\n const uintBuffer = new Uint8Array(buffer);\r\n let endOffset = 0;\r\n\r\n while (uintBuffer[offset.value + endOffset] != 0) {\r\n endOffset += 1;\r\n }\r\n\r\n const stringValue = new TextDecoder().decode(uintBuffer.slice(offset.value, offset.value + endOffset));\r\n\r\n offset.value = offset.value + endOffset + 1;\r\n\r\n return stringValue;\r\n}\r\n\r\n/**\r\n * Parse an int32 from the buffer\r\n * @param dataView dataview on the data\r\n * @param offset current offset in the data view\r\n * @returns an int32\r\n */\r\nexport function ParseInt32(dataView: DataView, offset: DataCursor) {\r\n const value = dataView.getInt32(offset.value, true);\r\n\r\n offset.value += INT32_SIZE;\r\n\r\n return value;\r\n}\r\n\r\n/**\r\n * Parse an uint32 from the buffer\r\n * @param dataView data view to read from\r\n * @param offset offset in the data view\r\n * @returns an uint32\r\n */\r\nexport function ParseUint32(dataView: DataView, offset: DataCursor) {\r\n const value = dataView.getUint32(offset.value, true);\r\n\r\n offset.value += INT32_SIZE;\r\n\r\n return value;\r\n}\r\n\r\n/**\r\n * Parse an uint8 from the buffer\r\n * @param dataView dataview on the data\r\n * @param offset current offset in the data view\r\n * @returns an uint8\r\n */\r\nexport function ParseUint8(dataView: DataView, offset: DataCursor) {\r\n const value = dataView.getUint8(offset.value);\r\n\r\n offset.value += INT8_SIZE;\r\n\r\n return value;\r\n}\r\n\r\n/**\r\n * Parse an uint16 from the buffer\r\n * @param dataView dataview on the data\r\n * @param offset current offset in the data view\r\n * @returns an uint16\r\n */\r\nexport function ParseUint16(dataView: DataView, offset: DataCursor) {\r\n const value = dataView.getUint16(offset.value, true);\r\n\r\n offset.value += INT16_SIZE;\r\n\r\n return value;\r\n}\r\n\r\n/**\r\n * Parse an uint8 from an array buffer\r\n * @param array array buffer\r\n * @param offset current offset in the data view\r\n * @returns an uint16\r\n */\r\nexport function ParseUint8Array(array: Uint8Array, offset: DataCursor) {\r\n const value = array[offset.value];\r\n\r\n offset.value += INT8_SIZE;\r\n\r\n return value;\r\n}\r\n\r\n/**\r\n * Parse an int64 from the buffer\r\n * @param dataView dataview on the data\r\n * @param offset current offset in the data view\r\n * @returns an int64\r\n */\r\nexport function ParseInt64(dataView: DataView, offset: DataCursor) {\r\n let int;\r\n\r\n if (\"getBigInt64\" in DataView.prototype) {\r\n int = Number(dataView.getBigInt64(offset.value, true));\r\n } else {\r\n int = dataView.getUint32(offset.value + 4, true) + Number(dataView.getUint32(offset.value, true) << 32);\r\n }\r\n\r\n offset.value += ULONG_SIZE;\r\n\r\n return int;\r\n}\r\n\r\n/**\r\n * Parse a float32 from the buffer\r\n * @param dataView dataview on the data\r\n * @param offset current offset in the data view\r\n * @returns a float32\r\n */\r\nexport function ParseFloat32(dataView: DataView, offset: DataCursor) {\r\n const value = dataView.getFloat32(offset.value, true);\r\n\r\n offset.value += FLOAT32_SIZE;\r\n\r\n return value;\r\n}\r\n\r\n/**\r\n * Parse a float16 from the buffer\r\n * @param dataView dataview on the data\r\n * @param offset current offset in the data view\r\n * @returns a float16\r\n */\r\nexport function ParseFloat16(dataView: DataView, offset: DataCursor) {\r\n return DecodeFloat16(ParseUint16(dataView, offset));\r\n}\r\n\r\nfunction DecodeFloat16(binary: number) {\r\n const exponent = (binary & 0x7c00) >> 10;\r\n const fraction = binary & 0x03ff;\r\n\r\n return (\r\n (binary >> 15 ? -1 : 1) *\r\n (exponent ? (exponent === 0x1f ? (fraction ? NaN : Infinity) : Math.pow(2, exponent - 15) * (1 + fraction / 0x400)) : 6.103515625e-5 * (fraction / 0x400))\r\n );\r\n}\r\n\r\nfunction ToHalfFloat(value: number) {\r\n if (Math.abs(value) > 65504) {\r\n throw new Error(\"Value out of range.Consider using float instead of half-float.\");\r\n }\r\n\r\n value = Clamp(value, -65504, 65504);\r\n\r\n Tables.floatView[0] = value;\r\n const f = Tables.uint32View[0];\r\n const e = (f >> 23) & 0x1ff;\r\n return Tables.baseTable[e] + ((f & 0x007fffff) >> Tables.shiftTable[e]);\r\n}\r\n\r\n/**\r\n * Decode a float32 from the buffer\r\n * @param dataView dataview on the data\r\n * @param offset current offset in the data view\r\n * @returns a float32\r\n */\r\nexport function DecodeFloat32(dataView: DataView, offset: DataCursor) {\r\n return ToHalfFloat(ParseFloat32(dataView, offset));\r\n}\r\n\r\nfunction ParseFixedLengthString(buffer: ArrayBuffer, offset: DataCursor, size: number) {\r\n const stringValue = new TextDecoder().decode(new Uint8Array(buffer).slice(offset.value, offset.value + size));\r\n\r\n offset.value = offset.value + size;\r\n\r\n return stringValue;\r\n}\r\n\r\nfunction ParseRational(dataView: DataView, offset: DataCursor) {\r\n const x = ParseInt32(dataView, offset);\r\n const y = ParseUint32(dataView, offset);\r\n\r\n return [x, y];\r\n}\r\n\r\nfunction ParseTimecode(dataView: DataView, offset: DataCursor) {\r\n const x = ParseUint32(dataView, offset);\r\n const y = ParseUint32(dataView, offset);\r\n\r\n return [x, y];\r\n}\r\n\r\nfunction ParseV2f(dataView: DataView, offset: DataCursor) {\r\n const x = ParseFloat32(dataView, offset);\r\n const y = ParseFloat32(dataView, offset);\r\n\r\n return [x, y];\r\n}\r\n\r\nfunction ParseV3f(dataView: DataView, offset: DataCursor) {\r\n const x = ParseFloat32(dataView, offset);\r\n const y = ParseFloat32(dataView, offset);\r\n const z = ParseFloat32(dataView, offset);\r\n\r\n return [x, y, z];\r\n}\r\n\r\nfunction ParseChlist(dataView: DataView, offset: DataCursor, size: number) {\r\n const startOffset = offset.value;\r\n const channels = [];\r\n\r\n while (offset.value < startOffset + size - 1) {\r\n const name = ParseNullTerminatedString(dataView.buffer, offset);\r\n const pixelType = ParseInt32(dataView, offset);\r\n const pLinear = ParseUint8(dataView, offset);\r\n offset.value += 3; // reserved, three chars\r\n const xSampling = ParseInt32(dataView, offset);\r\n const ySampling = ParseInt32(dataView, offset);\r\n\r\n channels.push({\r\n name: name,\r\n pixelType: pixelType,\r\n pLinear: pLinear,\r\n xSampling: xSampling,\r\n ySampling: ySampling,\r\n });\r\n }\r\n\r\n offset.value += 1;\r\n\r\n return channels;\r\n}\r\n\r\nfunction ParseChromaticities(dataView: DataView, offset: DataCursor) {\r\n const redX = ParseFloat32(dataView, offset);\r\n const redY = ParseFloat32(dataView, offset);\r\n const greenX = ParseFloat32(dataView, offset);\r\n const greenY = ParseFloat32(dataView, offset);\r\n const blueX = ParseFloat32(dataView, offset);\r\n const blueY = ParseFloat32(dataView, offset);\r\n const whiteX = ParseFloat32(dataView, offset);\r\n const whiteY = ParseFloat32(dataView, offset);\r\n\r\n return { redX: redX, redY: redY, greenX: greenX, greenY: greenY, blueX: blueX, blueY: blueY, whiteX: whiteX, whiteY: whiteY };\r\n}\r\n\r\nfunction ParseCompression(dataView: DataView, offset: DataCursor) {\r\n return ParseUint8(dataView, offset);\r\n}\r\n\r\nfunction ParseBox2i(dataView: DataView, offset: DataCursor) {\r\n const xMin = ParseInt32(dataView, offset);\r\n const yMin = ParseInt32(dataView, offset);\r\n const xMax = ParseInt32(dataView, offset);\r\n const yMax = ParseInt32(dataView, offset);\r\n\r\n return { xMin: xMin, yMin: yMin, xMax: xMax, yMax: yMax };\r\n}\r\n\r\nfunction ParseLineOrder(dataView: DataView, offset: DataCursor) {\r\n const lineOrder = ParseUint8(dataView, offset);\r\n\r\n return LineOrders[lineOrder];\r\n}\r\n\r\n/**\r\n * Parse a value from the data view\r\n * @param dataView defines the data view to read from\r\n * @param offset defines the current offset in the data view\r\n * @param type defines the type of the value to read\r\n * @param size defines the size of the value to read\r\n * @returns the parsed value\r\n */\r\nexport function ParseValue(dataView: DataView, offset: DataCursor, type: string, size: number) {\r\n switch (type) {\r\n case \"string\":\r\n case \"stringvector\":\r\n case \"iccProfile\":\r\n return ParseFixedLengthString(dataView.buffer, offset, size);\r\n case \"chlist\":\r\n return ParseChlist(dataView, offset, size);\r\n case \"chromaticities\":\r\n return ParseChromaticities(dataView, offset);\r\n case \"compression\":\r\n return ParseCompression(dataView, offset);\r\n case \"box2i\":\r\n return ParseBox2i(dataView, offset);\r\n case \"lineOrder\":\r\n return ParseLineOrder(dataView, offset);\r\n case \"float\":\r\n return ParseFloat32(dataView, offset);\r\n case \"v2f\":\r\n return ParseV2f(dataView, offset);\r\n case \"v3f\":\r\n return ParseV3f(dataView, offset);\r\n case \"int\":\r\n return ParseInt32(dataView, offset);\r\n case \"rational\":\r\n return ParseRational(dataView, offset);\r\n case \"timecode\":\r\n return ParseTimecode(dataView, offset);\r\n case \"preview\":\r\n offset.value += size;\r\n return \"skipped\";\r\n default:\r\n offset.value += size;\r\n return undefined;\r\n }\r\n}\r\n\r\n/**\r\n * Revert the endianness of the data\r\n * @param source defines the source\r\n */\r\nexport function Predictor(source: Uint8Array) {\r\n for (let t = 1; t < source.length; t++) {\r\n const d = source[t - 1] + source[t] - 128;\r\n source[t] = d;\r\n }\r\n}\r\n\r\n/**\r\n * Interleave pixels\r\n * @param source defines the data source\r\n * @param out defines the output\r\n */\r\nexport function InterleaveScalar(source: Uint8Array, out: Uint8Array) {\r\n let t1 = 0;\r\n let t2 = Math.floor((source.length + 1) / 2);\r\n let s = 0;\r\n const stop = source.length - 1;\r\n\r\n // eslint-disable-next-line no-constant-condition\r\n while (true) {\r\n if (s > stop) {\r\n break;\r\n }\r\n out[s++] = source[t1++];\r\n\r\n if (s > stop) {\r\n break;\r\n }\r\n out[s++] = source[t2++];\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"exrLoader.core.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Materials/Textures/Loaders/EXR/exrLoader.core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,mDAAyC;AACzD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,wBAAwB,C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;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAkB,EAAE,GAAe;IAChE,IAAI,EAAE,GAAG,CAAC,CAAC;IACX,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7C,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;IAE/B,iDAAiD;IACjD,OAAO,IAAI,EAAE,CAAC;QACV,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC;YACX,MAAM;QACV,CAAC;QACD,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;QAExB,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC;YACX,MAAM;QACV,CAAC;QACD,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;IAC5B,CAAC;AACL,CAAC","sourcesContent":["import { Clamp } from \"core/Maths/math.scalar.functions\";\r\nimport { FLOAT32_SIZE, INT16_SIZE, INT32_SIZE, INT8_SIZE, ULONG_SIZE } from \"./exrLoader.interfaces\";\r\n\r\n/**\r\n * Inspired by https://github.com/sciecode/three.js/blob/dev/examples/jsm/loaders/EXRLoader.js\r\n * Referred to the original Industrial Light & Magic OpenEXR implementation and the TinyEXR / Syoyo Fujita\r\n * implementation.\r\n */\r\n\r\n// /*\r\n// Copyright (c) 2014 - 2017, Syoyo Fujita\r\n// All rights reserved.\r\n\r\n// Redistribution and use in source and binary forms, with or without\r\n// modification, are permitted provided that the following conditions are met:\r\n// * Redistributions of source code must retain the above copyright\r\n// notice, this list of conditions and the following disclaimer.\r\n// * Redistributions in binary form must reproduce the above copyright\r\n// notice, this list of conditions and the following disclaimer in the\r\n// documentation and/or other materials provided with the distribution.\r\n// * Neither the name of the Syoyo Fujita nor the\r\n// names of its contributors may be used to endorse or promote products\r\n// derived from this software without specific prior written permission.\r\n\r\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\r\n// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r\n// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r\n// DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\r\n// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r\n// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r\n// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r\n// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r\n// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n// */\r\n\r\n// // TinyEXR contains some OpenEXR code, which is licensed under ------------\r\n\r\n// ///////////////////////////////////////////////////////////////////////////\r\n// //\r\n// // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas\r\n// // Digital Ltd. LLC\r\n// //\r\n// // All rights reserved.\r\n// //\r\n// // Redistribution and use in source and binary forms, with or without\r\n// // modification, are permitted provided that the following conditions are\r\n// // met:\r\n// // * Redistributions of source code must retain the above copyright\r\n// // notice, this list of conditions and the following disclaimer.\r\n// // * Redistributions in binary form must reproduce the above\r\n// // copyright notice, this list of conditions and the following disclaimer\r\n// // in the documentation and/or other materials provided with the\r\n// // distribution.\r\n// // * Neither the name of Industrial Light & Magic nor the names of\r\n// // its contributors may be used to endorse or promote products derived\r\n// // from this software without specific prior written permission.\r\n// //\r\n// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r\n// // \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r\n// // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r\n// // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r\n// // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n// // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r\n// // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r\n// // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r\n// // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r\n// // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r\n// // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n// //\r\n// ///////////////////////////////////////////////////////////////////////////\r\n\r\n// // End of OpenEXR license -------------------------------------------------\r\n\r\nexport enum CompressionCodes {\r\n NO_COMPRESSION,\r\n RLE_COMPRESSION,\r\n ZIPS_COMPRESSION,\r\n ZIP_COMPRESSION,\r\n PIZ_COMPRESSION,\r\n PXR24_COMPRESSION,\r\n}\r\n\r\nenum LineOrders {\r\n INCREASING_Y,\r\n DECREASING_Y,\r\n}\r\n\r\n/**\r\n * Interface used to define the cursor position in the data\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport interface DataCursor {\r\n /** Curosr position */\r\n value: number;\r\n}\r\n\r\nconst Tables = GenerateTables();\r\n\r\n// Fast Half Float Conversions, http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf\r\nfunction GenerateTables() {\r\n // float32 to float16 helpers\r\n\r\n const buffer = new ArrayBuffer(4);\r\n const floatView = new Float32Array(buffer);\r\n const uint32View = new Uint32Array(buffer);\r\n\r\n const baseTable = new Uint32Array(512);\r\n const shiftTable = new Uint32Array(512);\r\n\r\n for (let i = 0; i < 256; ++i) {\r\n const e = i - 127;\r\n\r\n // very small number (0, -0)\r\n\r\n if (e < -27) {\r\n baseTable[i] = 0x0000;\r\n baseTable[i | 0x100] = 0x8000;\r\n shiftTable[i] = 24;\r\n shiftTable[i | 0x100] = 24;\r\n\r\n // small number (denorm)\r\n } else if (e < -14) {\r\n baseTable[i] = 0x0400 >> (-e - 14);\r\n baseTable[i | 0x100] = (0x0400 >> (-e - 14)) | 0x8000;\r\n shiftTable[i] = -e - 1;\r\n shiftTable[i | 0x100] = -e - 1;\r\n\r\n // normal number\r\n } else if (e <= 15) {\r\n baseTable[i] = (e + 15) << 10;\r\n baseTable[i | 0x100] = ((e + 15) << 10) | 0x8000;\r\n shiftTable[i] = 13;\r\n shiftTable[i | 0x100] = 13;\r\n\r\n // large number (Infinity, -Infinity)\r\n } else if (e < 128) {\r\n baseTable[i] = 0x7c00;\r\n baseTable[i | 0x100] = 0xfc00;\r\n shiftTable[i] = 24;\r\n shiftTable[i | 0x100] = 24;\r\n\r\n // stay (NaN, Infinity, -Infinity)\r\n } else {\r\n baseTable[i] = 0x7c00;\r\n baseTable[i | 0x100] = 0xfc00;\r\n shiftTable[i] = 13;\r\n shiftTable[i | 0x100] = 13;\r\n }\r\n }\r\n\r\n // float16 to float32 helpers\r\n const mantissaTable = new Uint32Array(2048);\r\n const exponentTable = new Uint32Array(64);\r\n const offsetTable = new Uint32Array(64);\r\n\r\n for (let i = 1; i < 1024; ++i) {\r\n let m = i << 13; // zero pad mantissa bits\r\n let e = 0; // zero exponent\r\n\r\n // normalized\r\n while ((m & 0x00800000) === 0) {\r\n m <<= 1;\r\n e -= 0x00800000; // decrement exponent\r\n }\r\n\r\n m &= ~0x00800000; // clear leading 1 bit\r\n e += 0x38800000; // adjust bias\r\n\r\n mantissaTable[i] = m | e;\r\n }\r\n\r\n for (let i = 1024; i < 2048; ++i) {\r\n mantissaTable[i] = 0x38000000 + ((i - 1024) << 13);\r\n }\r\n\r\n for (let i = 1; i < 31; ++i) {\r\n exponentTable[i] = i << 23;\r\n }\r\n\r\n exponentTable[31] = 0x47800000;\r\n exponentTable[32] = 0x80000000;\r\n\r\n for (let i = 33; i < 63; ++i) {\r\n exponentTable[i] = 0x80000000 + ((i - 32) << 23);\r\n }\r\n\r\n exponentTable[63] = 0xc7800000;\r\n\r\n for (let i = 1; i < 64; ++i) {\r\n if (i !== 32) {\r\n offsetTable[i] = 1024;\r\n }\r\n }\r\n\r\n return {\r\n floatView: floatView,\r\n uint32View: uint32View,\r\n baseTable: baseTable,\r\n shiftTable: shiftTable,\r\n mantissaTable: mantissaTable,\r\n exponentTable: exponentTable,\r\n offsetTable: offsetTable,\r\n };\r\n}\r\n\r\n/**\r\n * Parse a null terminated string from the buffer\r\n * @param buffer buffer to read from\r\n * @param offset current offset in the buffer\r\n * @returns a string\r\n */\r\nexport function ParseNullTerminatedString(buffer: ArrayBufferLike, offset: DataCursor) {\r\n const uintBuffer = new Uint8Array(buffer);\r\n let endOffset = 0;\r\n\r\n while (uintBuffer[offset.value + endOffset] != 0) {\r\n endOffset += 1;\r\n }\r\n\r\n const stringValue = new TextDecoder().decode(uintBuffer.slice(offset.value, offset.value + endOffset));\r\n\r\n offset.value = offset.value + endOffset + 1;\r\n\r\n return stringValue;\r\n}\r\n\r\n/**\r\n * Parse an int32 from the buffer\r\n * @param dataView dataview on the data\r\n * @param offset current offset in the data view\r\n * @returns an int32\r\n */\r\nexport function ParseInt32(dataView: DataView, offset: DataCursor) {\r\n const value = dataView.getInt32(offset.value, true);\r\n\r\n offset.value += INT32_SIZE;\r\n\r\n return value;\r\n}\r\n\r\n/**\r\n * Parse an uint32 from the buffer\r\n * @param dataView data view to read from\r\n * @param offset offset in the data view\r\n * @returns an uint32\r\n */\r\nexport function ParseUint32(dataView: DataView, offset: DataCursor) {\r\n const value = dataView.getUint32(offset.value, true);\r\n\r\n offset.value += INT32_SIZE;\r\n\r\n return value;\r\n}\r\n\r\n/**\r\n * Parse an uint8 from the buffer\r\n * @param dataView dataview on the data\r\n * @param offset current offset in the data view\r\n * @returns an uint8\r\n */\r\nexport function ParseUint8(dataView: DataView, offset: DataCursor) {\r\n const value = dataView.getUint8(offset.value);\r\n\r\n offset.value += INT8_SIZE;\r\n\r\n return value;\r\n}\r\n\r\n/**\r\n * Parse an uint16 from the buffer\r\n * @param dataView dataview on the data\r\n * @param offset current offset in the data view\r\n * @returns an uint16\r\n */\r\nexport function ParseUint16(dataView: DataView, offset: DataCursor) {\r\n const value = dataView.getUint16(offset.value, true);\r\n\r\n offset.value += INT16_SIZE;\r\n\r\n return value;\r\n}\r\n\r\n/**\r\n * Parse an uint8 from an array buffer\r\n * @param array array buffer\r\n * @param offset current offset in the data view\r\n * @returns an uint16\r\n */\r\nexport function ParseUint8Array(array: Uint8Array, offset: DataCursor) {\r\n const value = array[offset.value];\r\n\r\n offset.value += INT8_SIZE;\r\n\r\n return value;\r\n}\r\n\r\n/**\r\n * Parse an int64 from the buffer\r\n * @param dataView dataview on the data\r\n * @param offset current offset in the data view\r\n * @returns an int64\r\n */\r\nexport function ParseInt64(dataView: DataView, offset: DataCursor) {\r\n let int;\r\n\r\n if (\"getBigInt64\" in DataView.prototype) {\r\n int = Number(dataView.getBigInt64(offset.value, true));\r\n } else {\r\n int = dataView.getUint32(offset.value + 4, true) + Number(dataView.getUint32(offset.value, true) << 32);\r\n }\r\n\r\n offset.value += ULONG_SIZE;\r\n\r\n return int;\r\n}\r\n\r\n/**\r\n * Parse a float32 from the buffer\r\n * @param dataView dataview on the data\r\n * @param offset current offset in the data view\r\n * @returns a float32\r\n */\r\nexport function ParseFloat32(dataView: DataView, offset: DataCursor) {\r\n const value = dataView.getFloat32(offset.value, true);\r\n\r\n offset.value += FLOAT32_SIZE;\r\n\r\n return value;\r\n}\r\n\r\n/**\r\n * Parse a float16 from the buffer\r\n * @param dataView dataview on the data\r\n * @param offset current offset in the data view\r\n * @returns a float16\r\n */\r\nexport function ParseFloat16(dataView: DataView, offset: DataCursor) {\r\n return DecodeFloat16(ParseUint16(dataView, offset));\r\n}\r\n\r\nfunction DecodeFloat16(binary: number) {\r\n const exponent = (binary & 0x7c00) >> 10;\r\n const fraction = binary & 0x03ff;\r\n\r\n return (\r\n (binary >> 15 ? -1 : 1) *\r\n (exponent ? (exponent === 0x1f ? (fraction ? NaN : Infinity) : Math.pow(2, exponent - 15) * (1 + fraction / 0x400)) : 6.103515625e-5 * (fraction / 0x400))\r\n );\r\n}\r\n\r\nfunction ToHalfFloat(value: number) {\r\n if (Math.abs(value) > 65504) {\r\n throw new Error(\"Value out of range.Consider using float instead of half-float.\");\r\n }\r\n\r\n value = Clamp(value, -65504, 65504);\r\n\r\n Tables.floatView[0] = value;\r\n const f = Tables.uint32View[0];\r\n const e = (f >> 23) & 0x1ff;\r\n return Tables.baseTable[e] + ((f & 0x007fffff) >> Tables.shiftTable[e]);\r\n}\r\n\r\n/**\r\n * Decode a float32 from the buffer\r\n * @param dataView dataview on the data\r\n * @param offset current offset in the data view\r\n * @returns a float32\r\n */\r\nexport function DecodeFloat32(dataView: DataView, offset: DataCursor) {\r\n return ToHalfFloat(ParseFloat32(dataView, offset));\r\n}\r\n\r\nfunction ParseFixedLengthString(buffer: ArrayBufferLike, offset: DataCursor, size: number) {\r\n const stringValue = new TextDecoder().decode(new Uint8Array(buffer).slice(offset.value, offset.value + size));\r\n\r\n offset.value = offset.value + size;\r\n\r\n return stringValue;\r\n}\r\n\r\nfunction ParseRational(dataView: DataView, offset: DataCursor) {\r\n const x = ParseInt32(dataView, offset);\r\n const y = ParseUint32(dataView, offset);\r\n\r\n return [x, y];\r\n}\r\n\r\nfunction ParseTimecode(dataView: DataView, offset: DataCursor) {\r\n const x = ParseUint32(dataView, offset);\r\n const y = ParseUint32(dataView, offset);\r\n\r\n return [x, y];\r\n}\r\n\r\nfunction ParseV2f(dataView: DataView, offset: DataCursor) {\r\n const x = ParseFloat32(dataView, offset);\r\n const y = ParseFloat32(dataView, offset);\r\n\r\n return [x, y];\r\n}\r\n\r\nfunction ParseV3f(dataView: DataView, offset: DataCursor) {\r\n const x = ParseFloat32(dataView, offset);\r\n const y = ParseFloat32(dataView, offset);\r\n const z = ParseFloat32(dataView, offset);\r\n\r\n return [x, y, z];\r\n}\r\n\r\nfunction ParseChlist(dataView: DataView, offset: DataCursor, size: number) {\r\n const startOffset = offset.value;\r\n const channels = [];\r\n\r\n while (offset.value < startOffset + size - 1) {\r\n const name = ParseNullTerminatedString(dataView.buffer, offset);\r\n const pixelType = ParseInt32(dataView, offset);\r\n const pLinear = ParseUint8(dataView, offset);\r\n offset.value += 3; // reserved, three chars\r\n const xSampling = ParseInt32(dataView, offset);\r\n const ySampling = ParseInt32(dataView, offset);\r\n\r\n channels.push({\r\n name: name,\r\n pixelType: pixelType,\r\n pLinear: pLinear,\r\n xSampling: xSampling,\r\n ySampling: ySampling,\r\n });\r\n }\r\n\r\n offset.value += 1;\r\n\r\n return channels;\r\n}\r\n\r\nfunction ParseChromaticities(dataView: DataView, offset: DataCursor) {\r\n const redX = ParseFloat32(dataView, offset);\r\n const redY = ParseFloat32(dataView, offset);\r\n const greenX = ParseFloat32(dataView, offset);\r\n const greenY = ParseFloat32(dataView, offset);\r\n const blueX = ParseFloat32(dataView, offset);\r\n const blueY = ParseFloat32(dataView, offset);\r\n const whiteX = ParseFloat32(dataView, offset);\r\n const whiteY = ParseFloat32(dataView, offset);\r\n\r\n return { redX: redX, redY: redY, greenX: greenX, greenY: greenY, blueX: blueX, blueY: blueY, whiteX: whiteX, whiteY: whiteY };\r\n}\r\n\r\nfunction ParseCompression(dataView: DataView, offset: DataCursor) {\r\n return ParseUint8(dataView, offset);\r\n}\r\n\r\nfunction ParseBox2i(dataView: DataView, offset: DataCursor) {\r\n const xMin = ParseInt32(dataView, offset);\r\n const yMin = ParseInt32(dataView, offset);\r\n const xMax = ParseInt32(dataView, offset);\r\n const yMax = ParseInt32(dataView, offset);\r\n\r\n return { xMin: xMin, yMin: yMin, xMax: xMax, yMax: yMax };\r\n}\r\n\r\nfunction ParseLineOrder(dataView: DataView, offset: DataCursor) {\r\n const lineOrder = ParseUint8(dataView, offset);\r\n\r\n return LineOrders[lineOrder];\r\n}\r\n\r\n/**\r\n * Parse a value from the data view\r\n * @param dataView defines the data view to read from\r\n * @param offset defines the current offset in the data view\r\n * @param type defines the type of the value to read\r\n * @param size defines the size of the value to read\r\n * @returns the parsed value\r\n */\r\nexport function ParseValue(dataView: DataView, offset: DataCursor, type: string, size: number) {\r\n switch (type) {\r\n case \"string\":\r\n case \"stringvector\":\r\n case \"iccProfile\":\r\n return ParseFixedLengthString(dataView.buffer, offset, size);\r\n case \"chlist\":\r\n return ParseChlist(dataView, offset, size);\r\n case \"chromaticities\":\r\n return ParseChromaticities(dataView, offset);\r\n case \"compression\":\r\n return ParseCompression(dataView, offset);\r\n case \"box2i\":\r\n return ParseBox2i(dataView, offset);\r\n case \"lineOrder\":\r\n return ParseLineOrder(dataView, offset);\r\n case \"float\":\r\n return ParseFloat32(dataView, offset);\r\n case \"v2f\":\r\n return ParseV2f(dataView, offset);\r\n case \"v3f\":\r\n return ParseV3f(dataView, offset);\r\n case \"int\":\r\n return ParseInt32(dataView, offset);\r\n case \"rational\":\r\n return ParseRational(dataView, offset);\r\n case \"timecode\":\r\n return ParseTimecode(dataView, offset);\r\n case \"preview\":\r\n offset.value += size;\r\n return \"skipped\";\r\n default:\r\n offset.value += size;\r\n return undefined;\r\n }\r\n}\r\n\r\n/**\r\n * Revert the endianness of the data\r\n * @param source defines the source\r\n */\r\nexport function Predictor(source: Uint8Array) {\r\n for (let t = 1; t < source.length; t++) {\r\n const d = source[t - 1] + source[t] - 128;\r\n source[t] = d;\r\n }\r\n}\r\n\r\n/**\r\n * Interleave pixels\r\n * @param source defines the data source\r\n * @param out defines the output\r\n */\r\nexport function InterleaveScalar(source: Uint8Array, out: Uint8Array) {\r\n let t1 = 0;\r\n let t2 = Math.floor((source.length + 1) / 2);\r\n let s = 0;\r\n const stop = source.length - 1;\r\n\r\n // eslint-disable-next-line no-constant-condition\r\n while (true) {\r\n if (s > stop) {\r\n break;\r\n }\r\n out[s++] = source[t1++];\r\n\r\n if (s > stop) {\r\n break;\r\n }\r\n out[s++] = source[t2++];\r\n }\r\n}\r\n"]}
|
|
@@ -114,6 +114,12 @@ export declare class InternalTexture extends TextureSampler {
|
|
|
114
114
|
*/
|
|
115
115
|
get useMipMaps(): Nullable<boolean>;
|
|
116
116
|
set useMipMaps(value: Nullable<boolean>);
|
|
117
|
+
/**
|
|
118
|
+
* Gets the number of mip levels for this texture.
|
|
119
|
+
* Note: This property has the correct value only if the texture was created through
|
|
120
|
+
* `createRawTexture` or `createRawTexture2DArray`.
|
|
121
|
+
*/
|
|
122
|
+
mipLevelCount: number;
|
|
117
123
|
/**
|
|
118
124
|
* Gets the number of samples used by the texture (WebGL2+ only)
|
|
119
125
|
*/
|
|
@@ -140,6 +140,12 @@ export class InternalTexture extends TextureSampler {
|
|
|
140
140
|
*/
|
|
141
141
|
this.generateMipMaps = false;
|
|
142
142
|
this._useMipMaps = null;
|
|
143
|
+
/**
|
|
144
|
+
* Gets the number of mip levels for this texture.
|
|
145
|
+
* Note: This property has the correct value only if the texture was created through
|
|
146
|
+
* `createRawTexture` or `createRawTexture2DArray`.
|
|
147
|
+
*/
|
|
148
|
+
this.mipLevelCount = 1;
|
|
143
149
|
/**
|
|
144
150
|
* Gets the number of samples used by the texture (WebGL2+ only)
|
|
145
151
|
*/
|
|
@@ -332,8 +338,16 @@ export class InternalTexture extends TextureSampler {
|
|
|
332
338
|
}, null, this._buffer, undefined, this.format, this._extension, undefined, undefined, undefined, this._useSRGBBuffer);
|
|
333
339
|
return;
|
|
334
340
|
case 3 /* InternalTextureSource.Raw */:
|
|
335
|
-
proxy = this._engine.createRawTexture(this._bufferView, this.baseWidth, this.baseHeight, this.format, this.generateMipMaps, this.invertY, this.samplingMode, this._compression, this.type, this._creationFlags, this._useSRGBBuffer);
|
|
341
|
+
proxy = this._engine.createRawTexture(this._bufferView, this.baseWidth, this.baseHeight, this.format, this.generateMipMaps, this.invertY, this.samplingMode, this._compression, this.type, this._creationFlags, this._useSRGBBuffer, this.mipLevelCount);
|
|
336
342
|
proxy._swapAndDie(this, false);
|
|
343
|
+
if (this._bufferViewArray) {
|
|
344
|
+
for (let mipLevel = 0; mipLevel < this._bufferViewArray.length; mipLevel++) {
|
|
345
|
+
const mipData = this._bufferViewArray[mipLevel];
|
|
346
|
+
if (mipData) {
|
|
347
|
+
this._engine.updateRawTexture(this, mipData, this.format, this.invertY, this._compression, this.type, this._useSRGBBuffer, mipLevel);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
337
351
|
this.isReady = true;
|
|
338
352
|
break;
|
|
339
353
|
case 10 /* InternalTextureSource.Raw3D */:
|
|
@@ -342,8 +356,16 @@ export class InternalTexture extends TextureSampler {
|
|
|
342
356
|
this.isReady = true;
|
|
343
357
|
break;
|
|
344
358
|
case 11 /* InternalTextureSource.Raw2DArray */:
|
|
345
|
-
proxy = this._engine.createRawTexture2DArray(this._bufferView, this.baseWidth, this.baseHeight, this.baseDepth, this.format, this.generateMipMaps, this.invertY, this.samplingMode, this._compression, this.type);
|
|
359
|
+
proxy = this._engine.createRawTexture2DArray(this._bufferView, this.baseWidth, this.baseHeight, this.baseDepth, this.format, this.generateMipMaps, this.invertY, this.samplingMode, this._compression, this.type, this._creationFlags, this.mipLevelCount);
|
|
346
360
|
proxy._swapAndDie(this, false);
|
|
361
|
+
if (this._bufferViewArray) {
|
|
362
|
+
for (let mipLevel = 0; mipLevel < this._bufferViewArray.length; mipLevel++) {
|
|
363
|
+
const mipData = this._bufferViewArray[mipLevel];
|
|
364
|
+
if (mipData) {
|
|
365
|
+
this._engine.updateRawTexture2DArray(this, mipData, this.format, this.invertY, this._compression, this.type, mipLevel);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
347
369
|
this.isReady = true;
|
|
348
370
|
break;
|
|
349
371
|
case 4 /* InternalTextureSource.Dynamic */:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internalTexture.js","sourceRoot":"","sources":["../../../../../dev/core/src/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,IAAkB,qBA6DjB;AA7DD,WAAkB,qBAAqB;IACnC;;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,EA7DiB,qBAAqB,KAArB,qBAAqB,QA6DtC;AAED;;;GAGG;AACH,MAAM,OAAO,eAAgB,SAAQ,cAAc;IAiC/C;;;;OAIG;IACH,IAAoB,UAAU;QAC1B,OAAO,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC;IAC/E,CAAC;IACD,IAAoB,UAAU,CAAC,KAAwB;QACnD,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC7B,C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,IAAI,MAAM,CAAC,kBAAkB,EAAE,CAAC;gBAC5B,MAAM,CAAC,kBAAkB,CAAC,OAAO,EAAE,CAAC;YACxC,CAAC;YACD,MAAM,CAAC,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAC;QACxD,CAAC;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,CAAC;YACf,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC3B,CAAC;QAED,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC9B,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;YACf,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACvB,CAAC;IACL,CAAC;IAED;;OAEG;IACI,OAAO;QACV,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI,IAAI,CAAC,WAAW,KAAK,CAAC,EAAE,CAAC;YACzB,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC;YAChC,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAC;YAC/B,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;YACnC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;YAC7B,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC;QACtC,CAAC;IACL,CAAC;;AAtUD,gBAAgB;AACF,wBAAQ,GAAG,CAAC,AAAJ,CAAK","sourcesContent":["import { Observable } from \"../../Misc/observable\";\r\nimport type { ImageSource, Nullable, int } from \"../../types\";\r\nimport type { ICanvas, ICanvasRenderingContext } from \"../../Engines/ICanvas\";\r\nimport type { IHardwareTextureWrapper } from \"./hardwareTextureWrapper\";\r\nimport { TextureSampler } from \"./textureSampler\";\r\n\r\nimport type { AbstractEngine } from \"../../Engines/abstractEngine\";\r\nimport type { BaseTexture } from \"../../Materials/Textures/baseTexture\";\r\nimport type { SphericalPolynomial } from \"../../Maths/sphericalPolynomial\";\r\n\r\n/**\r\n * Defines the source of the internal texture\r\n */\r\nexport const 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 protected override _useMipMaps: Nullable<boolean> = null;\r\n /**\r\n * Indicates to use the mip maps (if available on the texture).\r\n * Thanks to this flag, you can instruct the sampler to not sample the mipmaps even if they exist (and if the sampling mode is set to a value that normally samples the mipmaps!)\r\n * If useMipMaps is null, the value of generateMipMaps is returned by the getter (for backward compatibility)\r\n */\r\n public override get useMipMaps() {\r\n return this._useMipMaps === null ? this.generateMipMaps : this._useMipMaps;\r\n }\r\n public override set useMipMaps(value: Nullable<boolean>) {\r\n this._useMipMaps = 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 /** @internal */\r\n public _creationFlags: number = 0;\r\n /** @internal */\r\n public _originalFormat?: number;\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<IHardwareTextureWrapper> = 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 /** @internal */\r\n public _premulAlpha = false;\r\n\r\n /** @internal */\r\n public _dynamicTextureSource: Nullable<ImageSource> = null;\r\n\r\n /** @internal */\r\n public _autoMSAAManagement = false;\r\n\r\n private _engine: AbstractEngine;\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(): AbstractEngine {\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: AbstractEngine, 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 // eslint-disable-next-line @typescript-eslint/no-floating-promises, github/no-then\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 this._creationFlags,\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 if (this._dynamicTextureSource) {\r\n this._engine.updateDynamicTexture(this, this._dynamicTextureSource, this.invertY, this._premulAlpha, this.format, true);\r\n }\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 ArrayBuffer.isView(this._buffer) ? this._buffer : null\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._originalFormat ?? 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 case InternalTextureSource.DepthStencil:\r\n case InternalTextureSource.Depth: {\r\n // Will be handled at the RenderTargetWrapper level\r\n break;\r\n }\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.is2DArray, this.isCube, this.is3D, this.width, this.height, this.depth);\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 if (this._references === 0) {\r\n this.onLoadedObservable.clear();\r\n this.onErrorObservable.clear();\r\n this._engine._releaseTexture(this);\r\n this._hardwareTexture = null;\r\n this._dynamicTextureSource = null;\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"internalTexture.js","sourceRoot":"","sources":["../../../../../dev/core/src/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,IAAkB,qBA6DjB;AA7DD,WAAkB,qBAAqB;IACnC;;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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EAAE,CAAC;YAChC,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAC;YAC/B,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;YACnC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;YAC7B,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC;QACtC,CAAC;IACL,CAAC;;AA3VD,gBAAgB;AACF,wBAAQ,GAAG,CAAC,AAAJ,CAAK","sourcesContent":["import { Observable } from \"../../Misc/observable\";\r\nimport type { ImageSource, Nullable, int } from \"../../types\";\r\nimport type { ICanvas, ICanvasRenderingContext } from \"../../Engines/ICanvas\";\r\nimport type { IHardwareTextureWrapper } from \"./hardwareTextureWrapper\";\r\nimport { TextureSampler } from \"./textureSampler\";\r\n\r\nimport type { AbstractEngine } from \"../../Engines/abstractEngine\";\r\nimport type { BaseTexture } from \"../../Materials/Textures/baseTexture\";\r\nimport type { SphericalPolynomial } from \"../../Maths/sphericalPolynomial\";\r\n\r\n/**\r\n * Defines the source of the internal texture\r\n */\r\nexport const 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 protected override _useMipMaps: Nullable<boolean> = null;\r\n /**\r\n * Indicates to use the mip maps (if available on the texture).\r\n * Thanks to this flag, you can instruct the sampler to not sample the mipmaps even if they exist (and if the sampling mode is set to a value that normally samples the mipmaps!)\r\n * If useMipMaps is null, the value of generateMipMaps is returned by the getter (for backward compatibility)\r\n */\r\n public override get useMipMaps() {\r\n return this._useMipMaps === null ? this.generateMipMaps : this._useMipMaps;\r\n }\r\n public override set useMipMaps(value: Nullable<boolean>) {\r\n this._useMipMaps = value;\r\n }\r\n /**\r\n * Gets the number of mip levels for this texture.\r\n * Note: This property has the correct value only if the texture was created through\r\n * `createRawTexture` or `createRawTexture2DArray`.\r\n */\r\n public mipLevelCount: number = 1;\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 /** @internal */\r\n public _creationFlags: number = 0;\r\n /** @internal */\r\n public _originalFormat?: number;\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<IHardwareTextureWrapper> = 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 /** @internal */\r\n public _premulAlpha = false;\r\n\r\n /** @internal */\r\n public _dynamicTextureSource: Nullable<ImageSource> = null;\r\n\r\n /** @internal */\r\n public _autoMSAAManagement = false;\r\n\r\n private _engine: AbstractEngine;\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(): AbstractEngine {\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: AbstractEngine, 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 // eslint-disable-next-line @typescript-eslint/no-floating-promises, github/no-then\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 this._creationFlags,\r\n this._useSRGBBuffer,\r\n this.mipLevelCount\r\n );\r\n proxy._swapAndDie(this, false);\r\n\r\n if (this._bufferViewArray) {\r\n for (let mipLevel = 0; mipLevel < this._bufferViewArray.length; mipLevel++) {\r\n const mipData = this._bufferViewArray[mipLevel];\r\n if (mipData) {\r\n this._engine.updateRawTexture(this, mipData, this.format, this.invertY, this._compression, this.type, this._useSRGBBuffer, mipLevel);\r\n }\r\n }\r\n }\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 this._creationFlags,\r\n this.mipLevelCount\r\n );\r\n proxy._swapAndDie(this, false);\r\n\r\n if (this._bufferViewArray) {\r\n for (let mipLevel = 0; mipLevel < this._bufferViewArray.length; mipLevel++) {\r\n const mipData = this._bufferViewArray[mipLevel];\r\n if (mipData) {\r\n this._engine.updateRawTexture2DArray(this, mipData, this.format, this.invertY, this._compression, this.type, mipLevel);\r\n }\r\n }\r\n }\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 if (this._dynamicTextureSource) {\r\n this._engine.updateDynamicTexture(this, this._dynamicTextureSource, this.invertY, this._premulAlpha, this.format, true);\r\n }\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 ArrayBuffer.isView(this._buffer) ? this._buffer : null\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._originalFormat ?? 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 case InternalTextureSource.DepthStencil:\r\n case InternalTextureSource.Depth: {\r\n // Will be handled at the RenderTargetWrapper level\r\n break;\r\n }\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.is2DArray, this.isCube, this.is3D, this.width, this.height, this.depth);\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 if (this._references === 0) {\r\n this.onLoadedObservable.clear();\r\n this.onErrorObservable.clear();\r\n this._engine._releaseTexture(this);\r\n this._hardwareTexture = null;\r\n this._dynamicTextureSource = null;\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -30,17 +30,24 @@ export declare class RawTexture extends Texture {
|
|
|
30
30
|
* @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
|
|
31
31
|
* @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
|
|
32
32
|
* @param waitDataToBeReady If set to true Rawtexture will wait data to be set in order to be flaged as ready.
|
|
33
|
+
* @param mipLevelCount defines the number of mip levels to allocate for the texture
|
|
33
34
|
*/
|
|
34
35
|
constructor(data: Nullable<ArrayBufferView>, width: number, height: number,
|
|
35
36
|
/**
|
|
36
37
|
* Define the format of the data (RGB, RGBA... Engine.TEXTUREFORMAT_xxx)
|
|
37
38
|
*/
|
|
38
|
-
format: number, sceneOrEngine: Nullable<Scene | AbstractEngine>, generateMipMaps?: boolean, invertY?: boolean, samplingMode?: number, type?: number, creationFlags?: number, useSRGBBuffer?: boolean, waitDataToBeReady?: boolean);
|
|
39
|
+
format: number, sceneOrEngine: Nullable<Scene | AbstractEngine>, generateMipMaps?: boolean, invertY?: boolean, samplingMode?: number, type?: number, creationFlags?: number, useSRGBBuffer?: boolean, waitDataToBeReady?: boolean, mipLevelCount?: number);
|
|
39
40
|
/**
|
|
40
41
|
* Updates the texture underlying data.
|
|
41
42
|
* @param data Define the new data of the texture
|
|
42
43
|
*/
|
|
43
44
|
update(data: ArrayBufferView): void;
|
|
45
|
+
/**
|
|
46
|
+
* Updates a specific mip level of the texture.
|
|
47
|
+
* @param data The new data for the mip level
|
|
48
|
+
* @param mipLevel The mip level to update (0 is the base level)
|
|
49
|
+
*/
|
|
50
|
+
updateMipLevel(data: ArrayBufferView, mipLevel: number): void;
|
|
44
51
|
/**
|
|
45
52
|
* Clones the texture.
|
|
46
53
|
* @returns the cloned texture
|
|
@@ -23,12 +23,13 @@ export class RawTexture extends Texture {
|
|
|
23
23
|
* @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
|
|
24
24
|
* @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
|
|
25
25
|
* @param waitDataToBeReady If set to true Rawtexture will wait data to be set in order to be flaged as ready.
|
|
26
|
+
* @param mipLevelCount defines the number of mip levels to allocate for the texture
|
|
26
27
|
*/
|
|
27
28
|
constructor(data, width, height,
|
|
28
29
|
/**
|
|
29
30
|
* Define the format of the data (RGB, RGBA... Engine.TEXTUREFORMAT_xxx)
|
|
30
31
|
*/
|
|
31
|
-
format, sceneOrEngine, generateMipMaps = true, invertY = false, samplingMode = 3, type = 0, creationFlags, useSRGBBuffer, waitDataToBeReady) {
|
|
32
|
+
format, sceneOrEngine, generateMipMaps = true, invertY = false, samplingMode = 3, type = 0, creationFlags, useSRGBBuffer, waitDataToBeReady, mipLevelCount) {
|
|
32
33
|
super(null, sceneOrEngine, !generateMipMaps, invertY, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, creationFlags);
|
|
33
34
|
this.format = format;
|
|
34
35
|
if (!this._engine) {
|
|
@@ -40,7 +41,7 @@ export class RawTexture extends Texture {
|
|
|
40
41
|
if (!this._engine._caps.textureHalfFloatLinearFiltering && type === 2) {
|
|
41
42
|
samplingMode = 1;
|
|
42
43
|
}
|
|
43
|
-
this._texture = this._engine.createRawTexture(data, width, height, format, generateMipMaps, invertY, samplingMode, null, type, creationFlags ?? 0, useSRGBBuffer ?? false);
|
|
44
|
+
this._texture = this._engine.createRawTexture(data, width, height, format, generateMipMaps, invertY, samplingMode, null, type, creationFlags ?? 0, useSRGBBuffer ?? false, mipLevelCount);
|
|
44
45
|
this.wrapU = Texture.CLAMP_ADDRESSMODE;
|
|
45
46
|
this.wrapV = Texture.CLAMP_ADDRESSMODE;
|
|
46
47
|
this._waitingForData = !!waitDataToBeReady && !data;
|
|
@@ -50,7 +51,15 @@ export class RawTexture extends Texture {
|
|
|
50
51
|
* @param data Define the new data of the texture
|
|
51
52
|
*/
|
|
52
53
|
update(data) {
|
|
53
|
-
this.
|
|
54
|
+
this.updateMipLevel(data, 0);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Updates a specific mip level of the texture.
|
|
58
|
+
* @param data The new data for the mip level
|
|
59
|
+
* @param mipLevel The mip level to update (0 is the base level)
|
|
60
|
+
*/
|
|
61
|
+
updateMipLevel(data, mipLevel) {
|
|
62
|
+
this._getEngine().updateRawTexture(this._texture, data, this._texture.format, this._texture.invertY, null, this._texture.type, this._texture._useSRGBBuffer, mipLevel);
|
|
54
63
|
this._waitingForData = false;
|
|
55
64
|
}
|
|
56
65
|
/**
|