@babylonjs/core 7.38.0 → 7.39.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/Cameras/targetCamera.js +6 -0
- package/Cameras/targetCamera.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Lights/spotLight.d.ts +7 -0
- package/Lights/spotLight.js +27 -0
- package/Lights/spotLight.js.map +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.js +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/Textures/Loaders/exrTextureLoader.d.ts +1 -0
- package/Materials/Textures/Loaders/exrTextureLoader.js +1 -0
- package/Materials/Textures/Loaders/exrTextureLoader.js.map +1 -1
- package/Materials/Textures/Loaders/hdrTextureLoader.d.ts +1 -0
- package/Materials/Textures/Loaders/hdrTextureLoader.js +2 -1
- package/Materials/Textures/Loaders/hdrTextureLoader.js.map +1 -1
- package/Materials/Textures/Loaders/iesTextureLoader.js +1 -1
- package/Materials/Textures/Loaders/iesTextureLoader.js.map +1 -1
- package/Materials/material.d.ts +1 -4
- package/Materials/material.js +26 -23
- package/Materials/material.js.map +1 -1
- package/Materials/materialHelper.functions.d.ts +2 -1
- package/Materials/materialHelper.functions.js +6 -2
- package/Materials/materialHelper.functions.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +5 -3
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +13 -14
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/abstractMesh.js +7 -0
- package/Meshes/abstractMesh.js.map +1 -1
- package/Physics/v2/characterController.d.ts +327 -0
- package/Physics/v2/characterController.js +1236 -0
- package/Physics/v2/characterController.js.map +1 -0
- package/Physics/v2/index.d.ts +1 -0
- package/Physics/v2/index.js +1 -0
- package/Physics/v2/index.js.map +1 -1
- package/Rendering/objectRenderer.js +8 -0
- package/Rendering/objectRenderer.js.map +1 -1
- package/Shaders/ShadersInclude/lightFragment.js +28 -4
- package/Shaders/ShadersInclude/lightFragment.js.map +1 -1
- package/Shaders/ShadersInclude/lightFragmentDeclaration.js +3 -0
- package/Shaders/ShadersInclude/lightFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/lightUboDeclaration.js +3 -0
- package/Shaders/ShadersInclude/lightUboDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/lightsFragmentFunctions.js +20 -3
- package/Shaders/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrDirectLightingFalloffFunctions.js +2 -0
- package/Shaders/ShadersInclude/pbrDirectLightingFalloffFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/fogVertex.js +4 -0
- package/ShadersWGSL/ShadersInclude/fogVertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/lightFragment.js +28 -4
- package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/lightUboDeclaration.js +3 -0
- package/ShadersWGSL/ShadersInclude/lightUboDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js +16 -3
- package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFalloffFunctions.js +2 -0
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFalloffFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/sceneUboDeclaration.js +3 -1
- package/ShadersWGSL/ShadersInclude/sceneUboDeclaration.js.map +1 -1
- package/package.json +1 -1
|
@@ -25,6 +25,7 @@ export declare class _ExrTextureLoader implements IInternalTextureLoader {
|
|
|
25
25
|
* @param _createPolynomials will be true if polynomials have been requested
|
|
26
26
|
* @param _onLoad defines the callback to trigger once the texture is ready
|
|
27
27
|
* @param _onError defines the callback to trigger in case of error
|
|
28
|
+
* Cube texture are not supported by .exr files
|
|
28
29
|
*/
|
|
29
30
|
loadCubeData(_data: ArrayBufferView | ArrayBufferView[], _texture: InternalTexture, _createPolynomials: boolean, _onLoad: Nullable<(data?: any) => void>, _onError: Nullable<(message?: string, exception?: any) => void>): void;
|
|
30
31
|
/**
|
|
@@ -87,6 +87,7 @@ export class _ExrTextureLoader {
|
|
|
87
87
|
* @param _createPolynomials will be true if polynomials have been requested
|
|
88
88
|
* @param _onLoad defines the callback to trigger once the texture is ready
|
|
89
89
|
* @param _onError defines the callback to trigger in case of error
|
|
90
|
+
* Cube texture are not supported by .exr files
|
|
90
91
|
*/
|
|
91
92
|
loadCubeData(_data, _texture, _createPolynomials, _onLoad, _onError) {
|
|
92
93
|
// eslint-disable-next-line no-throw-literal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exrTextureLoader.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Textures/Loaders/exrTextureLoader.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAE7E;;;;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;;;;;;GAMG;AACH,gEAAgE;AAChE,MAAM,OAAO,iBAAiB;IAA9B;QACI;;WAEG;QACa,oBAAe,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"exrTextureLoader.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Textures/Loaders/exrTextureLoader.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAE7E;;;;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;AAC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Q,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QAE5C,mBAAmB;QACnB,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC,CAAC;QAClE,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC,CAAC;QACnE,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,eAAe,EAAE,KAAK,EAAE,GAAG,EAAE;YACzD,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;YACnC,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;YAC/B,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC;YACnC,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;YACxB,OAAO,CAAC,WAAW,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC;YAC1C,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;gBACpB,MAAM,CAAC,4BAA4B,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;YAC3F,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport type { InternalTexture } from \"../internalTexture\";\r\nimport type { IInternalTextureLoader } from \"./internalTextureLoader\";\r\nimport { GetExrHeader } from \"./EXR/exrLoader.header\";\r\nimport { CreateDecoderAsync, ScanData } from \"./EXR/exrLoader.decoder\";\r\nimport { ExrLoaderGlobalConfiguration } from \"./EXR/exrLoader.configuration\";\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\n/**\r\n * Loader for .exr file format\r\n * #4RN0VF#151: PIZ compression\r\n * #4RN0VF#146: ZIP compression\r\n * #4RN0VF#149: RLE compression\r\n * #4RN0VF#150: PXR24 compression\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport class _ExrTextureLoader implements IInternalTextureLoader {\r\n /**\r\n * Defines whether the loader supports cascade loading the different faces.\r\n */\r\n public readonly supportCascades = false;\r\n\r\n /**\r\n * Uploads the cube texture data to the WebGL texture. It has already been bound.\r\n * @param _data contains the texture data\r\n * @param _texture defines the BabylonJS internal texture\r\n * @param _createPolynomials will be true if polynomials have been requested\r\n * @param _onLoad defines the callback to trigger once the texture is ready\r\n * @param _onError defines the callback to trigger in case of error\r\n * Cube texture are not supported by .exr files\r\n */\r\n public loadCubeData(\r\n _data: ArrayBufferView | ArrayBufferView[],\r\n _texture: InternalTexture,\r\n _createPolynomials: boolean,\r\n _onLoad: Nullable<(data?: any) => void>,\r\n _onError: Nullable<(message?: string, exception?: any) => void>\r\n ): void {\r\n // eslint-disable-next-line no-throw-literal\r\n throw \".exr not supported in Cube.\";\r\n }\r\n\r\n /**\r\n * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.\r\n * @param data contains the texture data\r\n * @param texture defines the BabylonJS internal texture\r\n * @param callback defines the method to call once ready to upload\r\n */\r\n public async loadData(\r\n data: ArrayBufferView,\r\n texture: InternalTexture,\r\n callback: (width: number, height: number, loadMipmap: boolean, isCompressed: boolean, done: () => void, failedLoading?: boolean) => void\r\n ) {\r\n const dataView = new DataView(data.buffer);\r\n\r\n const offset = { value: 0 };\r\n const header = GetExrHeader(dataView, offset);\r\n const decoder = await CreateDecoderAsync(header, dataView, offset, ExrLoaderGlobalConfiguration.DefaultOutputType);\r\n\r\n ScanData(decoder, header, dataView, offset);\r\n\r\n // Updating texture\r\n const width = header.dataWindow.xMax - header.dataWindow.xMin + 1;\r\n const height = header.dataWindow.yMax - header.dataWindow.yMin + 1;\r\n callback(width, height, texture.generateMipMaps, false, () => {\r\n const engine = texture.getEngine();\r\n texture.format = header.format;\r\n texture.type = decoder.textureType;\r\n texture.invertY = false;\r\n texture._gammaSpace = !header.linearSpace;\r\n if (decoder.byteArray) {\r\n engine._uploadDataToTextureDirectly(texture, decoder.byteArray, 0, 0, undefined, true);\r\n }\r\n });\r\n }\r\n}\r\n"]}
|
|
@@ -11,6 +11,7 @@ export declare class _HDRTextureLoader implements IInternalTextureLoader {
|
|
|
11
11
|
readonly supportCascades = false;
|
|
12
12
|
/**
|
|
13
13
|
* Uploads the cube texture data to the WebGL texture. It has already been bound.
|
|
14
|
+
* Cube texture are not supported by .hdr files
|
|
14
15
|
*/
|
|
15
16
|
loadCubeData(): void;
|
|
16
17
|
/**
|
|
@@ -14,10 +14,11 @@ export class _HDRTextureLoader {
|
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Uploads the cube texture data to the WebGL texture. It has already been bound.
|
|
17
|
+
* Cube texture are not supported by .hdr files
|
|
17
18
|
*/
|
|
18
19
|
loadCubeData() {
|
|
19
20
|
// eslint-disable-next-line no-throw-literal
|
|
20
|
-
throw ".
|
|
21
|
+
throw ".hdr not supported in Cube.";
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
24
|
* Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hdrTextureLoader.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Textures/Loaders/hdrTextureLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAGtF,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD;;;GAGG;AACH,gEAAgE;AAChE,MAAM,OAAO,iBAAiB;IAA9B;QACI;;WAEG;QACa,oBAAe,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"hdrTextureLoader.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Textures/Loaders/hdrTextureLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAGtF,O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,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,eAAe,EAAE,KAAK,EAAE,GAAG,EAAE;YACzE,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;YACnC,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC,iBAAiB,CAAC;YAC3C,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,kBAAkB,CAAC;YAC9C,OAAO,CAAC,WAAW,GAAG,KAAK,CAAC;YAC5B,MAAM,CAAC,4BAA4B,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;QACnE,CAAC,CAAC,CAAC;IACP,CAAC;CACJ","sourcesContent":["import { RGBE_ReadHeader, RGBE_ReadPixels } from \"../../../Misc/HighDynamicRange/hdr\";\r\nimport type { InternalTexture } from \"../../../Materials/Textures/internalTexture\";\r\nimport type { IInternalTextureLoader } from \"./internalTextureLoader\";\r\nimport { Constants } from \"../../../Engines/constants\";\r\n\r\n/**\r\n * Implementation of the HDR Texture Loader.\r\n * @internal\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport class _HDRTextureLoader implements IInternalTextureLoader {\r\n /**\r\n * Defines whether the loader supports cascade loading the different faces.\r\n */\r\n public readonly supportCascades = false;\r\n\r\n /**\r\n * Uploads the cube texture data to the WebGL texture. It has already been bound.\r\n * Cube texture are not supported by .hdr files\r\n */\r\n public loadCubeData(): void {\r\n // eslint-disable-next-line no-throw-literal\r\n throw \".hdr not supported in Cube.\";\r\n }\r\n\r\n /**\r\n * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.\r\n * @param data contains the texture data\r\n * @param texture defines the BabylonJS internal texture\r\n * @param callback defines the method to call once ready to upload\r\n */\r\n public loadData(\r\n data: ArrayBufferView,\r\n texture: InternalTexture,\r\n callback: (width: number, height: number, loadMipmap: boolean, isCompressed: boolean, done: () => void) => void\r\n ): void {\r\n const uint8array = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);\r\n const hdrInfo = RGBE_ReadHeader(uint8array);\r\n const pixelsDataRGB32 = RGBE_ReadPixels(uint8array, hdrInfo);\r\n\r\n const pixels = hdrInfo.width * hdrInfo.height;\r\n const pixelsDataRGBA32 = new Float32Array(pixels * 4);\r\n for (let i = 0; i < pixels; i += 1) {\r\n pixelsDataRGBA32[i * 4] = pixelsDataRGB32[i * 3];\r\n pixelsDataRGBA32[i * 4 + 1] = pixelsDataRGB32[i * 3 + 1];\r\n pixelsDataRGBA32[i * 4 + 2] = pixelsDataRGB32[i * 3 + 2];\r\n pixelsDataRGBA32[i * 4 + 3] = 1;\r\n }\r\n\r\n callback(hdrInfo.width, hdrInfo.height, texture.generateMipMaps, false, () => {\r\n const engine = texture.getEngine();\r\n texture.type = Constants.TEXTURETYPE_FLOAT;\r\n texture.format = Constants.TEXTUREFORMAT_RGBA;\r\n texture._gammaSpace = false;\r\n engine._uploadDataToTextureDirectly(texture, pixelsDataRGBA32);\r\n });\r\n }\r\n}\r\n"]}
|
|
@@ -28,7 +28,7 @@ export class _IESTextureLoader {
|
|
|
28
28
|
loadData(data, texture, callback) {
|
|
29
29
|
const uint8array = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
|
|
30
30
|
const textureData = LoadIESData(uint8array);
|
|
31
|
-
callback(textureData.width, textureData.height,
|
|
31
|
+
callback(textureData.width, textureData.height, false, false, () => {
|
|
32
32
|
const engine = texture.getEngine();
|
|
33
33
|
texture.type = 1;
|
|
34
34
|
texture.format = 6;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iesTextureLoader.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Textures/Loaders/iesTextureLoader.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,yCAAkC;AAExD;;;GAGG;AACH,gEAAgE;AAChE,MAAM,OAAO,iBAAiB;IAA9B;QACI;;WAEG;QACa,oBAAe,GAAG,KAAK,CAAC;IAiC5C,CAAC;IA/BG;;OAEG;IACI,YAAY;QACf,4CAA4C;QAC5C,MAAM,6BAA6B,CAAC;IACxC,CAAC;IAED;;;;;OAKG;IACI,QAAQ,CACX,IAAqB,EACrB,OAAwB,EACxB,QAA+G;QAE/G,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAEjF,MAAM,WAAW,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;QAE5C,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"iesTextureLoader.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Textures/Loaders/iesTextureLoader.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,yCAAkC;AAExD;;;GAGG;AACH,gEAAgE;AAChE,MAAM,OAAO,iBAAiB;IAA9B;QACI;;WAEG;QACa,oBAAe,GAAG,KAAK,CAAC;IAiC5C,CAAC;IA/BG;;OAEG;IACI,YAAY;QACf,4CAA4C;QAC5C,MAAM,6BAA6B,CAAC;IACxC,CAAC;IAED;;;;;OAKG;IACI,QAAQ,CACX,IAAqB,EACrB,OAAwB,EACxB,QAA+G;QAE/G,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAEjF,MAAM,WAAW,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;QAE5C,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE;YAC/D,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;YACnC,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC,iBAAiB,CAAC;YAC3C,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,eAAe,CAAC;YAC3C,OAAO,CAAC,WAAW,GAAG,KAAK,CAAC;YAC5B,MAAM,CAAC,4BAA4B,CAAC,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;QACnE,CAAC,CAAC,CAAC;IACP,CAAC;CACJ","sourcesContent":["import type { InternalTexture } from \"../internalTexture\";\r\nimport type { IInternalTextureLoader } from \"./internalTextureLoader\";\r\nimport { Constants } from \"../../../Engines/constants\";\r\nimport { LoadIESData } from \"core/Lights/IES/iesLoader\";\r\n\r\n/**\r\n * Implementation of the IES Texture Loader.\r\n * @internal\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport class _IESTextureLoader implements IInternalTextureLoader {\r\n /**\r\n * Defines whether the loader supports cascade loading the different faces.\r\n */\r\n public readonly supportCascades = false;\r\n\r\n /**\r\n * Uploads the cube texture data to the WebGL texture. It has already been bound.\r\n */\r\n public loadCubeData(): void {\r\n // eslint-disable-next-line no-throw-literal\r\n throw \".ies not supported in Cube.\";\r\n }\r\n\r\n /**\r\n * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.\r\n * @param data contains the texture data\r\n * @param texture defines the BabylonJS internal texture\r\n * @param callback defines the method to call once ready to upload\r\n */\r\n public loadData(\r\n data: ArrayBufferView,\r\n texture: InternalTexture,\r\n callback: (width: number, height: number, loadMipmap: boolean, isCompressed: boolean, done: () => void) => void\r\n ): void {\r\n const uint8array = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);\r\n\r\n const textureData = LoadIESData(uint8array);\r\n\r\n callback(textureData.width, textureData.height, false, false, () => {\r\n const engine = texture.getEngine();\r\n texture.type = Constants.TEXTURETYPE_FLOAT;\r\n texture.format = Constants.TEXTUREFORMAT_R;\r\n texture._gammaSpace = false;\r\n engine._uploadDataToTextureDirectly(texture, textureData.data);\r\n });\r\n }\r\n}\r\n"]}
|
package/Materials/material.d.ts
CHANGED
|
@@ -862,10 +862,7 @@ export declare class Material implements IAnimatable, IClipPlanesHolder {
|
|
|
862
862
|
* @param notBoundToMesh specifies if the material that is being disposed is known to be not bound to any mesh
|
|
863
863
|
*/
|
|
864
864
|
dispose(_forceDisposeEffect?: boolean, forceDisposeTextures?: boolean, notBoundToMesh?: boolean): void;
|
|
865
|
-
|
|
866
|
-
* @internal
|
|
867
|
-
*/
|
|
868
|
-
private releaseVertexArrayObject;
|
|
865
|
+
private _disposeMeshResources;
|
|
869
866
|
/**
|
|
870
867
|
* Serializes this material
|
|
871
868
|
* @returns the serialized material object
|
package/Materials/material.js
CHANGED
|
@@ -1252,19 +1252,13 @@ export class Material {
|
|
|
1252
1252
|
if (this.meshMap) {
|
|
1253
1253
|
for (const meshId in this.meshMap) {
|
|
1254
1254
|
const mesh = this.meshMap[meshId];
|
|
1255
|
-
|
|
1256
|
-
this.releaseVertexArrayObject(mesh, true);
|
|
1257
|
-
mesh.material = null; // will set the entry in the map to undefined
|
|
1258
|
-
}
|
|
1255
|
+
this._disposeMeshResources(mesh);
|
|
1259
1256
|
}
|
|
1260
1257
|
}
|
|
1261
1258
|
else {
|
|
1262
1259
|
const meshes = scene.meshes;
|
|
1263
1260
|
for (const mesh of meshes) {
|
|
1264
|
-
|
|
1265
|
-
this.releaseVertexArrayObject(mesh, true);
|
|
1266
|
-
mesh.material = null;
|
|
1267
|
-
}
|
|
1261
|
+
this._disposeMeshResources(mesh);
|
|
1268
1262
|
}
|
|
1269
1263
|
}
|
|
1270
1264
|
}
|
|
@@ -1293,26 +1287,35 @@ export class Material {
|
|
|
1293
1287
|
this._eventInfo = {};
|
|
1294
1288
|
}
|
|
1295
1289
|
}
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
releaseVertexArrayObject(mesh, forceDisposeEffect) {
|
|
1290
|
+
_disposeMeshResources(mesh) {
|
|
1291
|
+
if (!mesh) {
|
|
1292
|
+
return;
|
|
1293
|
+
}
|
|
1301
1294
|
const geometry = mesh.geometry;
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1295
|
+
const materialForRenderPass = mesh._internalAbstractMeshDataInfo._materialForRenderPass;
|
|
1296
|
+
if (this._storeEffectOnSubMeshes) {
|
|
1297
|
+
if (mesh.subMeshes && materialForRenderPass) {
|
|
1298
|
+
for (const subMesh of mesh.subMeshes) {
|
|
1299
|
+
const drawWrappers = subMesh._drawWrappers;
|
|
1300
|
+
for (let renderPassIndex = 0; renderPassIndex < drawWrappers.length; renderPassIndex++) {
|
|
1301
|
+
const effect = drawWrappers[renderPassIndex]?.effect;
|
|
1302
|
+
if (!effect) {
|
|
1303
|
+
continue;
|
|
1304
|
+
}
|
|
1305
|
+
const material = materialForRenderPass[renderPassIndex];
|
|
1306
|
+
if (material === this) {
|
|
1307
|
+
geometry?._releaseVertexArrayObject(effect);
|
|
1308
|
+
subMesh._removeDrawWrapper(renderPassIndex, true, true);
|
|
1309
1309
|
}
|
|
1310
1310
|
}
|
|
1311
1311
|
}
|
|
1312
1312
|
}
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1313
|
+
}
|
|
1314
|
+
else {
|
|
1315
|
+
geometry?._releaseVertexArrayObject(this._drawWrapper.effect);
|
|
1316
|
+
}
|
|
1317
|
+
if (mesh.material === this && !mesh.sourceMesh) {
|
|
1318
|
+
mesh.material = null;
|
|
1316
1319
|
}
|
|
1317
1320
|
}
|
|
1318
1321
|
/**
|