@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.
- package/AudioV2/abstractAudio/subNodes/audioAnalyzerSubNode.d.ts +2 -0
- package/AudioV2/abstractAudio/subNodes/audioAnalyzerSubNode.js.map +1 -1
- package/AudioV2/abstractAudio/subProperties/abstractAudioAnalyzer.d.ts +13 -3
- package/AudioV2/abstractAudio/subProperties/abstractAudioAnalyzer.js +16 -0
- package/AudioV2/abstractAudio/subProperties/abstractAudioAnalyzer.js.map +1 -1
- package/AudioV2/abstractAudio/subProperties/audioAnalyzer.d.ts +4 -0
- package/AudioV2/abstractAudio/subProperties/audioAnalyzer.js +22 -0
- package/AudioV2/abstractAudio/subProperties/audioAnalyzer.js.map +1 -1
- package/AudioV2/webAudio/subNodes/webAudioAnalyzerSubNode.d.ts +6 -0
- package/AudioV2/webAudio/subNodes/webAudioAnalyzerSubNode.js +22 -5
- package/AudioV2/webAudio/subNodes/webAudioAnalyzerSubNode.js.map +1 -1
- package/Compute/computeEffect.d.ts +6 -0
- package/Compute/computeEffect.js +3 -0
- package/Compute/computeEffect.js.map +1 -1
- package/Compute/computeShader.pure.d.ts +4 -0
- package/Compute/computeShader.pure.js +1 -0
- package/Compute/computeShader.pure.js.map +1 -1
- package/Engines/Native/nativeInterfaces.d.ts +10 -1
- package/Engines/Native/nativeInterfaces.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.computeShader.pure.js +154 -2
- package/Engines/WebGPU/Extensions/engine.computeShader.pure.js.map +1 -1
- package/Engines/abstractEngine.pure.d.ts +7 -1
- package/Engines/abstractEngine.pure.js +34 -4
- package/Engines/abstractEngine.pure.js.map +1 -1
- package/Engines/engine.pure.d.ts +0 -7
- package/Engines/engine.pure.js +0 -34
- package/Engines/engine.pure.js.map +1 -1
- package/Engines/thinNativeEngine.pure.js +15 -8
- package/Engines/thinNativeEngine.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.js +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.js.map +1 -1
- package/Materials/PBR/pbrMaterial.pure.d.ts +6 -0
- package/Materials/PBR/pbrMaterial.pure.js +8 -0
- package/Materials/PBR/pbrMaterial.pure.js.map +1 -1
- package/Materials/Textures/Procedurals/noiseProceduralTexture.pure.js +17 -5
- package/Materials/Textures/Procedurals/noiseProceduralTexture.pure.js.map +1 -1
- package/Materials/effect.pure.d.ts +2 -2
- package/Materials/effect.pure.js +12 -6
- package/Materials/effect.pure.js.map +1 -1
- package/Materials/meshDebugPluginMaterial.pure.js +15 -13
- package/Materials/meshDebugPluginMaterial.pure.js.map +1 -1
- package/Misc/tools.pure.js +11 -4
- package/Misc/tools.pure.js.map +1 -1
- package/Particles/computeShaderParticleSystem.pure.js +5 -1
- package/Particles/computeShaderParticleSystem.pure.js.map +1 -1
- package/Particles/gpuParticleSystem.pure.d.ts +1 -0
- package/Particles/gpuParticleSystem.pure.js +17 -1
- package/Particles/gpuParticleSystem.pure.js.map +1 -1
- package/ShadersWGSL/gpuRenderParticles.fragment.d.ts +5 -0
- package/ShadersWGSL/gpuRenderParticles.fragment.js +50 -0
- package/ShadersWGSL/gpuRenderParticles.fragment.js.map +1 -0
- package/ShadersWGSL/gpuRenderParticles.vertex.d.ts +5 -0
- package/ShadersWGSL/gpuRenderParticles.vertex.js +120 -0
- package/ShadersWGSL/gpuRenderParticles.vertex.js.map +1 -0
- package/ShadersWGSL/noise.fragment.d.ts +5 -0
- package/ShadersWGSL/noise.fragment.js +18 -0
- package/ShadersWGSL/noise.fragment.js.map +1 -0
- 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.
|
|
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.
|
|
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.
|
|
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.
|
|
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 */
|