@babylonjs/core 5.0.0-alpha.61 → 5.0.0-alpha.62

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 (103) hide show
  1. package/Audio/sound.js +1 -1
  2. package/Audio/sound.js.map +1 -1
  3. package/Behaviors/Cameras/autoRotationBehavior.d.ts +5 -0
  4. package/Behaviors/Cameras/autoRotationBehavior.js +7 -0
  5. package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
  6. package/Cameras/camera.js +1 -1
  7. package/Cameras/camera.js.map +1 -1
  8. package/DeviceInput/Implementations/webDeviceInputSystem.js +9 -9
  9. package/DeviceInput/Implementations/webDeviceInputSystem.js.map +1 -1
  10. package/Engines/Extensions/engine.dynamicTexture.d.ts +2 -1
  11. package/Engines/Extensions/engine.dynamicTexture.js +2 -1
  12. package/Engines/Extensions/engine.dynamicTexture.js.map +1 -1
  13. package/Engines/WebGPU/Extensions/engine.dynamicTexture.js +3 -11
  14. package/Engines/WebGPU/Extensions/engine.dynamicTexture.js.map +1 -1
  15. package/Engines/WebGPU/Extensions/engine.multiRender.js +0 -4
  16. package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
  17. package/Engines/WebGPU/Extensions/engine.renderTarget.js +0 -4
  18. package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
  19. package/Engines/WebGPU/webgpuCacheRenderPipeline.js +42 -61
  20. package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
  21. package/Engines/WebGPU/webgpuCacheSampler.js +6 -4
  22. package/Engines/WebGPU/webgpuCacheSampler.js.map +1 -1
  23. package/Engines/WebGPU/webgpuConstants.d.ts +57 -13
  24. package/Engines/WebGPU/webgpuConstants.js +62 -13
  25. package/Engines/WebGPU/webgpuConstants.js.map +1 -1
  26. package/Engines/WebGPU/webgpuHardwareTexture.d.ts +22 -3
  27. package/Engines/WebGPU/webgpuHardwareTexture.js +2 -1
  28. package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
  29. package/Engines/WebGPU/webgpuTextureHelper.d.ts +2 -2
  30. package/Engines/WebGPU/webgpuTextureHelper.js +233 -63
  31. package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
  32. package/Engines/engine.d.ts +82 -39
  33. package/Engines/engine.js +10 -1
  34. package/Engines/engine.js.map +1 -1
  35. package/Engines/nativeEngine.js +30 -10
  36. package/Engines/nativeEngine.js.map +1 -1
  37. package/Engines/thinEngine.js +2 -2
  38. package/Engines/thinEngine.js.map +1 -1
  39. package/Engines/webgpuEngine.js +2 -4
  40. package/Engines/webgpuEngine.js.map +1 -1
  41. package/Lights/pointLight.js +1 -1
  42. package/Lights/pointLight.js.map +1 -1
  43. package/Lights/spotLight.js +1 -1
  44. package/Lights/spotLight.js.map +1 -1
  45. package/Materials/Node/Blocks/Fragment/index.d.ts +1 -0
  46. package/Materials/Node/Blocks/Fragment/index.js +1 -0
  47. package/Materials/Node/Blocks/Fragment/index.js.map +1 -1
  48. package/Materials/Node/Blocks/Fragment/screenSpaceBlock.js +1 -3
  49. package/Materials/Node/Blocks/Fragment/screenSpaceBlock.js.map +1 -1
  50. package/Materials/Node/Blocks/Fragment/twirlBlock.d.ts +49 -0
  51. package/Materials/Node/Blocks/Fragment/twirlBlock.js +145 -0
  52. package/Materials/Node/Blocks/Fragment/twirlBlock.js.map +1 -0
  53. package/Materials/Node/Blocks/customBlock.d.ts +31 -0
  54. package/Materials/Node/Blocks/customBlock.js +144 -0
  55. package/Materials/Node/Blocks/customBlock.js.map +1 -0
  56. package/Materials/Node/Blocks/index.d.ts +1 -0
  57. package/Materials/Node/Blocks/index.js +1 -0
  58. package/Materials/Node/Blocks/index.js.map +1 -1
  59. package/Materials/PBR/pbrBaseMaterial.js +1 -1
  60. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  61. package/Materials/Textures/dynamicTexture.d.ts +2 -1
  62. package/Materials/Textures/dynamicTexture.js +4 -2
  63. package/Materials/Textures/dynamicTexture.js.map +1 -1
  64. package/Materials/Textures/thinRenderTargetTexture.js +1 -1
  65. package/Materials/Textures/thinRenderTargetTexture.js.map +1 -1
  66. package/Materials/Textures/thinTexture.d.ts +1 -2
  67. package/Materials/Textures/thinTexture.js +2 -4
  68. package/Materials/Textures/thinTexture.js.map +1 -1
  69. package/Materials/shaderMaterial.js +12 -0
  70. package/Materials/shaderMaterial.js.map +1 -1
  71. package/Maths/math.vector.d.ts +12 -8
  72. package/Maths/math.vector.js +22 -14
  73. package/Maths/math.vector.js.map +1 -1
  74. package/Meshes/abstractMesh.js +23 -22
  75. package/Meshes/abstractMesh.js.map +1 -1
  76. package/Meshes/geometry.js +2 -2
  77. package/Meshes/geometry.js.map +1 -1
  78. package/Meshes/mesh.d.ts +12 -0
  79. package/Meshes/mesh.js +182 -113
  80. package/Meshes/mesh.js.map +1 -1
  81. package/Meshes/mesh.vertexData.d.ts +6 -1
  82. package/Meshes/mesh.vertexData.js +295 -114
  83. package/Meshes/mesh.vertexData.js.map +1 -1
  84. package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.d.ts +1 -0
  85. package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js +13 -8
  86. package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js.map +1 -1
  87. package/Misc/PerformanceViewer/performanceViewerCollector.js +1 -1
  88. package/Misc/PerformanceViewer/performanceViewerCollector.js.map +1 -1
  89. package/Misc/coroutine.d.ts +45 -0
  90. package/Misc/coroutine.js +123 -0
  91. package/Misc/coroutine.js.map +1 -0
  92. package/Misc/index.d.ts +1 -0
  93. package/Misc/index.js +1 -0
  94. package/Misc/index.js.map +1 -1
  95. package/Misc/observableCoroutine.d.ts +9 -10
  96. package/Misc/observableCoroutine.js +31 -39
  97. package/Misc/observableCoroutine.js.map +1 -1
  98. package/Particles/subEmitter.js +1 -0
  99. package/Particles/subEmitter.js.map +1 -1
  100. package/XR/features/WebXRControllerPointerSelection.d.ts +14 -0
  101. package/XR/features/WebXRControllerPointerSelection.js +38 -10
  102. package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
  103. package/package.json +10 -1
@@ -1290,12 +1290,14 @@ interface GPUDeviceDescriptor extends GPUObjectDescriptorBase {
1290
1290
  }
1291
1291
 
1292
1292
  type GPUFeatureName =
1293
- | "depth-clamping"
1293
+ | "depth-clip-control"
1294
1294
  | "depth24unorm-stencil8"
1295
1295
  | "depth32float-stencil8"
1296
- | "pipeline-statistics-query"
1297
1296
  | "texture-compression-bc"
1298
- | "timestamp-query";
1297
+ | "texture-compression-etc2"
1298
+ | "texture-compression-astc"
1299
+ | "timestamp-query"
1300
+ | "indirect-first-instance";
1299
1301
 
1300
1302
  class GPUDevice extends EventTarget implements GPUObjectBase {
1301
1303
  private __brand: void;
@@ -1474,6 +1476,50 @@ type GPUTextureFormat =
1474
1476
  | "bc7-rgba-unorm"
1475
1477
  | "bc7-rgba-unorm-srgb"
1476
1478
 
1479
+ // ETC2 compressed formats usable if "texture-compression-etc2" is both
1480
+ // supported by the device/user agent and enabled in requestDevice.
1481
+ | "etc2-rgb8unorm"
1482
+ | "etc2-rgb8unorm-srgb"
1483
+ | "etc2-rgb8a1unorm"
1484
+ | "etc2-rgb8a1unorm-srgb"
1485
+ | "etc2-rgba8unorm"
1486
+ | "etc2-rgba8unorm-srgb"
1487
+ | "eac-r11unorm"
1488
+ | "eac-r11snorm"
1489
+ | "eac-rg11unorm"
1490
+ | "eac-rg11snorm"
1491
+
1492
+ // ASTC compressed formats usable if "texture-compression-astc" is both
1493
+ // supported by the device/user agent and enabled in requestDevice.
1494
+ | "astc-4x4-unorm"
1495
+ | "astc-4x4-unorm-srgb"
1496
+ | "astc-5x4-unorm"
1497
+ | "astc-5x4-unorm-srgb"
1498
+ | "astc-5x5-unorm"
1499
+ | "astc-5x5-unorm-srgb"
1500
+ | "astc-6x5-unorm"
1501
+ | "astc-6x5-unorm-srgb"
1502
+ | "astc-6x6-unorm"
1503
+ | "astc-6x6-unorm-srgb"
1504
+ | "astc-8x5-unorm"
1505
+ | "astc-8x5-unorm-srgb"
1506
+ | "astc-8x6-unorm"
1507
+ | "astc-8x6-unorm-srgb"
1508
+ | "astc-8x8-unorm"
1509
+ | "astc-8x8-unorm-srgb"
1510
+ | "astc-10x5-unorm"
1511
+ | "astc-10x5-unorm-srgb"
1512
+ | "astc-10x6-unorm"
1513
+ | "astc-10x6-unorm-srgb"
1514
+ | "astc-10x8-unorm"
1515
+ | "astc-10x8-unorm-srgb"
1516
+ | "astc-10x10-unorm"
1517
+ | "astc-10x10-unorm-srgb"
1518
+ | "astc-12x10-unorm"
1519
+ | "astc-12x10-unorm-srgb"
1520
+ | "astc-12x12-unorm"
1521
+ | "astc-12x12-unorm-srgb"
1522
+
1477
1523
  // "depth24unorm-stencil8" feature
1478
1524
  | "depth24unorm-stencil8"
1479
1525
 
@@ -1700,8 +1746,8 @@ interface GPUPrimitiveState {
1700
1746
  frontFace?: GPUFrontFace; /* default="ccw" */
1701
1747
  cullMode?: GPUCullMode; /* default="none" */
1702
1748
 
1703
- // Enable depth clamping (requires "depth-clamping" feature)
1704
- clampDepth?: boolean; /* default=false */
1749
+ // Requires "depth-clip-control" feature.
1750
+ unclippedDepth?: boolean; /* default=false */
1705
1751
  }
1706
1752
 
1707
1753
  type GPUFrontFace = "ccw" | "cw";
@@ -1849,8 +1895,6 @@ interface GPUVertexAttribute {
1849
1895
  class GPUCommandBuffer implements GPUObjectBase {
1850
1896
  private __brand: void;
1851
1897
  label: string | undefined;
1852
-
1853
- readonly executionTime: Promise<number>;
1854
1898
  }
1855
1899
 
1856
1900
  interface GPUCommandBufferDescriptor extends GPUObjectDescriptorBase {
@@ -1885,6 +1929,11 @@ class GPUCommandEncoder implements GPUObjectBase {
1885
1929
  destination: GPUImageCopyTexture,
1886
1930
  copySize: GPUExtent3D
1887
1931
  ): void;
1932
+ fillBuffer(
1933
+ destination: GPUBuffer,
1934
+ destinationOffset: GPUSize64,
1935
+ size: GPUSize64
1936
+ ): void;
1888
1937
 
1889
1938
  pushDebugGroup(groupLabel: string): void;
1890
1939
  popDebugGroup(): void;
@@ -1904,7 +1953,6 @@ class GPUCommandEncoder implements GPUObjectBase {
1904
1953
  }
1905
1954
 
1906
1955
  interface GPUCommandEncoderDescriptor extends GPUObjectDescriptorBase {
1907
- measureExecutionTime?: boolean; /* default=false */
1908
1956
  }
1909
1957
 
1910
1958
  interface GPUImageDataLayout {
@@ -1978,15 +2026,23 @@ class GPUComputePassEncoder implements GPUObjectBase, GPUProgrammablePassEncoder
1978
2026
  dispatch(x: GPUSize32, y?: GPUSize32 /* default=1 */, z?: GPUSize32 /* default=1 */): void;
1979
2027
  dispatchIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): void;
1980
2028
 
1981
- beginPipelineStatisticsQuery(querySet: GPUQuerySet, queryIndex: GPUSize32): void;
1982
- endPipelineStatisticsQuery(): void;
2029
+ endPass(): void;
2030
+ }
1983
2031
 
1984
- writeTimestamp(querySet: GPUQuerySet, queryIndex: GPUSize32): void;
2032
+ type GPUComputePassTimestampLocation =
2033
+ | "beginning"
2034
+ | "end";
1985
2035
 
1986
- endPass(): void;
2036
+ interface GPUComputePassTimestampWrite {
2037
+ querySet: GPUQuerySet;
2038
+ queryIndex: GPUSize32;
2039
+ location: GPUComputePassTimestampLocation;
1987
2040
  }
1988
2041
 
2042
+ type GPUComputePassTimestampWrites = Array<GPUComputePassTimestampWrite>;
2043
+
1989
2044
  interface GPUComputePassDescriptor extends GPUObjectDescriptorBase {
2045
+ timestampWrites?: GPUComputePassTimestampWrites; /* default=[] */
1990
2046
  }
1991
2047
 
1992
2048
  interface GPURenderEncoderBase {
@@ -2070,19 +2126,27 @@ class GPURenderPassEncoder implements GPUObjectBase, GPUProgrammablePassEncoder,
2070
2126
  beginOcclusionQuery(queryIndex: GPUSize32): void;
2071
2127
  endOcclusionQuery(): void;
2072
2128
 
2073
- beginPipelineStatisticsQuery(querySet: GPUQuerySet, queryIndex: GPUSize32): void;
2074
- endPipelineStatisticsQuery(): void;
2075
-
2076
- writeTimestamp(querySet: GPUQuerySet, queryIndex: GPUSize32): void;
2077
-
2078
2129
  executeBundles(bundles: GPURenderBundle[]): void;
2079
2130
  endPass(): void;
2080
2131
  }
2081
2132
 
2133
+ type GPURenderPassTimestampLocation =
2134
+ | "beginning"
2135
+ | "end";
2136
+
2137
+ interface GPURenderPassTimestampWrite {
2138
+ querySet: GPUQuerySet;
2139
+ queryIndex: GPUSize32;
2140
+ location: GPURenderPassTimestampLocation;
2141
+ }
2142
+
2143
+ type GPURenderPassTimestampWrites = Array<GPURenderPassTimestampWrite>;
2144
+
2082
2145
  interface GPURenderPassDescriptor extends GPUObjectDescriptorBase {
2083
2146
  colorAttachments: GPURenderPassColorAttachment[];
2084
2147
  depthStencilAttachment?: GPURenderPassDepthStencilAttachment;
2085
2148
  occlusionQuerySet?: GPUQuerySet;
2149
+ timestampWrites?: GPURenderPassTimestampWrites; /* default=[] */
2086
2150
  }
2087
2151
 
2088
2152
  interface GPURenderPassColorAttachment {
@@ -2174,12 +2238,6 @@ interface GPURenderBundleEncoderDescriptor extends GPURenderPassLayout {
2174
2238
  stencilReadOnly?: boolean; /* default=false */
2175
2239
  }
2176
2240
 
2177
- // @todo: to be removed
2178
- interface GPUImageBitmapCopyView {
2179
- imageBitmap: ImageBitmap;
2180
- origin?: GPUOrigin2D;
2181
- }
2182
-
2183
2241
  class GPUQueue implements GPUObjectBase {
2184
2242
  private __brand: void;
2185
2243
  label: string | undefined;
@@ -2203,13 +2261,6 @@ class GPUQueue implements GPUObjectBase {
2203
2261
  size: GPUExtent3D
2204
2262
  ): void;
2205
2263
 
2206
- // @todo: to be removed
2207
- copyImageBitmapToTexture(
2208
- source: GPUImageBitmapCopyView,
2209
- destination: GPUImageCopyTexture,
2210
- copySize: GPUExtent3D
2211
- ): void;
2212
-
2213
2264
  copyExternalImageToTexture(
2214
2265
  source: GPUImageCopyExternalImage,
2215
2266
  destination: GPUImageCopyTextureTagged,
@@ -2227,17 +2278,9 @@ class GPUQuerySet implements GPUObjectBase {
2227
2278
  interface GPUQuerySetDescriptor extends GPUObjectDescriptorBase {
2228
2279
  type: GPUQueryType;
2229
2280
  count: GPUSize32;
2230
- pipelineStatistics?: GPUPipelineStatisticName[]; /* default=[] */
2231
2281
  }
2232
2282
 
2233
- type GPUQueryType = "occlusion" | "pipeline-statistics" | "timestamp";
2234
-
2235
- type GPUPipelineStatisticName =
2236
- | "vertex-shader-invocations"
2237
- | "clipper-invocations"
2238
- | "clipper-primitives-out"
2239
- | "fragment-shader-invocations"
2240
- | "compute-shader-invocations";
2283
+ type GPUQueryType = "occlusion" | "timestamp";
2241
2284
 
2242
2285
  class GPUCanvasContext {
2243
2286
  private __brand: void;
package/Engines/engine.js CHANGED
@@ -346,7 +346,16 @@ var Engine = /** @class */ (function (_super) {
346
346
  _this._windowIsBackground = false;
347
347
  };
348
348
  this._onCanvasPointerOut = function (ev) {
349
- _this.onCanvasPointerOutObservable.notifyObservers(ev);
349
+ // Check for canvas and if there is a canvas, make sure that this callback is only fired when the cursor exits the canvas
350
+ // Note: This is a workaround for a bug with Safari
351
+ var rect = _this.getInputElementClientRect();
352
+ if (rect) {
353
+ var pointerX = ev.clientX - rect.left;
354
+ var pointerY = ev.clientY - rect.top;
355
+ if (pointerX < 0 || pointerX > rect.width || pointerY < 0 || pointerY > rect.height) {
356
+ _this.onCanvasPointerOutObservable.notifyObservers(ev);
357
+ }
358
+ }
350
359
  };
351
360
  if (IsWindowObjectExist()) {
352
361
  var hostWindow = this.getHostWindow();