@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
@@ -17,6 +17,7 @@ import "../../Shaders/shadowMap.fragment";
17
17
  import "../../Shaders/shadowMap.vertex";
18
18
  import "../../Shaders/depthBoxBlur.fragment";
19
19
  import "../../Shaders/ShadersInclude/shadowMapFragmentSoftTransparentShadow";
20
+ import type { BaseTexture } from "../../Materials/Textures/baseTexture";
20
21
  /**
21
22
  * Defines the options associated with the creation of a custom shader for a shadow generator.
22
23
  */
@@ -506,6 +507,7 @@ export declare class ShadowGenerator implements IShadowGenerator {
506
507
  protected _useUBO: boolean;
507
508
  protected _sceneUBOs: UniformBuffer[];
508
509
  protected _currentSceneUBO: UniformBuffer;
510
+ protected _opacityTexture: Nullable<BaseTexture>;
509
511
  /**
510
512
  * @internal
511
513
  */
@@ -832,19 +832,9 @@ export class ShadowGenerator {
832
832
  }
833
833
  else {
834
834
  // Alpha test
835
- if (this.useOpacityTextureForTransparentShadow) {
836
- const opacityTexture = material.opacityTexture;
837
- if (opacityTexture) {
838
- effect.setTexture("diffuseSampler", opacityTexture);
839
- effect.setMatrix("diffuseMatrix", opacityTexture.getTextureMatrix() || this._defaultTextureMatrix);
840
- }
841
- }
842
- else if (material.needAlphaTesting() || material.needAlphaBlending()) {
843
- const alphaTexture = material.getAlphaTestTexture();
844
- if (alphaTexture) {
845
- effect.setTexture("diffuseSampler", alphaTexture);
846
- effect.setMatrix("diffuseMatrix", alphaTexture.getTextureMatrix() || this._defaultTextureMatrix);
847
- }
835
+ if (this._opacityTexture) {
836
+ effect.setTexture("diffuseSampler", this._opacityTexture);
837
+ effect.setMatrix("diffuseMatrix", this._opacityTexture.getTextureMatrix() || this._defaultTextureMatrix);
848
838
  }
849
839
  // Bones
850
840
  if (renderingMesh.useBones && renderingMesh.computeBonesUsingShaders && renderingMesh.skeleton) {
@@ -1015,6 +1005,7 @@ export class ShadowGenerator {
1015
1005
  isReady(subMesh, useInstances, isTransparent) {
1016
1006
  var _a;
1017
1007
  const material = subMesh.getMaterial(), shadowDepthWrapper = material === null || material === void 0 ? void 0 : material.shadowDepthWrapper;
1008
+ this._opacityTexture = null;
1018
1009
  if (!material) {
1019
1010
  return false;
1020
1011
  }
@@ -1040,18 +1031,16 @@ export class ShadowGenerator {
1040
1031
  }
1041
1032
  }
1042
1033
  // Alpha test
1043
- const needAlphaTesting = material === null || material === void 0 ? void 0 : material.needAlphaTesting();
1044
- const needAlphaBlending = material === null || material === void 0 ? void 0 : material.needAlphaBlending();
1045
- if (material && (needAlphaTesting || needAlphaBlending)) {
1046
- let alphaTexture = null;
1034
+ const needAlphaTesting = material.needAlphaTesting();
1035
+ if (needAlphaTesting || material.needAlphaBlending()) {
1047
1036
  if (this.useOpacityTextureForTransparentShadow) {
1048
- alphaTexture = material.opacityTexture;
1037
+ this._opacityTexture = material.opacityTexture;
1049
1038
  }
1050
1039
  else {
1051
- alphaTexture = material.getAlphaTestTexture();
1040
+ this._opacityTexture = material.getAlphaTestTexture();
1052
1041
  }
1053
- if (alphaTexture) {
1054
- if (!alphaTexture.isReady()) {
1042
+ if (this._opacityTexture) {
1043
+ if (!this._opacityTexture.isReady()) {
1055
1044
  return false;
1056
1045
  }
1057
1046
  const alphaCutOff = (_a = material.alphaCutOff) !== null && _a !== void 0 ? _a : ShadowGenerator.DEFAULT_ALPHA_CUTOFF;
@@ -1064,7 +1053,7 @@ export class ShadowGenerator {
1064
1053
  defines.push("#define UV1");
1065
1054
  }
1066
1055
  if (mesh.isVerticesDataPresent(VertexBuffer.UV2Kind)) {
1067
- if (alphaTexture.coordinatesIndex === 1) {
1056
+ if (this._opacityTexture.coordinatesIndex === 1) {
1068
1057
  attribs.push(VertexBuffer.UV2Kind);
1069
1058
  defines.push("#define UV2");
1070
1059
  }