@babylonjs/core 7.10.2 → 7.10.3

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 (86) hide show
  1. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.d.ts +3 -0
  2. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +4 -2
  3. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
  4. package/Engines/abstractEngine.js +2 -2
  5. package/Engines/abstractEngine.js.map +1 -1
  6. package/Engines/nativeEngine.d.ts +3 -1
  7. package/Engines/nativeEngine.js +2 -1
  8. package/Engines/nativeEngine.js.map +1 -1
  9. package/Engines/thinEngine.d.ts +2 -1
  10. package/Engines/thinEngine.js +2 -4
  11. package/Engines/thinEngine.js.map +1 -1
  12. package/Layers/effectLayer.js +1 -1
  13. package/Layers/effectLayer.js.map +1 -1
  14. package/Lights/Shadows/shadowGenerator.js +1 -1
  15. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  16. package/Loading/sceneLoader.d.ts +20 -11
  17. package/Loading/sceneLoader.js +10 -19
  18. package/Loading/sceneLoader.js.map +1 -1
  19. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js +5 -3
  20. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
  21. package/Materials/Node/Blocks/Input/inputBlock.js +3 -0
  22. package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
  23. package/Materials/Node/Blocks/Particle/particleBlendMultiplyBlock.js +2 -3
  24. package/Materials/Node/Blocks/Particle/particleBlendMultiplyBlock.js.map +1 -1
  25. package/Materials/Node/Blocks/Particle/particleRampGradientBlock.js +6 -11
  26. package/Materials/Node/Blocks/Particle/particleRampGradientBlock.js.map +1 -1
  27. package/Materials/Node/Blocks/Particle/particleTextureBlock.d.ts +1 -2
  28. package/Materials/Node/Blocks/Particle/particleTextureBlock.js +1 -1
  29. package/Materials/Node/Blocks/Particle/particleTextureBlock.js.map +1 -1
  30. package/Materials/Node/nodeMaterial.js +1 -1
  31. package/Materials/Node/nodeMaterial.js.map +1 -1
  32. package/Materials/Node/nodeMaterialBuildState.d.ts +9 -1
  33. package/Materials/Node/nodeMaterialBuildState.js +25 -1
  34. package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
  35. package/Materials/material.d.ts +3 -1
  36. package/Materials/material.js +8 -6
  37. package/Materials/material.js.map +1 -1
  38. package/Meshes/Builders/decalBuilder.js +1 -2
  39. package/Meshes/Builders/decalBuilder.js.map +1 -1
  40. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.d.ts +10 -0
  41. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js +73 -3
  42. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js.map +1 -1
  43. package/Meshes/mesh.d.ts +3 -2
  44. package/Meshes/mesh.js +18 -20
  45. package/Meshes/mesh.js.map +1 -1
  46. package/Misc/filesInput.js +13 -0
  47. package/Misc/filesInput.js.map +1 -1
  48. package/Particles/particleSystemComponent.d.ts +3 -1
  49. package/Particles/particleSystemComponent.js +3 -2
  50. package/Particles/particleSystemComponent.js.map +1 -1
  51. package/Physics/v2/IPhysicsEnginePlugin.d.ts +7 -2
  52. package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -1
  53. package/Physics/v2/Plugins/havokPlugin.d.ts +1 -0
  54. package/Physics/v2/Plugins/havokPlugin.js +43 -0
  55. package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
  56. package/Physics/v2/physicsAggregate.js +1 -0
  57. package/Physics/v2/physicsAggregate.js.map +1 -1
  58. package/Physics/v2/physicsShape.d.ts +27 -0
  59. package/Physics/v2/physicsShape.js +39 -0
  60. package/Physics/v2/physicsShape.js.map +1 -1
  61. package/Rendering/depthRenderer.js +1 -1
  62. package/Rendering/depthRenderer.js.map +1 -1
  63. package/Rendering/geometryBufferRenderer.js +2 -5
  64. package/Rendering/geometryBufferRenderer.js.map +1 -1
  65. package/ShadersWGSL/ShadersInclude/fogVertex.d.ts +5 -0
  66. package/ShadersWGSL/ShadersInclude/fogVertex.js +12 -0
  67. package/ShadersWGSL/ShadersInclude/fogVertex.js.map +1 -0
  68. package/ShadersWGSL/ShadersInclude/fogVertexDeclaration.d.ts +5 -0
  69. package/ShadersWGSL/ShadersInclude/fogVertexDeclaration.js +12 -0
  70. package/ShadersWGSL/ShadersInclude/fogVertexDeclaration.js.map +1 -0
  71. package/ShadersWGSL/ShadersInclude/imageProcessingDeclaration.d.ts +5 -0
  72. package/ShadersWGSL/ShadersInclude/imageProcessingDeclaration.js +35 -0
  73. package/ShadersWGSL/ShadersInclude/imageProcessingDeclaration.js.map +1 -0
  74. package/ShadersWGSL/ShadersInclude/imageProcessingFunctions.d.ts +5 -0
  75. package/ShadersWGSL/ShadersInclude/imageProcessingFunctions.js +70 -0
  76. package/ShadersWGSL/ShadersInclude/imageProcessingFunctions.js.map +1 -0
  77. package/ShadersWGSL/ShadersInclude/logDepthDeclaration.d.ts +5 -0
  78. package/ShadersWGSL/ShadersInclude/logDepthDeclaration.js +12 -0
  79. package/ShadersWGSL/ShadersInclude/logDepthDeclaration.js.map +1 -0
  80. package/ShadersWGSL/ShadersInclude/logDepthVertex.d.ts +5 -0
  81. package/ShadersWGSL/ShadersInclude/logDepthVertex.js +12 -0
  82. package/ShadersWGSL/ShadersInclude/logDepthVertex.js.map +1 -0
  83. package/ShadersWGSL/particles.vertex.d.ts +11 -0
  84. package/ShadersWGSL/particles.vertex.js +89 -0
  85. package/ShadersWGSL/particles.vertex.js.map +1 -0
  86. package/package.json +1 -1
package/Meshes/mesh.js CHANGED
@@ -262,7 +262,7 @@ export class Mesh extends AbstractMesh {
262
262
  this._instanceDataStorage.forceMatrixUpdates = value;
263
263
  }
264
264
  /**
265
- * @constructor
265
+ * Constructor
266
266
  * @param name The value used by scene.getMeshByName() to do a lookup.
267
267
  * @param scene The scene to add this mesh to.
268
268
  * @param parent The parent of this mesh, if it has one
@@ -303,10 +303,6 @@ export class Mesh extends AbstractMesh {
303
303
  // Use by builder only to know what orientation were the mesh build in.
304
304
  /** @internal */
305
305
  this._originalBuilderSideOrientation = Mesh.DEFAULTSIDE;
306
- /**
307
- * Use this property to change the original side orientation defined at construction time
308
- */
309
- this.overrideMaterialSideOrientation = null;
310
306
  /**
311
307
  * Gets or sets a boolean indicating whether to render ignoring the active camera's max z setting. (false by default)
312
308
  * You should not mix meshes that have this property set to true with meshes that have it set to false if they all write
@@ -316,6 +312,12 @@ export class Mesh extends AbstractMesh {
316
312
  */
317
313
  this.ignoreCameraMaxZ = false;
318
314
  scene = this.getScene();
315
+ if (this._scene.useRightHandedSystem) {
316
+ this.sideOrientation = 0;
317
+ }
318
+ else {
319
+ this.sideOrientation = 1;
320
+ }
319
321
  this._onBeforeDraw = (isInstance, world, effectiveMaterial) => {
320
322
  if (isInstance && effectiveMaterial) {
321
323
  if (this._uniformBuffer) {
@@ -1906,14 +1908,11 @@ export class Mesh extends AbstractMesh {
1906
1908
  let sideOrientation;
1907
1909
  if (!instanceDataStorage.isFrozen &&
1908
1910
  (this._internalMeshDataInfo._effectiveMaterial.backFaceCulling ||
1909
- this.overrideMaterialSideOrientation !== null ||
1911
+ this._internalMeshDataInfo._effectiveMaterial.sideOrientation !== null ||
1910
1912
  this._internalMeshDataInfo._effectiveMaterial.twoSidedLighting)) {
1911
1913
  // Note: if two sided lighting is enabled, we need to ensure that the normal will point in the right direction even if the determinant of the world matrix is negative
1912
1914
  const mainDeterminant = effectiveMesh._getWorldMatrixDeterminant();
1913
- sideOrientation = this.overrideMaterialSideOrientation;
1914
- if (sideOrientation == null) {
1915
- sideOrientation = this._internalMeshDataInfo._effectiveMaterial.sideOrientation;
1916
- }
1915
+ sideOrientation = this._internalMeshDataInfo._effectiveMaterial._getEffectiveOrientation(this);
1917
1916
  if (mainDeterminant < 0) {
1918
1917
  sideOrientation = sideOrientation === Material.ClockWiseSideOrientation ? Material.CounterClockWiseSideOrientation : Material.ClockWiseSideOrientation;
1919
1918
  }
@@ -2493,8 +2492,7 @@ export class Mesh extends AbstractMesh {
2493
2492
  const normals = new Float32Array(indices.length * 3);
2494
2493
  let normalsCount = 0;
2495
2494
  // Decide if normals should be flipped
2496
- const flipNormalGeneration = this.overrideMaterialSideOrientation ===
2497
- (this._scene.useRightHandedSystem ? 1 : 0);
2495
+ const flipNormalGeneration = this.sideOrientation === (this._scene.useRightHandedSystem ? 1 : 0);
2498
2496
  // Generate new normals
2499
2497
  for (let index = 0; index < indices.length; index += 3) {
2500
2498
  const p1 = Vector3.FromArray(positions, indices[index] * 3);
@@ -3027,7 +3025,7 @@ export class Mesh extends AbstractMesh {
3027
3025
  serializationObject.ellipsoidOffset = this.ellipsoidOffset.asArray();
3028
3026
  serializationObject.doNotSyncBoundingInfo = this.doNotSyncBoundingInfo;
3029
3027
  serializationObject.isBlocker = this.isBlocker;
3030
- serializationObject.overrideMaterialSideOrientation = this.overrideMaterialSideOrientation;
3028
+ serializationObject.sideOrientation = this.sideOrientation;
3031
3029
  // Parent
3032
3030
  if (this.parent) {
3033
3031
  this.parent._serializeAsParent(serializationObject);
@@ -3314,8 +3312,8 @@ export class Mesh extends AbstractMesh {
3314
3312
  if (parsedMesh.ellipsoidOffset) {
3315
3313
  mesh.ellipsoidOffset = Vector3.FromArray(parsedMesh.ellipsoidOffset);
3316
3314
  }
3317
- if (parsedMesh.overrideMaterialSideOrientation !== undefined) {
3318
- mesh.overrideMaterialSideOrientation = parsedMesh.overrideMaterialSideOrientation;
3315
+ if (parsedMesh.sideOrientation !== undefined) {
3316
+ mesh.sideOrientation = parsedMesh.sideOrientation;
3319
3317
  }
3320
3318
  if (parsedMesh.isBlocker !== undefined) {
3321
3319
  mesh.isBlocker = parsedMesh.isBlocker;
@@ -3771,15 +3769,15 @@ export class Mesh extends AbstractMesh {
3771
3769
  const materialIndexArray = new Array();
3772
3770
  // Merge
3773
3771
  const indiceArray = new Array();
3774
- const currentOverrideMaterialSideOrientation = meshes[0].overrideMaterialSideOrientation;
3772
+ const currentsideOrientation = meshes[0].sideOrientation;
3775
3773
  for (index = 0; index < meshes.length; index++) {
3776
3774
  const mesh = meshes[index];
3777
3775
  if (mesh.isAnInstance) {
3778
3776
  Logger.Warn("Cannot merge instance meshes.");
3779
3777
  return null;
3780
3778
  }
3781
- if (currentOverrideMaterialSideOrientation !== mesh.overrideMaterialSideOrientation) {
3782
- Logger.Warn("Cannot merge meshes with different overrideMaterialSideOrientation values.");
3779
+ if (currentsideOrientation !== mesh.sideOrientation) {
3780
+ Logger.Warn("Cannot merge meshes with different sideOrientation values.");
3783
3781
  return null;
3784
3782
  }
3785
3783
  if (subdivideWithSubMeshes) {
@@ -3856,7 +3854,7 @@ export class Mesh extends AbstractMesh {
3856
3854
  }
3857
3855
  // Setting properties
3858
3856
  meshSubclass.checkCollisions = source.checkCollisions;
3859
- meshSubclass.overrideMaterialSideOrientation = source.overrideMaterialSideOrientation;
3857
+ meshSubclass.sideOrientation = source.sideOrientation;
3860
3858
  // Cleaning
3861
3859
  if (disposeSource) {
3862
3860
  for (index = 0; index < meshes.length; index++) {
@@ -3918,7 +3916,7 @@ export class Mesh extends AbstractMesh {
3918
3916
  }
3919
3917
  /** @internal */
3920
3918
  _shouldConvertRHS() {
3921
- return this.overrideMaterialSideOrientation === Material.CounterClockWiseSideOrientation;
3919
+ return this._scene.useRightHandedSystem && this.sideOrientation === Material.CounterClockWiseSideOrientation;
3922
3920
  }
3923
3921
  /** @internal */
3924
3922
  _getRenderingFillMode(fillMode) {