@babylonjs/core 6.2.0 → 6.3.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 (58) hide show
  1. package/Engines/WebGPU/webgpuHardwareTexture.js +1 -1
  2. package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
  3. package/Engines/thinEngine.js +21 -4
  4. package/Engines/thinEngine.js.map +1 -1
  5. package/Engines/webgpuEngine.js +1 -6
  6. package/Engines/webgpuEngine.js.map +1 -1
  7. package/Gizmos/gizmo.js +1 -0
  8. package/Gizmos/gizmo.js.map +1 -1
  9. package/Materials/Node/Blocks/PBR/refractionBlock.js +2 -2
  10. package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
  11. package/Materials/Node/Blocks/triPlanarBlock.d.ts +4 -0
  12. package/Materials/Node/Blocks/triPlanarBlock.js +44 -6
  13. package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
  14. package/Materials/PBR/pbrMaterial.d.ts +2 -1
  15. package/Materials/PBR/pbrMaterial.js +3 -2
  16. package/Materials/PBR/pbrMaterial.js.map +1 -1
  17. package/Materials/PBR/pbrSubSurfaceConfiguration.js +2 -2
  18. package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
  19. package/Materials/Textures/baseTexture.d.ts +6 -0
  20. package/Materials/Textures/baseTexture.js +8 -0
  21. package/Materials/Textures/baseTexture.js.map +1 -1
  22. package/Materials/Textures/cubeTexture.d.ts +7 -0
  23. package/Materials/Textures/cubeTexture.js +25 -2
  24. package/Materials/Textures/cubeTexture.js.map +1 -1
  25. package/Materials/standardMaterial.d.ts +2 -1
  26. package/Materials/standardMaterial.js +3 -2
  27. package/Materials/standardMaterial.js.map +1 -1
  28. package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.d.ts +4 -0
  29. package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js +19 -4
  30. package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js.map +1 -1
  31. package/Misc/decorators.d.ts +5 -1
  32. package/Misc/decorators.js +12 -4
  33. package/Misc/decorators.js.map +1 -1
  34. package/Misc/error.d.ts +1 -1
  35. package/Misc/error.js.map +1 -1
  36. package/Misc/tools.d.ts +6 -6
  37. package/Misc/tools.js +17 -14
  38. package/Misc/tools.js.map +1 -1
  39. package/Physics/physicsRaycastResult.js +6 -6
  40. package/Physics/physicsRaycastResult.js.map +1 -1
  41. package/Physics/v2/IPhysicsEnginePlugin.d.ts +2 -0
  42. package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -1
  43. package/Physics/v2/Plugins/havokPlugin.d.ts +16 -1
  44. package/Physics/v2/Plugins/havokPlugin.js +43 -3
  45. package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
  46. package/Physics/v2/physicsAggregate.d.ts +0 -50
  47. package/Physics/v2/physicsAggregate.js +3 -2
  48. package/Physics/v2/physicsAggregate.js.map +1 -1
  49. package/Physics/v2/physicsBody.d.ts +12 -0
  50. package/Physics/v2/physicsBody.js +17 -1
  51. package/Physics/v2/physicsBody.js.map +1 -1
  52. package/assetContainer.d.ts +2 -3
  53. package/assetContainer.js +13 -4
  54. package/assetContainer.js.map +1 -1
  55. package/node.d.ts +8 -0
  56. package/node.js +23 -1
  57. package/node.js.map +1 -1
  58. package/package.json +1 -1
@@ -21,7 +21,7 @@ export class WebGPUHardwareTexture {
21
21
  releaseMSAATexture() {
22
22
  if (this._webgpuMSAATexture) {
23
23
  for (const texture of this._webgpuMSAATexture) {
24
- texture.destroy();
24
+ texture === null || texture === void 0 ? void 0 : texture.destroy();
25
25
  }
26
26
  this._webgpuMSAATexture = null;
27
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"webgpuHardwareTexture.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Engines/WebGPU/webgpuHardwareTexture.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,OAAO,KAAK,eAAe,MAAM,mBAA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,MAAA,IAAI,CAAC,cAAc,0CAAE,OAAO,EAAE,CAAC;QAC/B,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1B,MAAA,IAAI,CAAC,uBAAuB,0CAAE,OAAO,EAAE,CAAC;QACxC,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;CACJ","sourcesContent":["import type { HardwareTextureWrapper } from \"../../Materials/Textures/hardwareTextureWrapper\";\r\nimport { Scalar } from \"../../Maths/math.scalar\";\r\nimport type { Nullable } from \"../../types\";\r\nimport * as WebGPUConstants from \"./webgpuConstants\";\r\n\r\ndeclare type WebGPUBundleList = import(\"./webgpuBundleList\").WebGPUBundleList;\r\n\r\n/** @internal */\r\nexport class WebGPUHardwareTexture implements HardwareTextureWrapper {\r\n /**\r\n * List of bundles collected in the snapshot rendering mode when the texture is a render target texture\r\n * The index in this array is the current layer we are rendering into\r\n * @internal\r\n */\r\n public _bundleLists: WebGPUBundleList[];\r\n /**\r\n * Current layer we are rendering into when in snapshot rendering mode (if the texture is a render target texture)\r\n * @internal\r\n */\r\n public _currentLayer: number;\r\n\r\n /**\r\n * Cache of RenderPassDescriptor and BindGroup used when generating mipmaps (see WebGPUTextureHelper.generateMipmaps)\r\n * @internal\r\n */\r\n public _mipmapGenRenderPassDescr: GPURenderPassDescriptor[][];\r\n /** @internal */\r\n public _mipmapGenBindGroup: GPUBindGroup[][];\r\n\r\n /**\r\n * Cache for the invertYPreMultiplyAlpha function (see WebGPUTextureHelper)\r\n * @internal\r\n */\r\n public _copyInvertYTempTexture?: GPUTexture;\r\n /** @internal */\r\n public _copyInvertYRenderPassDescr: GPURenderPassDescriptor;\r\n /** @internal */\r\n public _copyInvertYBindGroup: GPUBindGroup;\r\n /** @internal */\r\n public _copyInvertYBindGroupWithOfst: GPUBindGroup;\r\n\r\n private _webgpuTexture: Nullable<GPUTexture>;\r\n // There can be multiple MSAA textures for a single WebGPU texture because different layers of a 2DArrayTexture / 3DTexture\r\n // or different faces of a cube texture can be bound to different render targets at the same time (in a multi RenderTargetWrapper)\r\n private _webgpuMSAATexture: Nullable<GPUTexture[]>;\r\n\r\n public get underlyingResource(): Nullable<GPUTexture> {\r\n return this._webgpuTexture;\r\n }\r\n\r\n public getMSAATexture(index = 0): Nullable<GPUTexture> {\r\n return this._webgpuMSAATexture?.[index] ?? null;\r\n }\r\n\r\n public setMSAATexture(texture: GPUTexture, index = -1) {\r\n if (!this._webgpuMSAATexture) {\r\n this._webgpuMSAATexture = [];\r\n }\r\n\r\n if (index === -1) {\r\n index = this._webgpuMSAATexture.length;\r\n }\r\n\r\n this._webgpuMSAATexture![index] = texture;\r\n }\r\n\r\n public releaseMSAATexture() {\r\n if (this._webgpuMSAATexture) {\r\n for (const texture of this._webgpuMSAATexture) {\r\n texture.destroy();\r\n }\r\n this._webgpuMSAATexture = null;\r\n }\r\n }\r\n\r\n public view: Nullable<GPUTextureView>;\r\n public viewForWriting: Nullable<GPUTextureView>;\r\n public format: GPUTextureFormat = WebGPUConstants.TextureFormat.RGBA8Unorm;\r\n public textureUsages = 0;\r\n public textureAdditionalUsages = 0;\r\n\r\n constructor(existingTexture: Nullable<GPUTexture> = null) {\r\n this._webgpuTexture = existingTexture;\r\n this._webgpuMSAATexture = null;\r\n this.view = null;\r\n this.viewForWriting = null;\r\n }\r\n\r\n public set(hardwareTexture: GPUTexture): void {\r\n this._webgpuTexture = hardwareTexture;\r\n }\r\n\r\n public setUsage(_textureSource: number, generateMipMaps: boolean, isCube: boolean, width: number, height: number): void {\r\n this.createView({\r\n format: this.format,\r\n dimension: isCube ? WebGPUConstants.TextureViewDimension.Cube : WebGPUConstants.TextureViewDimension.E2d,\r\n mipLevelCount: generateMipMaps ? Scalar.ILog2(Math.max(width, height)) + 1 : 1,\r\n baseArrayLayer: 0,\r\n baseMipLevel: 0,\r\n arrayLayerCount: isCube ? 6 : 1,\r\n aspect: WebGPUConstants.TextureAspect.All,\r\n });\r\n }\r\n\r\n public createView(descriptor?: GPUTextureViewDescriptor, createViewForWriting = false): void {\r\n this.view = this._webgpuTexture!.createView(descriptor);\r\n if (createViewForWriting && descriptor) {\r\n const saveNumMipMaps = descriptor.mipLevelCount;\r\n descriptor.mipLevelCount = 1;\r\n this.viewForWriting = this._webgpuTexture!.createView(descriptor);\r\n descriptor.mipLevelCount = saveNumMipMaps;\r\n }\r\n }\r\n\r\n public reset(): void {\r\n this._webgpuTexture = null;\r\n this._webgpuMSAATexture = null;\r\n this.view = null;\r\n this.viewForWriting = null;\r\n }\r\n\r\n public release(): void {\r\n this._webgpuTexture?.destroy();\r\n this.releaseMSAATexture();\r\n this._copyInvertYTempTexture?.destroy();\r\n this.reset();\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"webgpuHardwareTexture.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Engines/WebGPU/webgpuHardwareTexture.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,OAAO,KAAK,eAAe,MAAM,mBAAmB,CAAC;AAIrD,gBAAgB;AAChB,MAAM,OAAO,qBAAqB;IAsC9B,IAAW,kBAAkB;QACzB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAEM,cAAc,CAAC,KAAK,GAAG,CAAC;;QAC3B,OAAO,MAAA,MAAA,IAAI,CAAC,kBAAkB,0CAAG,KAAK,CAAC,mCAAI,IAAI,CAAC;IACpD,CAAC;IAEM,cAAc,CAAC,OAAmB,EAAE,KAAK,GAAG,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE;YAC1B,IAAI,CAAC,kBAAkB,GAAG,EAAE,CAAC;SAChC;QAED,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;YACd,KAAK,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC;SAC1C;QAED,IAAI,CAAC,kBAAmB,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC;IAC9C,CAAC;IAEM,kBAAkB;QACrB,IAAI,I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,CAAC;IACP,CAAC;IAEM,UAAU,CAAC,UAAqC,EAAE,oBAAoB,GAAG,KAAK;QACjF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,cAAe,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACxD,IAAI,oBAAoB,IAAI,UAAU,EAAE;YACpC,MAAM,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;YAChD,UAAU,CAAC,aAAa,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAe,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;YAClE,UAAU,CAAC,aAAa,GAAG,cAAc,CAAC;SAC7C;IACL,CAAC;IAEM,KAAK;QACR,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;IAC/B,CAAC;IAEM,OAAO;;QACV,MAAA,IAAI,CAAC,cAAc,0CAAE,OAAO,EAAE,CAAC;QAC/B,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1B,MAAA,IAAI,CAAC,uBAAuB,0CAAE,OAAO,EAAE,CAAC;QACxC,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;CACJ","sourcesContent":["import type { HardwareTextureWrapper } from \"../../Materials/Textures/hardwareTextureWrapper\";\r\nimport { Scalar } from \"../../Maths/math.scalar\";\r\nimport type { Nullable } from \"../../types\";\r\nimport * as WebGPUConstants from \"./webgpuConstants\";\r\n\r\ndeclare type WebGPUBundleList = import(\"./webgpuBundleList\").WebGPUBundleList;\r\n\r\n/** @internal */\r\nexport class WebGPUHardwareTexture implements HardwareTextureWrapper {\r\n /**\r\n * List of bundles collected in the snapshot rendering mode when the texture is a render target texture\r\n * The index in this array is the current layer we are rendering into\r\n * @internal\r\n */\r\n public _bundleLists: WebGPUBundleList[];\r\n /**\r\n * Current layer we are rendering into when in snapshot rendering mode (if the texture is a render target texture)\r\n * @internal\r\n */\r\n public _currentLayer: number;\r\n\r\n /**\r\n * Cache of RenderPassDescriptor and BindGroup used when generating mipmaps (see WebGPUTextureHelper.generateMipmaps)\r\n * @internal\r\n */\r\n public _mipmapGenRenderPassDescr: GPURenderPassDescriptor[][];\r\n /** @internal */\r\n public _mipmapGenBindGroup: GPUBindGroup[][];\r\n\r\n /**\r\n * Cache for the invertYPreMultiplyAlpha function (see WebGPUTextureHelper)\r\n * @internal\r\n */\r\n public _copyInvertYTempTexture?: GPUTexture;\r\n /** @internal */\r\n public _copyInvertYRenderPassDescr: GPURenderPassDescriptor;\r\n /** @internal */\r\n public _copyInvertYBindGroup: GPUBindGroup;\r\n /** @internal */\r\n public _copyInvertYBindGroupWithOfst: GPUBindGroup;\r\n\r\n private _webgpuTexture: Nullable<GPUTexture>;\r\n // There can be multiple MSAA textures for a single WebGPU texture because different layers of a 2DArrayTexture / 3DTexture\r\n // or different faces of a cube texture can be bound to different render targets at the same time (in a multi RenderTargetWrapper)\r\n private _webgpuMSAATexture: Nullable<GPUTexture[]>;\r\n\r\n public get underlyingResource(): Nullable<GPUTexture> {\r\n return this._webgpuTexture;\r\n }\r\n\r\n public getMSAATexture(index = 0): Nullable<GPUTexture> {\r\n return this._webgpuMSAATexture?.[index] ?? null;\r\n }\r\n\r\n public setMSAATexture(texture: GPUTexture, index = -1) {\r\n if (!this._webgpuMSAATexture) {\r\n this._webgpuMSAATexture = [];\r\n }\r\n\r\n if (index === -1) {\r\n index = this._webgpuMSAATexture.length;\r\n }\r\n\r\n this._webgpuMSAATexture![index] = texture;\r\n }\r\n\r\n public releaseMSAATexture() {\r\n if (this._webgpuMSAATexture) {\r\n for (const texture of this._webgpuMSAATexture) {\r\n texture?.destroy();\r\n }\r\n this._webgpuMSAATexture = null;\r\n }\r\n }\r\n\r\n public view: Nullable<GPUTextureView>;\r\n public viewForWriting: Nullable<GPUTextureView>;\r\n public format: GPUTextureFormat = WebGPUConstants.TextureFormat.RGBA8Unorm;\r\n public textureUsages = 0;\r\n public textureAdditionalUsages = 0;\r\n\r\n constructor(existingTexture: Nullable<GPUTexture> = null) {\r\n this._webgpuTexture = existingTexture;\r\n this._webgpuMSAATexture = null;\r\n this.view = null;\r\n this.viewForWriting = null;\r\n }\r\n\r\n public set(hardwareTexture: GPUTexture): void {\r\n this._webgpuTexture = hardwareTexture;\r\n }\r\n\r\n public setUsage(_textureSource: number, generateMipMaps: boolean, isCube: boolean, width: number, height: number): void {\r\n this.createView({\r\n format: this.format,\r\n dimension: isCube ? WebGPUConstants.TextureViewDimension.Cube : WebGPUConstants.TextureViewDimension.E2d,\r\n mipLevelCount: generateMipMaps ? Scalar.ILog2(Math.max(width, height)) + 1 : 1,\r\n baseArrayLayer: 0,\r\n baseMipLevel: 0,\r\n arrayLayerCount: isCube ? 6 : 1,\r\n aspect: WebGPUConstants.TextureAspect.All,\r\n });\r\n }\r\n\r\n public createView(descriptor?: GPUTextureViewDescriptor, createViewForWriting = false): void {\r\n this.view = this._webgpuTexture!.createView(descriptor);\r\n if (createViewForWriting && descriptor) {\r\n const saveNumMipMaps = descriptor.mipLevelCount;\r\n descriptor.mipLevelCount = 1;\r\n this.viewForWriting = this._webgpuTexture!.createView(descriptor);\r\n descriptor.mipLevelCount = saveNumMipMaps;\r\n }\r\n }\r\n\r\n public reset(): void {\r\n this._webgpuTexture = null;\r\n this._webgpuMSAATexture = null;\r\n this.view = null;\r\n this.viewForWriting = null;\r\n }\r\n\r\n public release(): void {\r\n this._webgpuTexture?.destroy();\r\n this.releaseMSAATexture();\r\n this._copyInvertYTempTexture?.destroy();\r\n this.reset();\r\n }\r\n}\r\n"]}
@@ -34,13 +34,13 @@ export class ThinEngine {
34
34
  */
35
35
  // Not mixed with Version for tooling purpose.
36
36
  static get NpmPackage() {
37
- return "babylonjs@6.2.0";
37
+ return "babylonjs@6.3.0";
38
38
  }
39
39
  /**
40
40
  * Returns the current version of the framework
41
41
  */
42
42
  static get Version() {
43
- return "6.2.0";
43
+ return "6.3.0";
44
44
  }
45
45
  /**
46
46
  * Returns a string describing the current engine
@@ -1288,8 +1288,21 @@ export class ThinEngine {
1288
1288
  this._hardwareScalingLevel *= changeRatio;
1289
1289
  }
1290
1290
  if (IsWindowObjectExist()) {
1291
- width = this._renderingCanvas ? this._renderingCanvas.clientWidth || this._renderingCanvas.width : window.innerWidth;
1292
- height = this._renderingCanvas ? this._renderingCanvas.clientHeight || this._renderingCanvas.height : window.innerHeight;
1291
+ if (this._renderingCanvas) {
1292
+ const boundingRect = this._renderingCanvas.getBoundingClientRect
1293
+ ? this._renderingCanvas.getBoundingClientRect()
1294
+ : {
1295
+ // fallback to last solution in case the function doesn't exist
1296
+ width: this._renderingCanvas.width * this._hardwareScalingLevel,
1297
+ height: this._renderingCanvas.height * this._hardwareScalingLevel,
1298
+ };
1299
+ width = this._renderingCanvas.clientWidth || boundingRect.width;
1300
+ height = this._renderingCanvas.clientHeight || boundingRect.height;
1301
+ }
1302
+ else {
1303
+ width = window.innerWidth;
1304
+ height = window.innerHeight;
1305
+ }
1293
1306
  }
1294
1307
  else {
1295
1308
  width = this._renderingCanvas ? this._renderingCanvas.width : 100;
@@ -3943,6 +3956,10 @@ export class ThinEngine {
3943
3956
  // Video
3944
3957
  if (texture.video) {
3945
3958
  this._activeChannel = channel;
3959
+ const videoInternalTexture = texture.getInternalTexture();
3960
+ if (videoInternalTexture) {
3961
+ videoInternalTexture._associatedChannel = channel;
3962
+ }
3946
3963
  texture.update();
3947
3964
  }
3948
3965
  else if (texture.delayLoadState === 4) {