@babylonjs/core 5.6.0 → 5.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Animations/animation.js +2 -1
- package/Animations/animation.js.map +1 -1
- package/Animations/easing.d.ts +14 -14
- package/Animations/easing.js +13 -13
- package/Animations/easing.js.map +1 -1
- package/Cameras/Inputs/freeCameraTouchInput.js +2 -2
- package/Cameras/Inputs/freeCameraTouchInput.js.map +1 -1
- package/DeviceInput/InputDevices/webDeviceInputSystem.js +1 -1
- package/DeviceInput/InputDevices/webDeviceInputSystem.js.map +1 -1
- package/Engines/Extensions/engine.dynamicBuffer.js +7 -5
- package/Engines/Extensions/engine.dynamicBuffer.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.js +10 -1
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/Extensions/engine.rawTexture.d.ts +4 -2
- package/Engines/Extensions/engine.rawTexture.js +7 -4
- package/Engines/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/Native/nativeInterfaces.d.ts +2 -0
- package/Engines/Native/nativeInterfaces.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.computeShader.js +3 -1
- package/Engines/WebGPU/Extensions/engine.computeShader.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.dynamicBuffer.js +3 -21
- package/Engines/WebGPU/Extensions/engine.dynamicBuffer.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.js +7 -0
- package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.rawTexture.js +7 -3
- package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuConstants.d.ts +8 -2
- package/Engines/WebGPU/webgpuConstants.js +15 -8
- package/Engines/WebGPU/webgpuConstants.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +4 -0
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/constants.d.ts +2 -0
- package/Engines/constants.js +2 -0
- package/Engines/constants.js.map +1 -1
- package/Engines/engine.d.ts +59 -51
- package/Engines/engine.js +2 -2
- package/Engines/engine.js.map +1 -1
- package/Engines/engineCapabilities.d.ts +2 -0
- package/Engines/engineCapabilities.js.map +1 -1
- package/Engines/engineFactory.d.ts +2 -2
- package/Engines/engineFactory.js.map +1 -1
- package/Engines/nativeEngine.d.ts +4 -4
- package/Engines/nativeEngine.js +12 -7
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.d.ts +4 -2
- package/Engines/nullEngine.js +9 -2
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/thinEngine.d.ts +1 -0
- package/Engines/thinEngine.js +43 -5
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +3 -8
- package/Engines/webgpuEngine.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.js +5 -0
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +1 -0
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Materials/Background/backgroundMaterial.js +1 -1
- package/Materials/Background/backgroundMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Dual/index.d.ts +0 -1
- package/Materials/Node/Blocks/Dual/index.js +0 -1
- package/Materials/Node/Blocks/Dual/index.js.map +1 -1
- package/Materials/Node/Blocks/{Dual → Fragment}/TBNBlock.d.ts +0 -0
- package/Materials/Node/Blocks/{Dual → Fragment}/TBNBlock.js +4 -4
- package/Materials/Node/Blocks/Fragment/TBNBlock.js.map +1 -0
- package/Materials/Node/Blocks/Fragment/index.d.ts +1 -0
- package/Materials/Node/Blocks/Fragment/index.js +1 -0
- package/Materials/Node/Blocks/Fragment/index.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.js +7 -0
- package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js +1 -1
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js +1 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +4 -2
- package/Materials/Node/nodeMaterial.js +13 -5
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +2 -2
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/internalTexture.js +1 -1
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/multiRenderTarget.d.ts +4 -0
- package/Materials/Textures/multiRenderTarget.js +16 -3
- package/Materials/Textures/multiRenderTarget.js.map +1 -1
- package/Materials/Textures/rawTexture.d.ts +10 -4
- package/Materials/Textures/rawTexture.js +20 -9
- package/Materials/Textures/rawTexture.js.map +1 -1
- package/Materials/shaderMaterial.js +2 -1
- package/Materials/shaderMaterial.js.map +1 -1
- package/Materials/standardMaterial.js +7 -2
- package/Materials/standardMaterial.js.map +1 -1
- package/Maths/math.vector.js +5 -5
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/Builders/groundBuilder.d.ts +1 -1
- package/Meshes/Builders/groundBuilder.js.map +1 -1
- package/Meshes/Builders/linesBuilder.js +4 -0
- package/Meshes/Builders/linesBuilder.js.map +1 -1
- package/Meshes/abstractMesh.d.ts +15 -5
- package/Meshes/abstractMesh.js +46 -27
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/instancedMesh.js +1 -0
- package/Meshes/instancedMesh.js.map +1 -1
- package/Meshes/mesh.d.ts +1 -1
- package/Meshes/mesh.js +60 -32
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/subMesh.js +1 -1
- package/Meshes/subMesh.js.map +1 -1
- package/Morph/morphTargetManager.js +2 -1
- package/Morph/morphTargetManager.js.map +1 -1
- package/Particles/particleHelper.js +3 -2
- package/Particles/particleHelper.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.d.ts +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
- package/PostProcesses/depthOfFieldBlurPostProcess.d.ts +1 -1
- package/PostProcesses/depthOfFieldBlurPostProcess.js +2 -4
- package/PostProcesses/depthOfFieldBlurPostProcess.js.map +1 -1
- package/Shaders/ShadersInclude/defaultFragmentDeclaration.js +1 -1
- package/Shaders/ShadersInclude/defaultFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockAlbedoOpacity.js +1 -1
- package/Shaders/ShadersInclude/pbrBlockAlbedoOpacity.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockClearcoat.js +1 -1
- package/Shaders/ShadersInclude/pbrBlockClearcoat.js.map +1 -1
- package/Shaders/ShadersInclude/vertexColorMixing.js +1 -1
- package/Shaders/ShadersInclude/vertexColorMixing.js.map +1 -1
- package/Shaders/default.fragment.js +1 -1
- package/Shaders/default.fragment.js.map +1 -1
- package/Sprites/spriteManager.js +2 -1
- package/Sprites/spriteManager.js.map +1 -1
- package/XR/features/WebXRControllerPointerSelection.js +1 -1
- package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +1 -1
- package/scene.js.map +1 -1
- package/Materials/Node/Blocks/Dual/TBNBlock.js.map +0 -1
|
@@ -104,4 +104,6 @@ export interface EngineCapabilities {
|
|
|
104
104
|
supportTransformFeedbacks: boolean;
|
|
105
105
|
/** Defines if texture max level are supported */
|
|
106
106
|
textureMaxLevel: boolean;
|
|
107
|
+
/** Defines the maximum layer count for a 2D Texture array. */
|
|
108
|
+
texture2DArrayMaxLayerCount: number;
|
|
107
109
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engineCapabilities.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Engines/engineCapabilities.ts"],"names":[],"mappings":"","sourcesContent":["/**\r\n * Interface used to describe the capabilities of the engine relatively to the current browser\r\n */\r\nexport interface EngineCapabilities {\r\n /** Maximum textures units per fragment shader */\r\n maxTexturesImageUnits: number;\r\n /** Maximum texture units per vertex shader */\r\n maxVertexTextureImageUnits: number;\r\n /** Maximum textures units in the entire pipeline */\r\n maxCombinedTexturesImageUnits: number;\r\n /** Maximum texture size */\r\n maxTextureSize: number;\r\n /** Maximum texture samples */\r\n maxSamples?: number;\r\n /** Maximum cube texture size */\r\n maxCubemapTextureSize: number;\r\n /** Maximum render texture size */\r\n maxRenderTextureSize: number;\r\n /** Maximum number of vertex attributes */\r\n maxVertexAttribs: number;\r\n /** Maximum number of varyings */\r\n maxVaryingVectors: number;\r\n /** Maximum number of uniforms per vertex shader */\r\n maxVertexUniformVectors: number;\r\n /** Maximum number of uniforms per fragment shader */\r\n maxFragmentUniformVectors: number;\r\n /** Defines if standard derivatives (dx/dy) are supported */\r\n standardDerivatives: boolean;\r\n /** Defines if s3tc texture compression is supported */\r\n s3tc?: WEBGL_compressed_texture_s3tc;\r\n /** Defines if s3tc sRGB texture compression is supported */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n s3tc_srgb?: WEBGL_compressed_texture_s3tc_srgb;\r\n /** Defines if pvrtc texture compression is supported */\r\n pvrtc: any; //WEBGL_compressed_texture_pvrtc;\r\n /** Defines if etc1 texture compression is supported */\r\n etc1: any; //WEBGL_compressed_texture_etc1;\r\n /** Defines if etc2 texture compression is supported */\r\n etc2: any; //WEBGL_compressed_texture_etc;\r\n /** Defines if astc texture compression is supported */\r\n astc: any; //WEBGL_compressed_texture_astc;\r\n /** Defines if bptc texture compression is supported */\r\n bptc: any; //EXT_texture_compression_bptc;\r\n /** Defines if float textures are supported */\r\n textureFloat: boolean;\r\n /** Defines if vertex array objects are supported */\r\n vertexArrayObject: boolean;\r\n /** Gets the webgl extension for anisotropic filtering (null if not supported) */\r\n textureAnisotropicFilterExtension?: EXT_texture_filter_anisotropic;\r\n /** Gets the maximum level of anisotropy supported */\r\n maxAnisotropy: number;\r\n /** Defines if instancing is supported */\r\n instancedArrays: boolean;\r\n /** Defines if 32 bits indices are supported */\r\n uintIndices: boolean;\r\n /** Defines if high precision shaders are supported */\r\n highPrecisionShaderSupported: boolean;\r\n /** Defines if depth reading in the fragment shader is supported */\r\n fragmentDepthSupported: boolean;\r\n /** Defines if float texture linear filtering is supported*/\r\n textureFloatLinearFiltering: boolean;\r\n /** Defines if rendering to float textures is supported */\r\n textureFloatRender: boolean;\r\n /** Defines if half float textures are supported*/\r\n textureHalfFloat: boolean;\r\n /** Defines if half float texture linear filtering is supported*/\r\n textureHalfFloatLinearFiltering: boolean;\r\n /** Defines if rendering to half float textures is supported */\r\n textureHalfFloatRender: boolean;\r\n /** Defines if textureLOD shader command is supported */\r\n textureLOD: boolean;\r\n /** Defines if draw buffers extension is supported */\r\n drawBuffersExtension: boolean;\r\n /** Defines if depth textures are supported */\r\n depthTextureExtension: boolean;\r\n /** Defines if float color buffer are supported */\r\n colorBufferFloat: boolean;\r\n /** Gets disjoint timer query extension (null if not supported) */\r\n timerQuery?: EXT_disjoint_timer_query;\r\n /** Defines if timestamp can be used with timer query */\r\n canUseTimestampForTimerQuery: boolean;\r\n /** Defines if occlusion queries are supported by the engine */\r\n supportOcclusionQuery: boolean;\r\n /** Defines if multiview is supported (https://www.khronos.org/registry/webgl/extensions/WEBGL_multiview/) */\r\n multiview?: any;\r\n /** Defines if oculus multiview is supported (https://developer.oculus.com/documentation/oculus-browser/latest/concepts/browser-multiview/) */\r\n oculusMultiview?: any;\r\n /** Function used to let the system compiles shaders in background */\r\n parallelShaderCompile?: {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n COMPLETION_STATUS_KHR: number;\r\n };\r\n /** Max number of texture samples for MSAA */\r\n maxMSAASamples: number;\r\n /** Defines if the blend min max extension is supported */\r\n blendMinMax: boolean;\r\n /** In some iOS + WebGL1, gl_InstanceID (and gl_InstanceIDEXT) is undefined even if instancedArrays is true. So don't use gl_InstanceID in those cases */\r\n canUseGLInstanceID: boolean;\r\n /** Defines if gl_vertexID is available */\r\n canUseGLVertexID: boolean;\r\n /** Defines if compute shaders are supported by the engine */\r\n supportComputeShaders: boolean;\r\n /** Defines if sRGB texture formats are supported */\r\n supportSRGBBuffers: boolean;\r\n /** Defines if transform feedbacks are supported */\r\n supportTransformFeedbacks: boolean;\r\n /** Defines if texture max level are supported */\r\n textureMaxLevel: boolean;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"engineCapabilities.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Engines/engineCapabilities.ts"],"names":[],"mappings":"","sourcesContent":["/**\r\n * Interface used to describe the capabilities of the engine relatively to the current browser\r\n */\r\nexport interface EngineCapabilities {\r\n /** Maximum textures units per fragment shader */\r\n maxTexturesImageUnits: number;\r\n /** Maximum texture units per vertex shader */\r\n maxVertexTextureImageUnits: number;\r\n /** Maximum textures units in the entire pipeline */\r\n maxCombinedTexturesImageUnits: number;\r\n /** Maximum texture size */\r\n maxTextureSize: number;\r\n /** Maximum texture samples */\r\n maxSamples?: number;\r\n /** Maximum cube texture size */\r\n maxCubemapTextureSize: number;\r\n /** Maximum render texture size */\r\n maxRenderTextureSize: number;\r\n /** Maximum number of vertex attributes */\r\n maxVertexAttribs: number;\r\n /** Maximum number of varyings */\r\n maxVaryingVectors: number;\r\n /** Maximum number of uniforms per vertex shader */\r\n maxVertexUniformVectors: number;\r\n /** Maximum number of uniforms per fragment shader */\r\n maxFragmentUniformVectors: number;\r\n /** Defines if standard derivatives (dx/dy) are supported */\r\n standardDerivatives: boolean;\r\n /** Defines if s3tc texture compression is supported */\r\n s3tc?: WEBGL_compressed_texture_s3tc;\r\n /** Defines if s3tc sRGB texture compression is supported */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n s3tc_srgb?: WEBGL_compressed_texture_s3tc_srgb;\r\n /** Defines if pvrtc texture compression is supported */\r\n pvrtc: any; //WEBGL_compressed_texture_pvrtc;\r\n /** Defines if etc1 texture compression is supported */\r\n etc1: any; //WEBGL_compressed_texture_etc1;\r\n /** Defines if etc2 texture compression is supported */\r\n etc2: any; //WEBGL_compressed_texture_etc;\r\n /** Defines if astc texture compression is supported */\r\n astc: any; //WEBGL_compressed_texture_astc;\r\n /** Defines if bptc texture compression is supported */\r\n bptc: any; //EXT_texture_compression_bptc;\r\n /** Defines if float textures are supported */\r\n textureFloat: boolean;\r\n /** Defines if vertex array objects are supported */\r\n vertexArrayObject: boolean;\r\n /** Gets the webgl extension for anisotropic filtering (null if not supported) */\r\n textureAnisotropicFilterExtension?: EXT_texture_filter_anisotropic;\r\n /** Gets the maximum level of anisotropy supported */\r\n maxAnisotropy: number;\r\n /** Defines if instancing is supported */\r\n instancedArrays: boolean;\r\n /** Defines if 32 bits indices are supported */\r\n uintIndices: boolean;\r\n /** Defines if high precision shaders are supported */\r\n highPrecisionShaderSupported: boolean;\r\n /** Defines if depth reading in the fragment shader is supported */\r\n fragmentDepthSupported: boolean;\r\n /** Defines if float texture linear filtering is supported*/\r\n textureFloatLinearFiltering: boolean;\r\n /** Defines if rendering to float textures is supported */\r\n textureFloatRender: boolean;\r\n /** Defines if half float textures are supported*/\r\n textureHalfFloat: boolean;\r\n /** Defines if half float texture linear filtering is supported*/\r\n textureHalfFloatLinearFiltering: boolean;\r\n /** Defines if rendering to half float textures is supported */\r\n textureHalfFloatRender: boolean;\r\n /** Defines if textureLOD shader command is supported */\r\n textureLOD: boolean;\r\n /** Defines if draw buffers extension is supported */\r\n drawBuffersExtension: boolean;\r\n /** Defines if depth textures are supported */\r\n depthTextureExtension: boolean;\r\n /** Defines if float color buffer are supported */\r\n colorBufferFloat: boolean;\r\n /** Gets disjoint timer query extension (null if not supported) */\r\n timerQuery?: EXT_disjoint_timer_query;\r\n /** Defines if timestamp can be used with timer query */\r\n canUseTimestampForTimerQuery: boolean;\r\n /** Defines if occlusion queries are supported by the engine */\r\n supportOcclusionQuery: boolean;\r\n /** Defines if multiview is supported (https://www.khronos.org/registry/webgl/extensions/WEBGL_multiview/) */\r\n multiview?: any;\r\n /** Defines if oculus multiview is supported (https://developer.oculus.com/documentation/oculus-browser/latest/concepts/browser-multiview/) */\r\n oculusMultiview?: any;\r\n /** Function used to let the system compiles shaders in background */\r\n parallelShaderCompile?: {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n COMPLETION_STATUS_KHR: number;\r\n };\r\n /** Max number of texture samples for MSAA */\r\n maxMSAASamples: number;\r\n /** Defines if the blend min max extension is supported */\r\n blendMinMax: boolean;\r\n /** In some iOS + WebGL1, gl_InstanceID (and gl_InstanceIDEXT) is undefined even if instancedArrays is true. So don't use gl_InstanceID in those cases */\r\n canUseGLInstanceID: boolean;\r\n /** Defines if gl_vertexID is available */\r\n canUseGLVertexID: boolean;\r\n /** Defines if compute shaders are supported by the engine */\r\n supportComputeShaders: boolean;\r\n /** Defines if sRGB texture formats are supported */\r\n supportSRGBBuffers: boolean;\r\n /** Defines if transform feedbacks are supported */\r\n supportTransformFeedbacks: boolean;\r\n /** Defines if texture max level are supported */\r\n textureMaxLevel: boolean;\r\n\r\n /** Defines the maximum layer count for a 2D Texture array. */\r\n texture2DArrayMaxLayerCount: number;\r\n}\r\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Engine } from "./engine";
|
|
2
2
|
/**
|
|
3
3
|
* Helper class to create the best engine depending on the current hardware
|
|
4
4
|
*/
|
|
@@ -9,5 +9,5 @@ export declare class EngineFactory {
|
|
|
9
9
|
* @param options Defines the options passed to the engine to create the context dependencies
|
|
10
10
|
* @returns a promise that resolves with the created engine
|
|
11
11
|
*/
|
|
12
|
-
static CreateAsync(canvas: HTMLCanvasElement, options: any): Promise<
|
|
12
|
+
static CreateAsync(canvas: HTMLCanvasElement, options: any): Promise<Engine>;
|
|
13
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engineFactory.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Engines/engineFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"engineFactory.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Engines/engineFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;GAEG;AACH;IAAA;IAqBA,CAAC;IApBG;;;;;OAKG;IACW,yBAAW,GAAzB,UAA0B,MAAyB,EAAE,OAAY;QAC7D,OAAO,YAAY,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAC,SAAS;YAChD,IAAI,SAAS,EAAE;gBACX,OAAO,YAAY,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;aACpD;iBAAM,IAAI,MAAM,CAAC,WAAW,EAAE;gBAC3B,OAAO,IAAI,OAAO,CAAC,UAAC,OAAO;oBACvB,OAAO,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;gBACpD,CAAC,CAAC,CAAC;aACN;YACD,OAAO,IAAI,OAAO,CAAC,UAAC,OAAO;gBACvB,OAAO,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;YACrC,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IACL,oBAAC;AAAD,CAAC,AArBD,IAqBC","sourcesContent":["import { Engine } from \"./engine\";\r\nimport { NullEngine } from \"./nullEngine\";\r\nimport { WebGPUEngine } from \"./webgpuEngine\";\r\n\r\n/**\r\n * Helper class to create the best engine depending on the current hardware\r\n */\r\nexport class EngineFactory {\r\n /**\r\n * Creates an engine based on the capabilities of the underlying hardware\r\n * @param canvas Defines the canvas to use to display the result\r\n * @param options Defines the options passed to the engine to create the context dependencies\r\n * @returns a promise that resolves with the created engine\r\n */\r\n public static CreateAsync(canvas: HTMLCanvasElement, options: any): Promise<Engine> {\r\n return WebGPUEngine.IsSupportedAsync.then((supported) => {\r\n if (supported) {\r\n return WebGPUEngine.CreateAsync(canvas, options);\r\n } else if (Engine.IsSupported) {\r\n return new Promise((resolve) => {\r\n resolve(new Engine(canvas, undefined, options));\r\n });\r\n }\r\n return new Promise((resolve) => {\r\n resolve(new NullEngine(options));\r\n });\r\n });\r\n }\r\n}\r\n"]}
|
|
@@ -351,9 +351,9 @@ export declare class NativeEngine extends Engine {
|
|
|
351
351
|
createDynamicTexture(width: number, height: number, generateMipMaps: boolean, samplingMode: number): InternalTexture;
|
|
352
352
|
createVideoElement(constraints: MediaTrackConstraints): any;
|
|
353
353
|
updateVideoTexture(texture: Nullable<InternalTexture>, video: HTMLVideoElement, invertY: boolean): void;
|
|
354
|
-
createRawTexture(data: Nullable<ArrayBufferView>, width: number, height: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression?: Nullable<string>, type?: number): InternalTexture;
|
|
354
|
+
createRawTexture(data: Nullable<ArrayBufferView>, width: number, height: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression?: Nullable<string>, type?: number, creationFlags?: number, useSRGBBuffer?: boolean): InternalTexture;
|
|
355
355
|
createRawTexture2DArray(data: Nullable<ArrayBufferView>, width: number, height: number, depth: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression?: Nullable<string>, textureType?: number): InternalTexture;
|
|
356
|
-
updateRawTexture(texture: Nullable<InternalTexture>, bufferView: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression?: Nullable<string>, type?: number): void;
|
|
356
|
+
updateRawTexture(texture: Nullable<InternalTexture>, bufferView: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression?: Nullable<string>, type?: number, useSRGBBuffer?: boolean): void;
|
|
357
357
|
/**
|
|
358
358
|
* Usually called from Texture.ts.
|
|
359
359
|
* Passed information to create a WebGLTexture
|
|
@@ -373,8 +373,8 @@ export declare class NativeEngine extends Engine {
|
|
|
373
373
|
* @param forcedExtension defines the extension to use to pick the right loader
|
|
374
374
|
* @param mimeType defines an optional mime type
|
|
375
375
|
* @param loaderOptions options to be passed to the loader
|
|
376
|
-
* @param creationFlags
|
|
377
|
-
* @param useSRGBBuffer
|
|
376
|
+
* @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
|
|
377
|
+
* @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
|
|
378
378
|
* @returns a InternalTexture for assignment back into BABYLON.Texture
|
|
379
379
|
*/
|
|
380
380
|
createTexture(url: Nullable<string>, noMipmap: boolean, invertY: boolean, scene: Nullable<ISceneLike>, samplingMode?: number, onLoad?: Nullable<() => void>, onError?: Nullable<(message: string, exception: any) => void>, buffer?: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob | ImageBitmap>, fallback?: Nullable<InternalTexture>, format?: Nullable<number>, forcedExtension?: Nullable<string>, mimeType?: string, loaderOptions?: any, creationFlags?: number, useSRGBBuffer?: boolean): InternalTexture;
|
package/Engines/nativeEngine.js
CHANGED
|
@@ -710,7 +710,7 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
|
710
710
|
maxTexturesImageUnits: 16,
|
|
711
711
|
maxVertexTextureImageUnits: 16,
|
|
712
712
|
maxCombinedTexturesImageUnits: 32,
|
|
713
|
-
maxTextureSize:
|
|
713
|
+
maxTextureSize: _native.Engine.CAPS_LIMITS_MAX_TEXTURE_SIZE,
|
|
714
714
|
maxCubemapTextureSize: 512,
|
|
715
715
|
maxRenderTextureSize: 512,
|
|
716
716
|
maxVertexAttribs: 16,
|
|
@@ -749,6 +749,7 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
|
749
749
|
supportSRGBBuffers: true,
|
|
750
750
|
supportTransformFeedbacks: false,
|
|
751
751
|
textureMaxLevel: false,
|
|
752
|
+
texture2DArrayMaxLayerCount: _native.Engine.CAPS_LIMITS_MAX_TEXTURE_LAYERS,
|
|
752
753
|
};
|
|
753
754
|
_this._features = {
|
|
754
755
|
forceBitmapOverHTMLImageElement: false,
|
|
@@ -1755,9 +1756,11 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
|
1755
1756
|
this._camera.updateVideoTexture(webGLTexture, video, invertY);
|
|
1756
1757
|
}
|
|
1757
1758
|
};
|
|
1758
|
-
NativeEngine.prototype.createRawTexture = function (data, width, height, format, generateMipMaps, invertY, samplingMode, compression, type) {
|
|
1759
|
+
NativeEngine.prototype.createRawTexture = function (data, width, height, format, generateMipMaps, invertY, samplingMode, compression, type, creationFlags, useSRGBBuffer) {
|
|
1759
1760
|
if (compression === void 0) { compression = null; }
|
|
1760
1761
|
if (type === void 0) { type = 0; }
|
|
1762
|
+
if (creationFlags === void 0) { creationFlags = 0; }
|
|
1763
|
+
if (useSRGBBuffer === void 0) { useSRGBBuffer = false; }
|
|
1761
1764
|
var texture = new InternalTexture(this, InternalTextureSource.Raw);
|
|
1762
1765
|
texture.format = format;
|
|
1763
1766
|
texture.generateMipMaps = generateMipMaps;
|
|
@@ -1769,7 +1772,8 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
|
1769
1772
|
texture.height = texture.baseHeight;
|
|
1770
1773
|
texture._compression = compression;
|
|
1771
1774
|
texture.type = type;
|
|
1772
|
-
this.
|
|
1775
|
+
texture._useSRGBBuffer = this._getUseSRGBBuffer(useSRGBBuffer, !generateMipMaps);
|
|
1776
|
+
this.updateRawTexture(texture, data, format, invertY, compression, type, texture._useSRGBBuffer);
|
|
1773
1777
|
if (texture._hardwareTexture) {
|
|
1774
1778
|
var webGLTexture = texture._hardwareTexture.underlyingResource;
|
|
1775
1779
|
var filter = this._getNativeSamplingMode(samplingMode);
|
|
@@ -1803,9 +1807,10 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
|
1803
1807
|
this._internalTexturesCache.push(texture);
|
|
1804
1808
|
return texture;
|
|
1805
1809
|
};
|
|
1806
|
-
NativeEngine.prototype.updateRawTexture = function (texture, bufferView, format, invertY, compression, type) {
|
|
1810
|
+
NativeEngine.prototype.updateRawTexture = function (texture, bufferView, format, invertY, compression, type, useSRGBBuffer) {
|
|
1807
1811
|
if (compression === void 0) { compression = null; }
|
|
1808
1812
|
if (type === void 0) { type = 0; }
|
|
1813
|
+
if (useSRGBBuffer === void 0) { useSRGBBuffer = false; }
|
|
1809
1814
|
if (!texture) {
|
|
1810
1815
|
return;
|
|
1811
1816
|
}
|
|
@@ -1835,8 +1840,8 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
|
1835
1840
|
* @param forcedExtension defines the extension to use to pick the right loader
|
|
1836
1841
|
* @param mimeType defines an optional mime type
|
|
1837
1842
|
* @param loaderOptions options to be passed to the loader
|
|
1838
|
-
* @param creationFlags
|
|
1839
|
-
* @param useSRGBBuffer
|
|
1843
|
+
* @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
|
|
1844
|
+
* @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
|
|
1840
1845
|
* @returns a InternalTexture for assignment back into BABYLON.Texture
|
|
1841
1846
|
*/
|
|
1842
1847
|
NativeEngine.prototype.createTexture = function (url, noMipmap, invertY, scene, samplingMode, onLoad, onError, buffer, fallback, format, forcedExtension, mimeType, loaderOptions, creationFlags, useSRGBBuffer) {
|
|
@@ -2694,7 +2699,7 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
|
2694
2699
|
return result;
|
|
2695
2700
|
};
|
|
2696
2701
|
// This must match the protocol version in NativeEngine.cpp
|
|
2697
|
-
NativeEngine.PROTOCOL_VERSION =
|
|
2702
|
+
NativeEngine.PROTOCOL_VERSION = 6;
|
|
2698
2703
|
return NativeEngine;
|
|
2699
2704
|
}(Engine));
|
|
2700
2705
|
export { NativeEngine };
|