@babylonjs/core 5.25.0 → 5.26.1

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 (109) hide show
  1. package/Audio/audioEngine.js +1 -2
  2. package/Audio/audioEngine.js.map +1 -1
  3. package/Cameras/Inputs/freeCameraDeviceOrientationInput.d.ts +4 -1
  4. package/Cameras/Inputs/freeCameraDeviceOrientationInput.js +17 -4
  5. package/Cameras/Inputs/freeCameraDeviceOrientationInput.js.map +1 -1
  6. package/Cameras/VR/vrExperienceHelper.js +1 -24
  7. package/Cameras/VR/vrExperienceHelper.js.map +1 -1
  8. package/Culling/Octrees/octreeSceneComponent.js +1 -5
  9. package/Culling/Octrees/octreeSceneComponent.js.map +1 -1
  10. package/DeviceInput/webDeviceInputSystem.js +0 -18
  11. package/DeviceInput/webDeviceInputSystem.js.map +1 -1
  12. package/Engines/Extensions/engine.cubeTexture.js +3 -2
  13. package/Engines/Extensions/engine.cubeTexture.js.map +1 -1
  14. package/Engines/engine.js +3 -34
  15. package/Engines/engine.js.map +1 -1
  16. package/Engines/thinEngine.js +2 -14
  17. package/Engines/thinEngine.js.map +1 -1
  18. package/Gamepads/gamepadManager.js +2 -2
  19. package/Gamepads/gamepadManager.js.map +1 -1
  20. package/Layers/layer.d.ts +7 -0
  21. package/Layers/layer.js +11 -0
  22. package/Layers/layer.js.map +1 -1
  23. package/Layers/layerSceneComponent.d.ts +4 -2
  24. package/Layers/layerSceneComponent.js +27 -11
  25. package/Layers/layerSceneComponent.js.map +1 -1
  26. package/Loading/loadingScreen.js +6 -6
  27. package/Loading/loadingScreen.js.map +1 -1
  28. package/Materials/Node/nodeMaterialBlockConnectionPoint.d.ts +1 -2
  29. package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
  30. package/Materials/Textures/renderTargetTexture.js +3 -0
  31. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  32. package/Materials/Textures/thinRenderTargetTexture.js +1 -1
  33. package/Materials/Textures/thinRenderTargetTexture.js.map +1 -1
  34. package/Materials/Textures/videoTexture.js +2 -2
  35. package/Materials/Textures/videoTexture.js.map +1 -1
  36. package/Materials/material.js +5 -2
  37. package/Materials/material.js.map +1 -1
  38. package/Materials/materialHelper.js +1 -6
  39. package/Materials/materialHelper.js.map +1 -1
  40. package/Maths/math.vector.d.ts +47 -10
  41. package/Maths/math.vector.js +89 -10
  42. package/Maths/math.vector.js.map +1 -1
  43. package/Meshes/instancedMesh.js +1 -1
  44. package/Meshes/instancedMesh.js.map +1 -1
  45. package/Meshes/mesh.d.ts +1 -1
  46. package/Meshes/mesh.js +4 -6
  47. package/Meshes/mesh.js.map +1 -1
  48. package/Meshes/subMesh.d.ts +2 -0
  49. package/Meshes/subMesh.js +2 -0
  50. package/Meshes/subMesh.js.map +1 -1
  51. package/Misc/tools.d.ts +9 -0
  52. package/Misc/tools.js +14 -5
  53. package/Misc/tools.js.map +1 -1
  54. package/Misc/virtualJoystick.js +0 -1
  55. package/Misc/virtualJoystick.js.map +1 -1
  56. package/Particles/IParticleSystem.d.ts +6 -0
  57. package/Particles/IParticleSystem.js.map +1 -1
  58. package/Particles/baseParticleSystem.d.ts +8 -0
  59. package/Particles/baseParticleSystem.js +12 -0
  60. package/Particles/baseParticleSystem.js.map +1 -1
  61. package/Particles/gpuParticleSystem.d.ts +1 -1
  62. package/Particles/gpuParticleSystem.js +12 -2
  63. package/Particles/gpuParticleSystem.js.map +1 -1
  64. package/Particles/particleSystem.d.ts +1 -1
  65. package/Particles/particleSystem.js +17 -2
  66. package/Particles/particleSystem.js.map +1 -1
  67. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +1 -1
  68. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
  69. package/Rendering/renderingManager.d.ts +11 -0
  70. package/Rendering/renderingManager.js +55 -9
  71. package/Rendering/renderingManager.js.map +1 -1
  72. package/Shaders/ShadersInclude/pbrBlockAlbedoOpacity.js +2 -2
  73. package/Shaders/ShadersInclude/pbrBlockAlbedoOpacity.js.map +1 -1
  74. package/Shaders/ShadersInclude/pbrFragmentExtraDeclaration.js +1 -1
  75. package/Shaders/ShadersInclude/pbrFragmentExtraDeclaration.js.map +1 -1
  76. package/Shaders/ShadersInclude/vertexColorMixing.js +1 -1
  77. package/Shaders/ShadersInclude/vertexColorMixing.js.map +1 -1
  78. package/Shaders/color.fragment.js +3 -2
  79. package/Shaders/color.fragment.js.map +1 -1
  80. package/Shaders/color.vertex.js +1 -1
  81. package/Shaders/color.vertex.js.map +1 -1
  82. package/Shaders/default.fragment.js +3 -3
  83. package/Shaders/default.fragment.js.map +1 -1
  84. package/Shaders/default.vertex.js +1 -1
  85. package/Shaders/default.vertex.js.map +1 -1
  86. package/Shaders/gpuRenderParticles.fragment.d.ts +2 -0
  87. package/Shaders/gpuRenderParticles.fragment.js +8 -1
  88. package/Shaders/gpuRenderParticles.fragment.js.map +1 -1
  89. package/Shaders/gpuRenderParticles.vertex.d.ts +2 -0
  90. package/Shaders/gpuRenderParticles.vertex.js +4 -0
  91. package/Shaders/gpuRenderParticles.vertex.js.map +1 -1
  92. package/Shaders/particles.fragment.d.ts +2 -0
  93. package/Shaders/particles.fragment.js +8 -1
  94. package/Shaders/particles.fragment.js.map +1 -1
  95. package/Shaders/particles.vertex.d.ts +2 -0
  96. package/Shaders/particles.vertex.js +4 -0
  97. package/Shaders/particles.vertex.js.map +1 -1
  98. package/Shaders/pbr.vertex.js +1 -1
  99. package/Shaders/pbr.vertex.js.map +1 -1
  100. package/Sprites/spriteManager.d.ts +4 -0
  101. package/Sprites/spriteManager.js +2 -0
  102. package/Sprites/spriteManager.js.map +1 -1
  103. package/package.json +1 -1
  104. package/scene.d.ts +14 -0
  105. package/scene.js +37 -12
  106. package/scene.js.map +1 -1
  107. package/sceneComponent.d.ts +2 -0
  108. package/sceneComponent.js +2 -0
  109. package/sceneComponent.js.map +1 -1
@@ -19,6 +19,7 @@ import "../Shaders/particles.vertex.js";
19
19
  import { Color4, Color3, TmpColors } from "../Maths/math.color.js";
20
20
  import { ThinEngine } from "../Engines/thinEngine.js";
21
21
  import { ThinMaterialHelper } from "../Materials/thinMaterialHelper.js";
22
+ import { MaterialHelper } from "../Materials/materialHelper.js";
22
23
  import "../Engines/Extensions/engine.alpha.js";
23
24
  /**
24
25
  * This represents a particle system in Babylon.
@@ -1360,7 +1361,7 @@ export class ParticleSystem extends BaseParticleSystem {
1360
1361
  /**
1361
1362
  * @internal
1362
1363
  */
1363
- static _GetEffectCreationOptions(isAnimationSheetEnabled = false) {
1364
+ static _GetEffectCreationOptions(isAnimationSheetEnabled = false, useLogarithmicDepth = false) {
1364
1365
  const effectCreationOption = [
1365
1366
  "invView",
1366
1367
  "view",
@@ -1378,6 +1379,9 @@ export class ParticleSystem extends BaseParticleSystem {
1378
1379
  if (isAnimationSheetEnabled) {
1379
1380
  effectCreationOption.push("particlesInfos");
1380
1381
  }
1382
+ if (useLogarithmicDepth) {
1383
+ effectCreationOption.push("logarithmicDepthConstant");
1384
+ }
1381
1385
  return effectCreationOption;
1382
1386
  }
1383
1387
  /**
@@ -1409,6 +1413,9 @@ export class ParticleSystem extends BaseParticleSystem {
1409
1413
  if (this._isAnimationSheetEnabled) {
1410
1414
  defines.push("#define ANIMATESHEET");
1411
1415
  }
1416
+ if (this.useLogarithmicDepth) {
1417
+ defines.push("#define LOGARITHMICDEPTH");
1418
+ }
1412
1419
  if (blendMode === ParticleSystem.BLENDMODE_MULTIPLY) {
1413
1420
  defines.push("#define BLENDMULTIPLYMODE");
1414
1421
  }
@@ -1444,7 +1451,7 @@ export class ParticleSystem extends BaseParticleSystem {
1444
1451
  */
1445
1452
  fillUniformsAttributesAndSamplerNames(uniforms, attributes, samplers) {
1446
1453
  attributes.push(...ParticleSystem._GetAttributeNamesOrOptions(this._isAnimationSheetEnabled, this._isBillboardBased && this.billboardMode !== ParticleSystem.BILLBOARDMODE_STRETCHED, this._useRampGradients));
1447
- uniforms.push(...ParticleSystem._GetEffectCreationOptions(this._isAnimationSheetEnabled));
1454
+ uniforms.push(...ParticleSystem._GetEffectCreationOptions(this._isAnimationSheetEnabled, this.useLogarithmicDepth));
1448
1455
  samplers.push("diffuseSampler", "rampSampler");
1449
1456
  if (this._imageProcessingConfiguration) {
1450
1457
  ImageProcessingConfiguration.PrepareUniforms(uniforms, this._imageProcessingConfigurationDefines);
@@ -1662,6 +1669,10 @@ export class ParticleSystem extends BaseParticleSystem {
1662
1669
  else {
1663
1670
  engine.bindBuffers(this._vertexBuffers, this._indexBuffer, effect);
1664
1671
  }
1672
+ // Log. depth
1673
+ if (this.useLogarithmicDepth && this._scene) {
1674
+ MaterialHelper.BindLogDepth(defines, effect, this._scene);
1675
+ }
1665
1676
  // image processing
1666
1677
  if (this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess) {
1667
1678
  this._imageProcessingConfiguration.bind(effect);
@@ -1930,6 +1941,7 @@ export class ParticleSystem extends BaseParticleSystem {
1930
1941
  serializationObject.spriteCellHeight = particleSystem.spriteCellHeight;
1931
1942
  serializationObject.spriteRandomStartCell = particleSystem.spriteRandomStartCell;
1932
1943
  serializationObject.isAnimationSheetEnabled = particleSystem.isAnimationSheetEnabled;
1944
+ serializationObject.useLogarithmicDepth = particleSystem.useLogarithmicDepth;
1933
1945
  const colorGradients = particleSystem.getColorGradients();
1934
1946
  if (colorGradients) {
1935
1947
  serializationObject.colorGradients = [];
@@ -2177,6 +2189,9 @@ export class ParticleSystem extends BaseParticleSystem {
2177
2189
  if (parsedParticleSystem.billboardMode !== undefined) {
2178
2190
  particleSystem.billboardMode = parsedParticleSystem.billboardMode;
2179
2191
  }
2192
+ if (parsedParticleSystem.useLogarithmicDepth !== undefined) {
2193
+ particleSystem.useLogarithmicDepth = parsedParticleSystem.useLogarithmicDepth;
2194
+ }
2180
2195
  // Animations
2181
2196
  if (parsedParticleSystem.animations) {
2182
2197
  for (let animationIndex = 0; animationIndex < parsedParticleSystem.animations.length; animationIndex++) {