@babylonjs/core 5.57.0 → 6.0.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 (65) hide show
  1. package/Engines/WebGPU/Extensions/engine.multiRender.js +51 -8
  2. package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
  3. package/Engines/WebGPU/webgpuHardwareTexture.d.ts +4 -3
  4. package/Engines/WebGPU/webgpuHardwareTexture.js +23 -10
  5. package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
  6. package/Engines/WebGPU/webgpuTextureHelper.d.ts +1 -1
  7. package/Engines/WebGPU/webgpuTextureHelper.js +6 -14
  8. package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
  9. package/Engines/engine.d.ts +5 -6
  10. package/Engines/thinEngine.js +2 -2
  11. package/Engines/thinEngine.js.map +1 -1
  12. package/Engines/webgpuEngine.js +16 -8
  13. package/Engines/webgpuEngine.js.map +1 -1
  14. package/Lights/Shadows/shadowGenerator.d.ts +2 -0
  15. package/Lights/Shadows/shadowGenerator.js +11 -22
  16. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  17. package/Maths/math.vector.js +4 -2
  18. package/Maths/math.vector.js.map +1 -1
  19. package/Meshes/abstractMesh.d.ts +13 -0
  20. package/Meshes/abstractMesh.js +20 -0
  21. package/Meshes/abstractMesh.js.map +1 -1
  22. package/Meshes/thinInstanceMesh.js +4 -1
  23. package/Meshes/thinInstanceMesh.js.map +1 -1
  24. package/Particles/solidParticleSystem.d.ts +1 -1
  25. package/Particles/solidParticleSystem.js +1 -1
  26. package/Particles/solidParticleSystem.js.map +1 -1
  27. package/Physics/physicsEngineComponent.d.ts +1 -0
  28. package/Physics/physicsEngineComponent.js +1 -0
  29. package/Physics/physicsEngineComponent.js.map +1 -1
  30. package/Physics/physicsHelper.d.ts +12 -5
  31. package/Physics/physicsHelper.js +160 -90
  32. package/Physics/physicsHelper.js.map +1 -1
  33. package/Physics/physicsRaycastResult.d.ts +9 -0
  34. package/Physics/physicsRaycastResult.js.map +1 -1
  35. package/Physics/v2/IPhysicsEnginePlugin.d.ts +120 -77
  36. package/Physics/v2/IPhysicsEnginePlugin.js +119 -48
  37. package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -1
  38. package/Physics/v2/Plugins/havokPlugin.d.ts +687 -0
  39. package/Physics/v2/Plugins/havokPlugin.js +1592 -0
  40. package/Physics/v2/Plugins/havokPlugin.js.map +1 -0
  41. package/Physics/v2/Plugins/index.d.ts +1 -0
  42. package/Physics/v2/Plugins/index.js +1 -1
  43. package/Physics/v2/Plugins/index.js.map +1 -1
  44. package/Physics/v2/index.d.ts +1 -0
  45. package/Physics/v2/index.js +2 -0
  46. package/Physics/v2/index.js.map +1 -1
  47. package/Physics/v2/physicsAggregate.d.ts +9 -2
  48. package/Physics/v2/physicsAggregate.js +66 -31
  49. package/Physics/v2/physicsAggregate.js.map +1 -1
  50. package/Physics/v2/physicsBody.d.ts +51 -62
  51. package/Physics/v2/physicsBody.js +101 -128
  52. package/Physics/v2/physicsBody.js.map +1 -1
  53. package/Physics/v2/physicsConstraint.d.ts +57 -25
  54. package/Physics/v2/physicsConstraint.js +32 -15
  55. package/Physics/v2/physicsConstraint.js.map +1 -1
  56. package/Physics/v2/physicsEngine.d.ts +0 -1
  57. package/Physics/v2/physicsEngine.js +0 -1
  58. package/Physics/v2/physicsEngine.js.map +1 -1
  59. package/Physics/v2/physicsEngineComponent.d.ts +0 -10
  60. package/Physics/v2/physicsEngineComponent.js +0 -29
  61. package/Physics/v2/physicsEngineComponent.js.map +1 -1
  62. package/Physics/v2/physicsShape.d.ts +52 -11
  63. package/Physics/v2/physicsShape.js +80 -23
  64. package/Physics/v2/physicsShape.js.map +1 -1
  65. package/package.json +1 -1
@@ -1992,12 +1992,12 @@ export class WebGPUEngine extends Engine {
1992
1992
  // Render Pass
1993
1993
  //------------------------------------------------------------------------------
1994
1994
  _startRenderTargetRenderPass(renderTargetWrapper, setClearStates, clearColor, clearDepth, clearStencil) {
1995
- var _a, _b, _c;
1995
+ var _a, _b, _c, _d, _e, _f, _g;
1996
1996
  const rtWrapper = renderTargetWrapper;
1997
1997
  const depthStencilTexture = rtWrapper._depthStencilTexture;
1998
1998
  const gpuDepthStencilWrapper = depthStencilTexture === null || depthStencilTexture === void 0 ? void 0 : depthStencilTexture._hardwareTexture;
1999
1999
  const gpuDepthStencilTexture = gpuDepthStencilWrapper === null || gpuDepthStencilWrapper === void 0 ? void 0 : gpuDepthStencilWrapper.underlyingResource;
2000
- const gpuDepthStencilMSAATexture = gpuDepthStencilWrapper === null || gpuDepthStencilWrapper === void 0 ? void 0 : gpuDepthStencilWrapper.msaaTexture;
2000
+ const gpuDepthStencilMSAATexture = gpuDepthStencilWrapper === null || gpuDepthStencilWrapper === void 0 ? void 0 : gpuDepthStencilWrapper.getMSAATexture();
2001
2001
  const depthTextureView = gpuDepthStencilTexture === null || gpuDepthStencilTexture === void 0 ? void 0 : gpuDepthStencilTexture.createView(this._rttRenderPassWrapper.depthAttachmentViewDescriptor);
2002
2002
  const depthMSAATextureView = gpuDepthStencilMSAATexture === null || gpuDepthStencilMSAATexture === void 0 ? void 0 : gpuDepthStencilMSAATexture.createView(this._rttRenderPassWrapper.depthAttachmentViewDescriptor);
2003
2003
  const depthTextureHasStencil = gpuDepthStencilWrapper ? WebGPUTextureHelper.HasStencilAspect(gpuDepthStencilWrapper.format) : false;
@@ -2019,13 +2019,21 @@ export class WebGPUEngine extends Engine {
2019
2019
  const gpuMRTWrapper = mrtTexture === null || mrtTexture === void 0 ? void 0 : mrtTexture._hardwareTexture;
2020
2020
  const gpuMRTTexture = gpuMRTWrapper === null || gpuMRTWrapper === void 0 ? void 0 : gpuMRTWrapper.underlyingResource;
2021
2021
  if (gpuMRTWrapper && gpuMRTTexture) {
2022
+ const gpuMSAATexture = gpuMRTWrapper.getMSAATexture(i);
2023
+ const layerIndex = (_b = (_a = rtWrapper.layerIndices) === null || _a === void 0 ? void 0 : _a[i]) !== null && _b !== void 0 ? _b : 0;
2024
+ const faceIndex = (_d = (_c = rtWrapper.faceIndices) === null || _c === void 0 ? void 0 : _c[i]) !== null && _d !== void 0 ? _d : 0;
2022
2025
  const viewDescriptor = {
2023
2026
  ...this._rttRenderPassWrapper.colorAttachmentViewDescriptor,
2024
2027
  format: gpuMRTWrapper.format,
2028
+ baseArrayLayer: mrtTexture.isCube ? layerIndex * 6 + faceIndex : layerIndex,
2029
+ };
2030
+ const msaaViewDescriptor = {
2031
+ ...this._rttRenderPassWrapper.colorAttachmentViewDescriptor,
2032
+ format: gpuMRTWrapper.format,
2033
+ baseArrayLayer: 0,
2025
2034
  };
2026
- const gpuMSAATexture = gpuMRTWrapper.msaaTexture;
2027
2035
  const colorTextureView = gpuMRTTexture.createView(viewDescriptor);
2028
- const colorMSAATextureView = gpuMSAATexture === null || gpuMSAATexture === void 0 ? void 0 : gpuMSAATexture.createView(viewDescriptor);
2036
+ const colorMSAATextureView = gpuMSAATexture === null || gpuMSAATexture === void 0 ? void 0 : gpuMSAATexture.createView(msaaViewDescriptor);
2029
2037
  colorAttachments.push({
2030
2038
  view: colorMSAATextureView ? colorMSAATextureView : colorTextureView,
2031
2039
  resolveTarget: gpuMSAATexture ? colorTextureView : undefined,
@@ -2044,7 +2052,7 @@ export class WebGPUEngine extends Engine {
2044
2052
  if (internalTexture) {
2045
2053
  const gpuWrapper = internalTexture._hardwareTexture;
2046
2054
  const gpuTexture = gpuWrapper.underlyingResource;
2047
- const gpuMSAATexture = gpuWrapper.msaaTexture;
2055
+ const gpuMSAATexture = gpuWrapper.getMSAATexture();
2048
2056
  const colorTextureView = gpuTexture.createView(this._rttRenderPassWrapper.colorAttachmentViewDescriptor);
2049
2057
  const colorMSAATextureView = gpuMSAATexture === null || gpuMSAATexture === void 0 ? void 0 : gpuMSAATexture.createView(this._rttRenderPassWrapper.colorAttachmentViewDescriptor);
2050
2058
  colorAttachments.push({
@@ -2059,7 +2067,7 @@ export class WebGPUEngine extends Engine {
2059
2067
  colorAttachments.push(null);
2060
2068
  }
2061
2069
  }
2062
- (_a = this._debugPushGroup) === null || _a === void 0 ? void 0 : _a.call(this, "render target pass", 1);
2070
+ (_e = this._debugPushGroup) === null || _e === void 0 ? void 0 : _e.call(this, "render target pass", 1);
2063
2071
  this._rttRenderPassWrapper.renderPassDescriptor = {
2064
2072
  colorAttachments,
2065
2073
  depthStencilAttachment: depthStencilTexture && gpuDepthStencilTexture
@@ -2077,7 +2085,7 @@ export class WebGPUEngine extends Engine {
2077
2085
  stencilStoreOp: !depthTextureHasStencil ? undefined : WebGPUConstants.StoreOp.Store,
2078
2086
  }
2079
2087
  : undefined,
2080
- occlusionQuerySet: ((_b = this._occlusionQuery) === null || _b === void 0 ? void 0 : _b.hasQueries) ? this._occlusionQuery.querySet : undefined,
2088
+ occlusionQuerySet: ((_f = this._occlusionQuery) === null || _f === void 0 ? void 0 : _f.hasQueries) ? this._occlusionQuery.querySet : undefined,
2081
2089
  };
2082
2090
  this._rttRenderPassWrapper.renderPass = this._renderTargetEncoder.beginRenderPass(this._rttRenderPassWrapper.renderPassDescriptor);
2083
2091
  if (this.dbgVerboseLogsForFirstFrames) {
@@ -2090,7 +2098,7 @@ export class WebGPUEngine extends Engine {
2090
2098
  }
2091
2099
  }
2092
2100
  this._currentRenderPass = this._rttRenderPassWrapper.renderPass;
2093
- (_c = this._debugFlushPendingCommands) === null || _c === void 0 ? void 0 : _c.call(this);
2101
+ (_g = this._debugFlushPendingCommands) === null || _g === void 0 ? void 0 : _g.call(this);
2094
2102
  this._resetCurrentViewport(1);
2095
2103
  this._resetCurrentScissor(1);
2096
2104
  this._resetCurrentStencilRef(1);