@babylonjs/core 5.16.0 → 5.18.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.
Files changed (175) hide show
  1. package/Animations/animatable.js +1 -1
  2. package/Animations/animatable.js.map +1 -1
  3. package/Animations/animation.d.ts +8 -1
  4. package/Animations/animation.js +8 -1
  5. package/Animations/animation.js.map +1 -1
  6. package/Animations/animationGroup.js +5 -4
  7. package/Animations/animationGroup.js.map +1 -1
  8. package/Bones/skeleton.js +1 -1
  9. package/Bones/skeleton.js.map +1 -1
  10. package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js +2 -2
  11. package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js.map +1 -1
  12. package/Cameras/Inputs/flyCameraKeyboardInput.js +3 -3
  13. package/Cameras/Inputs/flyCameraKeyboardInput.js.map +1 -1
  14. package/Cameras/Inputs/followCameraKeyboardMoveInput.js +2 -2
  15. package/Cameras/Inputs/followCameraKeyboardMoveInput.js.map +1 -1
  16. package/Cameras/Inputs/freeCameraKeyboardMoveInput.js +3 -3
  17. package/Cameras/Inputs/freeCameraKeyboardMoveInput.js.map +1 -1
  18. package/Cameras/Inputs/freeCameraTouchInput.js +1 -1
  19. package/Cameras/Inputs/freeCameraTouchInput.js.map +1 -1
  20. package/Cameras/VR/vrExperienceHelper.js +1 -1
  21. package/Cameras/VR/vrExperienceHelper.js.map +1 -1
  22. package/Cameras/VR/webVRCamera.js +1 -1
  23. package/Cameras/VR/webVRCamera.js.map +1 -1
  24. package/Cameras/camera.js +3 -3
  25. package/Cameras/camera.js.map +1 -1
  26. package/Engines/Extensions/engine.views.d.ts +13 -0
  27. package/Engines/Extensions/engine.views.js +16 -1
  28. package/Engines/Extensions/engine.views.js.map +1 -1
  29. package/Engines/Processors/shaderCodeCursor.js +2 -1
  30. package/Engines/Processors/shaderCodeCursor.js.map +1 -1
  31. package/Engines/WebGPU/webgpuOcclusionQuery.js +1 -1
  32. package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
  33. package/Engines/engine.d.ts +2 -10
  34. package/Engines/engine.js +0 -14
  35. package/Engines/engine.js.map +1 -1
  36. package/Engines/engineFeatures.d.ts +2 -0
  37. package/Engines/engineFeatures.js.map +1 -1
  38. package/Engines/nativeEngine.d.ts +6 -2
  39. package/Engines/nativeEngine.js +13 -6
  40. package/Engines/nativeEngine.js.map +1 -1
  41. package/Engines/nullEngine.js +1 -0
  42. package/Engines/nullEngine.js.map +1 -1
  43. package/Engines/thinEngine.d.ts +10 -0
  44. package/Engines/thinEngine.js +26 -6
  45. package/Engines/thinEngine.js.map +1 -1
  46. package/Engines/webgpuEngine.js +1 -0
  47. package/Engines/webgpuEngine.js.map +1 -1
  48. package/Gizmos/axisDragGizmo.d.ts +11 -8
  49. package/Gizmos/axisDragGizmo.js.map +1 -1
  50. package/Gizmos/axisScaleGizmo.d.ts +20 -13
  51. package/Gizmos/axisScaleGizmo.js.map +1 -1
  52. package/Gizmos/boundingBoxGizmo.d.ts +27 -18
  53. package/Gizmos/boundingBoxGizmo.js +6 -0
  54. package/Gizmos/boundingBoxGizmo.js.map +1 -1
  55. package/Gizmos/cameraGizmo.d.ts +8 -5
  56. package/Gizmos/cameraGizmo.js.map +1 -1
  57. package/Gizmos/gizmo.d.ts +48 -6
  58. package/Gizmos/gizmo.js.map +1 -1
  59. package/Gizmos/gizmoManager.d.ts +17 -9
  60. package/Gizmos/gizmoManager.js.map +1 -1
  61. package/Gizmos/lightGizmo.d.ts +12 -7
  62. package/Gizmos/lightGizmo.js.map +1 -1
  63. package/Gizmos/planeDragGizmo.d.ts +10 -8
  64. package/Gizmos/planeDragGizmo.js.map +1 -1
  65. package/Gizmos/planeRotationGizmo.d.ts +23 -14
  66. package/Gizmos/planeRotationGizmo.js.map +1 -1
  67. package/Gizmos/positionGizmo.d.ts +9 -7
  68. package/Gizmos/positionGizmo.js +1 -1
  69. package/Gizmos/positionGizmo.js.map +1 -1
  70. package/Gizmos/rotationGizmo.d.ts +6 -4
  71. package/Gizmos/rotationGizmo.js.map +1 -1
  72. package/Gizmos/scaleGizmo.d.ts +15 -12
  73. package/Gizmos/scaleGizmo.js.map +1 -1
  74. package/Inputs/scene.inputManager.js +0 -3
  75. package/Inputs/scene.inputManager.js.map +1 -1
  76. package/Loading/sceneLoader.js +5 -5
  77. package/Loading/sceneLoader.js.map +1 -1
  78. package/Materials/Node/Blocks/Fragment/TBNBlock.d.ts +12 -0
  79. package/Materials/Node/Blocks/Fragment/TBNBlock.js +50 -0
  80. package/Materials/Node/Blocks/Fragment/TBNBlock.js.map +1 -1
  81. package/Materials/Node/Blocks/Vertex/lightInformationBlock.d.ts +18 -0
  82. package/Materials/Node/Blocks/Vertex/lightInformationBlock.js +85 -1
  83. package/Materials/Node/Blocks/Vertex/lightInformationBlock.js.map +1 -1
  84. package/Materials/Node/Blocks/gradientBlock.js +1 -1
  85. package/Materials/Node/Blocks/gradientBlock.js.map +1 -1
  86. package/Materials/Node/nodeMaterial.d.ts +18 -2
  87. package/Materials/Node/nodeMaterial.js +56 -27
  88. package/Materials/Node/nodeMaterial.js.map +1 -1
  89. package/Materials/Textures/baseTexture.d.ts +2 -1
  90. package/Materials/Textures/baseTexture.js +4 -1
  91. package/Materials/Textures/baseTexture.js.map +1 -1
  92. package/Materials/Textures/prePassRenderTarget.js +1 -1
  93. package/Materials/Textures/prePassRenderTarget.js.map +1 -1
  94. package/Materials/Textures/renderTargetTexture.js +11 -3
  95. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  96. package/Materials/materialDefines.js +3 -1
  97. package/Materials/materialDefines.js.map +1 -1
  98. package/Materials/shaderMaterial.d.ts +10 -1
  99. package/Materials/shaderMaterial.js +10 -1
  100. package/Materials/shaderMaterial.js.map +1 -1
  101. package/Maths/math.color.d.ts +9 -1
  102. package/Maths/math.color.js +13 -1
  103. package/Maths/math.color.js.map +1 -1
  104. package/Maths/math.vector.d.ts +2 -2
  105. package/Maths/math.vector.js +18 -30
  106. package/Maths/math.vector.js.map +1 -1
  107. package/Meshes/Builders/icoSphereBuilder.js +2 -2
  108. package/Meshes/Builders/icoSphereBuilder.js.map +1 -1
  109. package/Meshes/Compression/dracoCompression.js +1 -1
  110. package/Meshes/Compression/dracoCompression.js.map +1 -1
  111. package/Meshes/abstractMesh.js +1 -1
  112. package/Meshes/abstractMesh.js.map +1 -1
  113. package/Meshes/geometry.js +1 -2
  114. package/Meshes/geometry.js.map +1 -1
  115. package/Meshes/thinInstanceMesh.js +5 -0
  116. package/Meshes/thinInstanceMesh.js.map +1 -1
  117. package/Misc/basis.js +3 -0
  118. package/Misc/basis.js.map +1 -1
  119. package/Misc/fileTools.js +2 -2
  120. package/Misc/fileTools.js.map +1 -1
  121. package/Misc/khronosTextureContainer2.js +1 -1
  122. package/Misc/khronosTextureContainer2.js.map +1 -1
  123. package/Misc/smartArray.js +0 -1
  124. package/Misc/smartArray.js.map +1 -1
  125. package/Misc/tools.d.ts +2 -2
  126. package/Misc/tools.js +4 -1
  127. package/Misc/tools.js.map +1 -1
  128. package/Offline/database.js +6 -8
  129. package/Offline/database.js.map +1 -1
  130. package/Particles/computeShaderParticleSystem.js +2 -2
  131. package/Particles/computeShaderParticleSystem.js.map +1 -1
  132. package/Particles/particleHelper.d.ts +12 -1
  133. package/Particles/particleHelper.js +12 -1
  134. package/Particles/particleHelper.js.map +1 -1
  135. package/Particles/particleSystem.js +2 -2
  136. package/Particles/particleSystem.js.map +1 -1
  137. package/Particles/particleSystemSet.js +1 -1
  138. package/Particles/particleSystemSet.js.map +1 -1
  139. package/Particles/solidParticleSystem.d.ts +3 -0
  140. package/Particles/solidParticleSystem.js +3 -0
  141. package/Particles/solidParticleSystem.js.map +1 -1
  142. package/Particles/webgl2ParticleSystem.js +2 -2
  143. package/Particles/webgl2ParticleSystem.js.map +1 -1
  144. package/Physics/Plugins/ammoJSPlugin.d.ts +2 -2
  145. package/Physics/Plugins/ammoJSPlugin.js +29 -29
  146. package/Physics/Plugins/ammoJSPlugin.js.map +1 -1
  147. package/Physics/Plugins/cannonJSPlugin.d.ts +2 -2
  148. package/Physics/Plugins/cannonJSPlugin.js +26 -26
  149. package/Physics/Plugins/cannonJSPlugin.js.map +1 -1
  150. package/Physics/Plugins/oimoJSPlugin.js +9 -11
  151. package/Physics/Plugins/oimoJSPlugin.js.map +1 -1
  152. package/Physics/physicsImpostor.d.ts +6 -6
  153. package/Physics/physicsImpostor.js +7 -6
  154. package/Physics/physicsImpostor.js.map +1 -1
  155. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js +3 -3
  156. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js.map +1 -1
  157. package/Rendering/utilityLayerRenderer.js +1 -1
  158. package/Rendering/utilityLayerRenderer.js.map +1 -1
  159. package/Shaders/sprites.fragment.js +1 -1
  160. package/Shaders/sprites.fragment.js.map +1 -1
  161. package/Sprites/spriteManager.d.ts +10 -1
  162. package/Sprites/spriteManager.js +10 -1
  163. package/Sprites/spriteManager.js.map +1 -1
  164. package/Sprites/spriteRenderer.js +1 -1
  165. package/Sprites/spriteRenderer.js.map +1 -1
  166. package/XR/features/WebXRLayers.js +1 -1
  167. package/XR/features/WebXRLayers.js.map +1 -1
  168. package/assetContainer.js +12 -12
  169. package/assetContainer.js.map +1 -1
  170. package/node.js +1 -1
  171. package/node.js.map +1 -1
  172. package/package.json +1 -1
  173. package/scene.d.ts +2 -0
  174. package/scene.js +15 -8
  175. package/scene.js.map +1 -1
@@ -44,6 +44,8 @@ export interface EngineFeatures {
44
44
  needToAlwaysBindUniformBuffers: boolean;
45
45
  /** Indicates that the engine supports render passes */
46
46
  supportRenderPasses: boolean;
47
+ /** Indicates that the engine supports sprite instancing */
48
+ supportSpriteInstancing: boolean;
47
49
  /** @hidden */
48
50
  _collectUbosUpdatedInFrame: boolean;
49
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"engineFeatures.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Engines/engineFeatures.ts"],"names":[],"mappings":"","sourcesContent":["/** @hidden */\r\nexport interface EngineFeatures {\r\n /** Force using Bitmap when Bitmap or HTMLImageElement can be used */\r\n forceBitmapOverHTMLImageElement: boolean;\r\n\r\n /** Indicates that the engine support rendering to as well as copying to lod float textures */\r\n supportRenderAndCopyToLodForFloatTextures: boolean;\r\n\r\n /** Indicates that the engine support handling depth/stencil textures */\r\n supportDepthStencilTexture: boolean;\r\n\r\n /** Indicates that the engine support shadow samplers */\r\n supportShadowSamplers: boolean;\r\n\r\n /** Indicates to check the matrix bytes per bytes to know if it has changed or not. If false, only the updateFlag of the matrix is checked */\r\n uniformBufferHardCheckMatrix: boolean;\r\n\r\n /** Indicates that prefiltered mipmaps can be generated in some processes (for eg when loading an HDR cube texture) */\r\n allowTexturePrefiltering: boolean;\r\n\r\n /** Indicates to track the usage of ubos and to create new ones as necessary during a frame duration */\r\n trackUbosInFrame: boolean;\r\n\r\n /** Indicates that the current content of a ubo should be compared to the content of the corresponding GPU buffer and the GPU buffer updated only if different. Requires trackUbosInFrame to be true */\r\n checkUbosContentBeforeUpload: boolean;\r\n\r\n /** Indicates that the Cascaded Shadow Map technic is supported */\r\n supportCSM: boolean;\r\n\r\n /** Indicates that the textures transcoded by the basis transcoder must have power of 2 width and height */\r\n basisNeedsPOT: boolean;\r\n\r\n /** Indicates that the engine supports 3D textures */\r\n support3DTextures: boolean;\r\n\r\n /** Indicates that constants need a type suffix in shaders (used by realtime filtering...) */\r\n needTypeSuffixInShaderConstants: boolean;\r\n\r\n /** Indicates that MSAA is supported */\r\n supportMSAA: boolean;\r\n\r\n /** Indicates that SSAO2 is supported */\r\n supportSSAO2: boolean;\r\n\r\n /** Indicates that some additional texture formats are supported (like TEXTUREFORMAT_R for eg) */\r\n supportExtendedTextureFormats: boolean;\r\n\r\n /** Indicates that the switch/case construct is supported in shaders */\r\n supportSwitchCaseInShader: boolean;\r\n\r\n /** Indicates that synchronous texture reading is supported */\r\n supportSyncTextureRead: boolean;\r\n\r\n /** Indicates that y should be inverted when dealing with bitmaps (notably in environment tools) */\r\n needsInvertingBitmap: boolean;\r\n\r\n /** Indicates that the engine should cache the bound UBO */\r\n useUBOBindingCache: boolean;\r\n\r\n /** Indicates that the inliner should be run over every shader code */\r\n needShaderCodeInlining: boolean;\r\n\r\n /** Indicates that even if we don't have to update the properties of a uniform buffer (because of some optimzations in the material) we still need to bind the uniform buffer themselves */\r\n needToAlwaysBindUniformBuffers: boolean;\r\n\r\n /** Indicates that the engine supports render passes */\r\n supportRenderPasses: boolean;\r\n\r\n /** @hidden */\r\n _collectUbosUpdatedInFrame: boolean;\r\n}\r\n"]}
1
+ {"version":3,"file":"engineFeatures.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Engines/engineFeatures.ts"],"names":[],"mappings":"","sourcesContent":["/** @hidden */\r\nexport interface EngineFeatures {\r\n /** Force using Bitmap when Bitmap or HTMLImageElement can be used */\r\n forceBitmapOverHTMLImageElement: boolean;\r\n\r\n /** Indicates that the engine support rendering to as well as copying to lod float textures */\r\n supportRenderAndCopyToLodForFloatTextures: boolean;\r\n\r\n /** Indicates that the engine support handling depth/stencil textures */\r\n supportDepthStencilTexture: boolean;\r\n\r\n /** Indicates that the engine support shadow samplers */\r\n supportShadowSamplers: boolean;\r\n\r\n /** Indicates to check the matrix bytes per bytes to know if it has changed or not. If false, only the updateFlag of the matrix is checked */\r\n uniformBufferHardCheckMatrix: boolean;\r\n\r\n /** Indicates that prefiltered mipmaps can be generated in some processes (for eg when loading an HDR cube texture) */\r\n allowTexturePrefiltering: boolean;\r\n\r\n /** Indicates to track the usage of ubos and to create new ones as necessary during a frame duration */\r\n trackUbosInFrame: boolean;\r\n\r\n /** Indicates that the current content of a ubo should be compared to the content of the corresponding GPU buffer and the GPU buffer updated only if different. Requires trackUbosInFrame to be true */\r\n checkUbosContentBeforeUpload: boolean;\r\n\r\n /** Indicates that the Cascaded Shadow Map technic is supported */\r\n supportCSM: boolean;\r\n\r\n /** Indicates that the textures transcoded by the basis transcoder must have power of 2 width and height */\r\n basisNeedsPOT: boolean;\r\n\r\n /** Indicates that the engine supports 3D textures */\r\n support3DTextures: boolean;\r\n\r\n /** Indicates that constants need a type suffix in shaders (used by realtime filtering...) */\r\n needTypeSuffixInShaderConstants: boolean;\r\n\r\n /** Indicates that MSAA is supported */\r\n supportMSAA: boolean;\r\n\r\n /** Indicates that SSAO2 is supported */\r\n supportSSAO2: boolean;\r\n\r\n /** Indicates that some additional texture formats are supported (like TEXTUREFORMAT_R for eg) */\r\n supportExtendedTextureFormats: boolean;\r\n\r\n /** Indicates that the switch/case construct is supported in shaders */\r\n supportSwitchCaseInShader: boolean;\r\n\r\n /** Indicates that synchronous texture reading is supported */\r\n supportSyncTextureRead: boolean;\r\n\r\n /** Indicates that y should be inverted when dealing with bitmaps (notably in environment tools) */\r\n needsInvertingBitmap: boolean;\r\n\r\n /** Indicates that the engine should cache the bound UBO */\r\n useUBOBindingCache: boolean;\r\n\r\n /** Indicates that the inliner should be run over every shader code */\r\n needShaderCodeInlining: boolean;\r\n\r\n /** Indicates that even if we don't have to update the properties of a uniform buffer (because of some optimzations in the material) we still need to bind the uniform buffer themselves */\r\n needToAlwaysBindUniformBuffers: boolean;\r\n\r\n /** Indicates that the engine supports render passes */\r\n supportRenderPasses: boolean;\r\n\r\n /** Indicates that the engine supports sprite instancing */\r\n supportSpriteInstancing: boolean;\r\n\r\n /** @hidden */\r\n _collectUbosUpdatedInFrame: boolean;\r\n}\r\n"]}
@@ -99,13 +99,17 @@ export declare class NativeEngine extends Engine {
99
99
  createVertexBuffer(vertices: DataArray, updateable?: boolean): NativeDataBuffer;
100
100
  protected _recordVertexArrayObject(vertexArray: any, vertexBuffers: {
101
101
  [key: string]: VertexBuffer;
102
- }, indexBuffer: Nullable<NativeDataBuffer>, effect: Effect): void;
102
+ }, indexBuffer: Nullable<NativeDataBuffer>, effect: Effect, overrideVertexBuffers?: {
103
+ [kind: string]: Nullable<VertexBuffer>;
104
+ }): void;
103
105
  bindBuffers(vertexBuffers: {
104
106
  [key: string]: VertexBuffer;
105
107
  }, indexBuffer: Nullable<NativeDataBuffer>, effect: Effect): void;
106
108
  recordVertexArrayObject(vertexBuffers: {
107
109
  [key: string]: VertexBuffer;
108
- }, indexBuffer: Nullable<NativeDataBuffer>, effect: Effect): WebGLVertexArrayObject;
110
+ }, indexBuffer: Nullable<NativeDataBuffer>, effect: Effect, overrideVertexBuffers?: {
111
+ [kind: string]: Nullable<VertexBuffer>;
112
+ }): WebGLVertexArrayObject;
109
113
  private _deleteVertexArray;
110
114
  bindVertexArrayObject(vertexArray: WebGLVertexArrayObject): void;
111
115
  releaseVertexArrayObject(vertexArray: WebGLVertexArrayObject): void;
@@ -750,7 +750,7 @@ var NativeEngine = /** @class */ (function (_super) {
750
750
  drawBuffersExtension: false,
751
751
  depthTextureExtension: false,
752
752
  vertexArrayObject: true,
753
- instancedArrays: false,
753
+ instancedArrays: true,
754
754
  supportOcclusionQuery: false,
755
755
  canUseTimestampForTimerQuery: false,
756
756
  blendMinMax: false,
@@ -786,6 +786,7 @@ var NativeEngine = /** @class */ (function (_super) {
786
786
  needShaderCodeInlining: true,
787
787
  needToAlwaysBindUniformBuffers: false,
788
788
  supportRenderPasses: true,
789
+ supportSpriteInstancing: false,
789
790
  _collectUbosUpdatedInFrame: false,
790
791
  };
791
792
  Tools.Log("Babylon Native (v" + Engine.Version + ") launched");
@@ -933,7 +934,7 @@ var NativeEngine = /** @class */ (function (_super) {
933
934
  }
934
935
  return buffer;
935
936
  };
936
- NativeEngine.prototype._recordVertexArrayObject = function (vertexArray, vertexBuffers, indexBuffer, effect) {
937
+ NativeEngine.prototype._recordVertexArrayObject = function (vertexArray, vertexBuffers, indexBuffer, effect, overrideVertexBuffers) {
937
938
  if (indexBuffer) {
938
939
  this._engine.recordIndexBuffer(vertexArray, indexBuffer.nativeIndexBuffer);
939
940
  }
@@ -942,10 +943,16 @@ var NativeEngine = /** @class */ (function (_super) {
942
943
  var location_1 = effect.getAttributeLocation(index);
943
944
  if (location_1 >= 0) {
944
945
  var kind = attributes[index];
945
- var vertexBuffer = vertexBuffers[kind];
946
+ var vertexBuffer = null;
947
+ if (overrideVertexBuffers) {
948
+ vertexBuffer = overrideVertexBuffers[kind];
949
+ }
950
+ if (!vertexBuffer) {
951
+ vertexBuffer = vertexBuffers[kind];
952
+ }
946
953
  if (vertexBuffer) {
947
954
  var buffer = vertexBuffer.getBuffer();
948
- if (buffer) {
955
+ if (buffer && buffer.nativeVertexBuffer) {
949
956
  this._engine.recordVertexBuffer(vertexArray, buffer.nativeVertexBuffer, location_1, vertexBuffer.byteOffset, vertexBuffer.byteStride, vertexBuffer.getSize(), this._getNativeAttribType(vertexBuffer.type), vertexBuffer.normalized, vertexBuffer.getInstanceDivisor());
950
957
  }
951
958
  }
@@ -960,9 +967,9 @@ var NativeEngine = /** @class */ (function (_super) {
960
967
  this._recordVertexArrayObject(this._boundBuffersVertexArray, vertexBuffers, indexBuffer, effect);
961
968
  this.bindVertexArrayObject(this._boundBuffersVertexArray);
962
969
  };
963
- NativeEngine.prototype.recordVertexArrayObject = function (vertexBuffers, indexBuffer, effect) {
970
+ NativeEngine.prototype.recordVertexArrayObject = function (vertexBuffers, indexBuffer, effect, overrideVertexBuffers) {
964
971
  var vertexArray = this._engine.createVertexArray();
965
- this._recordVertexArrayObject(vertexArray, vertexBuffers, indexBuffer, effect);
972
+ this._recordVertexArrayObject(vertexArray, vertexBuffers, indexBuffer, effect, overrideVertexBuffers);
966
973
  return vertexArray;
967
974
  };
968
975
  NativeEngine.prototype._deleteVertexArray = function (vertexArray) {