@babylonjs/core 9.10.1 → 9.11.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/AudioV2/abstractAudio/subNodes/audioAnalyzerSubNode.d.ts +2 -0
  2. package/AudioV2/abstractAudio/subNodes/audioAnalyzerSubNode.js.map +1 -1
  3. package/AudioV2/abstractAudio/subProperties/abstractAudioAnalyzer.d.ts +13 -3
  4. package/AudioV2/abstractAudio/subProperties/abstractAudioAnalyzer.js +16 -0
  5. package/AudioV2/abstractAudio/subProperties/abstractAudioAnalyzer.js.map +1 -1
  6. package/AudioV2/abstractAudio/subProperties/audioAnalyzer.d.ts +4 -0
  7. package/AudioV2/abstractAudio/subProperties/audioAnalyzer.js +22 -0
  8. package/AudioV2/abstractAudio/subProperties/audioAnalyzer.js.map +1 -1
  9. package/AudioV2/webAudio/subNodes/webAudioAnalyzerSubNode.d.ts +6 -0
  10. package/AudioV2/webAudio/subNodes/webAudioAnalyzerSubNode.js +22 -5
  11. package/AudioV2/webAudio/subNodes/webAudioAnalyzerSubNode.js.map +1 -1
  12. package/Compute/computeEffect.d.ts +6 -0
  13. package/Compute/computeEffect.js +3 -0
  14. package/Compute/computeEffect.js.map +1 -1
  15. package/Compute/computeShader.pure.d.ts +4 -0
  16. package/Compute/computeShader.pure.js +1 -0
  17. package/Compute/computeShader.pure.js.map +1 -1
  18. package/Engines/Native/nativeInterfaces.d.ts +10 -1
  19. package/Engines/Native/nativeInterfaces.js.map +1 -1
  20. package/Engines/WebGPU/Extensions/engine.computeShader.pure.js +154 -2
  21. package/Engines/WebGPU/Extensions/engine.computeShader.pure.js.map +1 -1
  22. package/Engines/abstractEngine.pure.d.ts +7 -1
  23. package/Engines/abstractEngine.pure.js +34 -4
  24. package/Engines/abstractEngine.pure.js.map +1 -1
  25. package/Engines/engine.pure.d.ts +0 -7
  26. package/Engines/engine.pure.js +0 -34
  27. package/Engines/engine.pure.js.map +1 -1
  28. package/Engines/thinNativeEngine.pure.js +15 -8
  29. package/Engines/thinNativeEngine.pure.js.map +1 -1
  30. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.js +1 -1
  31. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.js.map +1 -1
  32. package/Materials/PBR/pbrMaterial.pure.d.ts +6 -0
  33. package/Materials/PBR/pbrMaterial.pure.js +8 -0
  34. package/Materials/PBR/pbrMaterial.pure.js.map +1 -1
  35. package/Materials/Textures/Procedurals/noiseProceduralTexture.pure.js +17 -5
  36. package/Materials/Textures/Procedurals/noiseProceduralTexture.pure.js.map +1 -1
  37. package/Materials/effect.pure.d.ts +2 -2
  38. package/Materials/effect.pure.js +12 -6
  39. package/Materials/effect.pure.js.map +1 -1
  40. package/Materials/meshDebugPluginMaterial.pure.js +15 -13
  41. package/Materials/meshDebugPluginMaterial.pure.js.map +1 -1
  42. package/Misc/tools.pure.js +11 -4
  43. package/Misc/tools.pure.js.map +1 -1
  44. package/Particles/computeShaderParticleSystem.pure.js +5 -1
  45. package/Particles/computeShaderParticleSystem.pure.js.map +1 -1
  46. package/Particles/gpuParticleSystem.pure.d.ts +1 -0
  47. package/Particles/gpuParticleSystem.pure.js +17 -1
  48. package/Particles/gpuParticleSystem.pure.js.map +1 -1
  49. package/ShadersWGSL/gpuRenderParticles.fragment.d.ts +5 -0
  50. package/ShadersWGSL/gpuRenderParticles.fragment.js +50 -0
  51. package/ShadersWGSL/gpuRenderParticles.fragment.js.map +1 -0
  52. package/ShadersWGSL/gpuRenderParticles.vertex.d.ts +5 -0
  53. package/ShadersWGSL/gpuRenderParticles.vertex.js +120 -0
  54. package/ShadersWGSL/gpuRenderParticles.vertex.js.map +1 -0
  55. package/ShadersWGSL/noise.fragment.d.ts +5 -0
  56. package/ShadersWGSL/noise.fragment.js +18 -0
  57. package/ShadersWGSL/noise.fragment.js.map +1 -0
  58. package/package.json +1 -1
@@ -26,6 +26,12 @@ export function QueueNewFrame(func, requester) {
26
26
  // Note that there is kind of a typing issue here, as `setTimeout` might return something else than a number (NodeJs returns a NodeJS.Timeout object).
27
27
  // Also if the global `requestAnimationFrame`'s returnType is number, `requester.requestPostAnimationFrame` and `requester.requestAnimationFrame` types
28
28
  // are `any`.
29
+ if (requester) {
30
+ const { requestAnimationFrame } = requester;
31
+ if (typeof requestAnimationFrame === "function") {
32
+ return requestAnimationFrame(func);
33
+ }
34
+ }
29
35
  if (!IsWindowObjectExist()) {
30
36
  if (typeof requestAnimationFrame === "function") {
31
37
  return requestAnimationFrame(func);
@@ -347,6 +353,17 @@ export class AbstractEngine {
347
353
  }
348
354
  }
349
355
  _cancelFrame() {
356
+ if (this.customAnimationFrameRequester) {
357
+ if (this._frameHandler !== 0) {
358
+ this._frameHandler = 0;
359
+ const { cancelAnimationFrame } = this.customAnimationFrameRequester;
360
+ if (cancelAnimationFrame) {
361
+ cancelAnimationFrame(this.customAnimationFrameRequester.requestID);
362
+ }
363
+ delete this.customAnimationFrameRequester.requestID;
364
+ }
365
+ return;
366
+ }
350
367
  if (this._frameHandler !== 0) {
351
368
  const handlerToCancel = this._frameHandler;
352
369
  this._frameHandler = 0;
@@ -435,7 +452,7 @@ export class AbstractEngine {
435
452
  // `stopRenderLoop` is called mid frame). The second condition prevents queuing another frame if one has
436
453
  // already been queued (e.g., if `stopRenderLoop` and `runRenderLoop` is called mid frame).
437
454
  if (this._activeRenderLoops.length > 0 && this._frameHandler === 0) {
438
- this._frameHandler = this._queueNewFrame(this._boundRenderFunction, this.getHostWindow());
455
+ this._queueNewFrameForRenderLoop();
439
456
  }
440
457
  }
441
458
  /** @internal */
@@ -456,6 +473,15 @@ export class AbstractEngine {
456
473
  _queueNewFrame(bindedRenderFunction, requester) {
457
474
  return QueueNewFrame(bindedRenderFunction, requester);
458
475
  }
476
+ _queueNewFrameForRenderLoop() {
477
+ if (this.customAnimationFrameRequester) {
478
+ this.customAnimationFrameRequester.requestID = this._queueNewFrame(this.customAnimationFrameRequester.renderFunction || this._boundRenderFunction, this.customAnimationFrameRequester);
479
+ this._frameHandler = this.customAnimationFrameRequester.requestID;
480
+ }
481
+ else {
482
+ this._frameHandler = this._queueNewFrame(this._boundRenderFunction, this.getHostWindow());
483
+ }
484
+ }
459
485
  /**
460
486
  * Register and execute a render loop. The engine can have more than one render function
461
487
  * @param renderFunction defines the function to continuously execute
@@ -467,7 +493,7 @@ export class AbstractEngine {
467
493
  this._activeRenderLoops.push(renderFunction);
468
494
  // On the first added function, start the render loop.
469
495
  if (this._activeRenderLoops.length === 1 && this._frameHandler === 0) {
470
- this._frameHandler = this._queueNewFrame(this._boundRenderFunction, this.getHostWindow());
496
+ this._queueNewFrameForRenderLoop();
471
497
  }
472
498
  }
473
499
  /**
@@ -813,13 +839,13 @@ export class AbstractEngine {
813
839
  */
814
840
  // Not mixed with Version for tooling purpose.
815
841
  static get NpmPackage() {
816
- return "babylonjs@9.10.1";
842
+ return "babylonjs@9.11.0";
817
843
  }
818
844
  /**
819
845
  * Returns the current version of the framework
820
846
  */
821
847
  static get Version() {
822
- return "9.10.1";
848
+ return "9.11.0";
823
849
  }
824
850
  /**
825
851
  * Gets the HTML canvas attached with the current webGL context
@@ -1042,6 +1068,10 @@ export class AbstractEngine {
1042
1068
  this._frameHandler = 0;
1043
1069
  /** @internal */
1044
1070
  this._activeRenderLoops = new Array();
1071
+ /**
1072
+ * If set, will be used to request the next animation frame for the render loop
1073
+ */
1074
+ this.customAnimationFrameRequester = null;
1045
1075
  /** @internal */
1046
1076
  this._windowIsBackground = false;
1047
1077
  /** @internal */