@babylonjs/lite-compat 1.15.0-preview → 1.16.0-preview
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/README.md +10 -8
- package/brdf-lut-data-BFfYlW71.js +5 -0
- package/brdf-lut-data-BFfYlW71.js.map +1 -0
- package/index.d.ts +503 -97
- package/index.js +1277 -497
- package/index.js.map +1 -1
- package/{meshes-CPZtn6G5.js → meshes-DduMsRJk.js} +691 -104
- package/meshes-DduMsRJk.js.map +1 -0
- package/navigation.d.ts +264 -78
- package/navigation.js +1 -1
- package/package.json +4 -4
- package/meshes-CPZtn6G5.js.map +0 -1
package/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
import { V as Vector3, u as unsupported, L as LiteCompatError, N as Node, M as Matrix, a as Mesh, T as TransformNode, l as liteBackedVector3,
|
|
5
|
-
import { A, b, c, C, d, e, f, g, h, i,
|
|
6
|
-
import { VERSION, createEngine, onBeforeRender, stopEngine, resizeEngine, setEngineSize, disposeEngine, registerSceneWithShadowSupport, registerScene, startEngine, createNullEngine, stepScene, setPhysicsTimestep, setPhysicsGravity, disposePhysics, createHavokWorld, createArcRotateCamera, attachControl, getCameraPosition, getViewMatrix, getProjectionMatrix, createGeospatialCamera, setGeospatialOrientation, attachGeospatialControls, createFreeCamera, attachFreeControl, markMaterialUboDirty, createPbrMaterial, createSolidTexture2D, createStandardMaterial, setAnimationAdditive, playAnimation, pauseAnimation, goToFrame, stopAnimation, createSceneContext, updateAnimationManager, setFog, setClipPlane, loadHdrEnvironment, loadDdsEnvironment, loadEnvironment, createDefaultCamera, addToScene, createHemisphericLight, createAnimationManager, enableAnimationBlending, addAnimationGroup, disposeScene, createDirectionalLight, createPointLight, createSpotLight, createCsgFromMesh, csgSubtract, csgIntersect, csgUnion, createMeshFromCsg, createCsg2FromMesh, csg2Subtract, csg2Intersect, csg2Add, createMeshesFromCsg2, disposeCsg2, initializeCsg2Async, createMorphTargets, setMorphTargetWeights, createTransformNode, bakeCurrentTransformIntoVertices, loadSOG, loadSPZ, loadSplat, createDynamicTexture, updateDynamicTexture, createTexture2DFromPixels, updateTexture2DFromPixels, createTexture3DFromPixels, loadBasisTexture2D, loadKtxTexture2D, loadTexture2D,
|
|
4
|
+
import { V as Vector3, u as unsupported, L as LiteCompatError, N as Node, M as Matrix, a as Mesh, T as TransformNode, l as liteBackedVector3, Q as Quaternion } from "./meshes-DduMsRJk.js";
|
|
5
|
+
import { A, B, b, c, C, d, e, f, g, h, i, j, k, G, I, m, n, o, p, q, t, r } from "./meshes-DduMsRJk.js";
|
|
6
|
+
import { VERSION, createEngine, onBeforeRender, stopEngine, resizeEngine, setEngineSize, disposeEngine, uploadImageToArrayLayer, enableMirroredMeshes, registerSceneWithShadowSupport, registerScene, startEngine, createNullEngine, stepScene, setPhysicsTimestep, setPhysicsGravity, disposePhysics, createHavokWorld, createArcRotateCamera, attachControl, getCameraPosition, getViewMatrix, getProjectionMatrix, createGeospatialCamera, setGeospatialOrientation, attachGeospatialControls, createFreeCamera, attachFreeControl, markMaterialUboDirty, rebuildMaterial, createPbrMaterial, createSolidTexture2D, createStandardMaterial, setAnimationAdditive, playAnimation, pauseAnimation, goToFrame, stopAnimation, createSceneContext, updateAnimationManager, setFog, setClipPlane, loadHdrEnvironment, loadDdsEnvironment, loadEnvironment, createDefaultCamera, addToScene, createHemisphericLight, createAnimationManager, enableAnimationBlending, addAnimationGroup, disposeScene, createDirectionalLight, createPointLight, createSpotLight, createCsgFromMesh, csgSubtract, csgIntersect, csgUnion, createMeshFromCsg, createCsg2FromMesh, csg2Subtract, csg2Intersect, csg2Add, createMeshesFromCsg2, disposeCsg2, initializeCsg2Async, createMorphTargets, setMorphTargetWeights, createTransformNode, bakeCurrentTransformIntoVertices, loadSOG, loadSPZ, loadSplat, createDynamicTexture, updateDynamicTexture, createTexture2DFromPixels, updateTexture2DFromPixels, createTexture3DFromPixels, loadBasisTexture2D, loadKtxTexture2D, loadTexture2D, createTexture2DArrayFromUrls, createTexture2DArrayFromKtx2, loadImageToArrayLayer, createTexture2DArray, createTexture2DArrayFromPixels, updateTexture2DArrayFromPixels, loadBabylon, loadGltf, resetVariant, getVariantNames, selectVariant, disposePicker, createGpuPicker, pickAsync, createAxisDragGizmo, attachAxisDragGizmoToNode, disposeAxisDragGizmo, createAxisScaleGizmo, attachAxisScaleGizmoToNode, disposeAxisScaleGizmo, createBoundingBoxGizmo, attachBoundingBoxGizmoToNode, disposeBoundingBoxGizmo, createCameraGizmo, attachCameraGizmoToCamera, disposeCameraGizmo, createLightGizmo, attachLightGizmoToLight, disposeLightGizmo, createPlaneDragGizmo, attachPlaneDragGizmoToNode, disposePlaneDragGizmo, createPlaneRotationGizmo, attachPlaneRotationGizmoToNode, disposePlaneRotationGizmo, createPositionGizmo, setPositionGizmoLocalCoordinates, attachPositionGizmoToNode, disposePositionGizmo, createRotationGizmo, setRotationGizmoLocalCoordinates, attachRotationGizmoToNode, disposeRotationGizmo, createScaleGizmo, setScaleGizmoLocalCoordinates, attachScaleGizmoToNode, disposeScaleGizmo, createUtilityLayer, registerUtilityLayer, disposeUtilityLayer, addBillboardSpriteIndex, updateBillboardSpriteIndex, loadSpriteAtlas, createFacingBillboardSystem, addFacingBillboardSystem, billboardBlendAdditive, billboardBlendAlpha, spriteBlendPremultiplied, spriteBlendAdditive, spriteBlendAlpha, createSprite2DLayer, addSprite2DIndex, createSpriteRenderer, registerSpriteRenderer, updateSprite2DIndex, createPcfSpotlightShadowGenerator, createPcfDirectionalShadowGenerator, createEsmDirectionalShadowGenerator, setShadowTaskCasterMeshes, parseNodeMaterialFromSnippet, createGridMaterial, getByteFrequencyData, getFloatFrequencyData, getByteTimeDomainData, getFloatTimeDomainData, enableAnalyzer, setSpatialPosition, setSpatialOrientation, enableSpatial, setSpatialListenerPosition, setSpatialListener, updateSpatialAudio, enableStereo, setStereoPan, disposeAudioBus, setBusVolume, getMasterVolume, setMasterVolume, unlockAudioEngineAsync, createSoundAsync, createSoundBufferAsync, createStreamingSoundAsync, createAudioBusAsync, createSoundSourceAsync, createMicrophoneSoundSourceAsync, disposeAudioEngine, createAudioEngineAsync, disposeSoundSource, setSoundSourceVolume, playSound, pauseSound, resumeSound, stopSound, disposeSound, setSoundVolume, playStreamingSound, pauseStreamingSound, resumeStreamingSound, stopStreamingSound, preloadStreamingInstanceAsync, preloadStreamingInstancesAsync, disposeStreamingSound, setStreamingSoundVolume, parseNodeParticleSetFromSnippet, registerNodeParticleSet, stopParticleSystem } from "@babylonjs/lite";
|
|
7
7
|
class Color3 {
|
|
8
|
-
constructor(
|
|
9
|
-
this.r =
|
|
8
|
+
constructor(r2 = 0, g2 = 0, b2 = 0) {
|
|
9
|
+
this.r = r2;
|
|
10
10
|
this.g = g2;
|
|
11
11
|
this.b = b2;
|
|
12
12
|
}
|
|
13
|
-
set(
|
|
14
|
-
this.r =
|
|
13
|
+
set(r2, g2, b2) {
|
|
14
|
+
this.r = r2;
|
|
15
15
|
this.g = g2;
|
|
16
16
|
this.b = b2;
|
|
17
17
|
return this;
|
|
@@ -73,31 +73,31 @@ class Color3 {
|
|
|
73
73
|
static FromArray(array, offset = 0) {
|
|
74
74
|
return new Color3(array[offset] ?? 0, array[offset + 1] ?? 0, array[offset + 2] ?? 0);
|
|
75
75
|
}
|
|
76
|
-
static FromInts(
|
|
77
|
-
return new Color3(
|
|
76
|
+
static FromInts(r2, g2, b2) {
|
|
77
|
+
return new Color3(r2 / 255, g2 / 255, b2 / 255);
|
|
78
78
|
}
|
|
79
79
|
static FromHexString(hex) {
|
|
80
80
|
if (hex.charAt(0) !== "#" || hex.length < 7) {
|
|
81
81
|
return new Color3(0, 0, 0);
|
|
82
82
|
}
|
|
83
|
-
const
|
|
83
|
+
const r2 = parseInt(hex.substring(1, 3), 16);
|
|
84
84
|
const g2 = parseInt(hex.substring(3, 5), 16);
|
|
85
85
|
const b2 = parseInt(hex.substring(5, 7), 16);
|
|
86
|
-
return Color3.FromInts(
|
|
86
|
+
return Color3.FromInts(r2, g2, b2);
|
|
87
87
|
}
|
|
88
88
|
static Lerp(start, end, amount) {
|
|
89
89
|
return new Color3(start.r + (end.r - start.r) * amount, start.g + (end.g - start.g) * amount, start.b + (end.b - start.b) * amount);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
class Color4 {
|
|
93
|
-
constructor(
|
|
94
|
-
this.r =
|
|
93
|
+
constructor(r2 = 0, g2 = 0, b2 = 0, a = 1) {
|
|
94
|
+
this.r = r2;
|
|
95
95
|
this.g = g2;
|
|
96
96
|
this.b = b2;
|
|
97
97
|
this.a = a;
|
|
98
98
|
}
|
|
99
|
-
set(
|
|
100
|
-
this.r =
|
|
99
|
+
set(r2, g2, b2, a) {
|
|
100
|
+
this.r = r2;
|
|
101
101
|
this.g = g2;
|
|
102
102
|
this.b = b2;
|
|
103
103
|
this.a = a;
|
|
@@ -128,8 +128,8 @@ class Color4 {
|
|
|
128
128
|
static FromArray(array, offset = 0) {
|
|
129
129
|
return new Color4(array[offset] ?? 0, array[offset + 1] ?? 0, array[offset + 2] ?? 0, array[offset + 3] ?? 1);
|
|
130
130
|
}
|
|
131
|
-
static FromInts(
|
|
132
|
-
return new Color4(
|
|
131
|
+
static FromInts(r2, g2, b2, a) {
|
|
132
|
+
return new Color4(r2 / 255, g2 / 255, b2 / 255, a / 255);
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
function toHex(value) {
|
|
@@ -443,12 +443,219 @@ class Path3D {
|
|
|
443
443
|
return this._distances;
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
|
-
class
|
|
446
|
+
class SmartArray {
|
|
447
|
+
constructor(capacity) {
|
|
448
|
+
__publicField(this, "data");
|
|
449
|
+
__publicField(this, "length", 0);
|
|
450
|
+
this.data = new Array(capacity);
|
|
451
|
+
}
|
|
452
|
+
push(value) {
|
|
453
|
+
this.data[this.length++] = value;
|
|
454
|
+
if (this.length > this.data.length) {
|
|
455
|
+
this.data.length = this.length;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
reset() {
|
|
459
|
+
this.length = 0;
|
|
460
|
+
}
|
|
461
|
+
concat(array) {
|
|
462
|
+
for (let i2 = 0; i2 < array.length; i2++) {
|
|
463
|
+
this.push(array.data[i2]);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
dispose() {
|
|
467
|
+
this.reset();
|
|
468
|
+
this.data.length = 0;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
class StringDictionary {
|
|
447
472
|
constructor() {
|
|
473
|
+
__publicField(this, "_store", {});
|
|
474
|
+
}
|
|
475
|
+
get count() {
|
|
476
|
+
return Object.keys(this._store).length;
|
|
477
|
+
}
|
|
478
|
+
add(key, value) {
|
|
479
|
+
if (key in this._store) {
|
|
480
|
+
return false;
|
|
481
|
+
}
|
|
482
|
+
this._store[key] = value;
|
|
483
|
+
return true;
|
|
484
|
+
}
|
|
485
|
+
set(key, value) {
|
|
486
|
+
if (!(key in this._store)) {
|
|
487
|
+
return false;
|
|
488
|
+
}
|
|
489
|
+
this._store[key] = value;
|
|
490
|
+
return true;
|
|
491
|
+
}
|
|
492
|
+
get(key) {
|
|
493
|
+
return this._store[key];
|
|
494
|
+
}
|
|
495
|
+
getOrAddWithFactory(key, factory) {
|
|
496
|
+
let value = this._store[key];
|
|
497
|
+
if (value === void 0) {
|
|
498
|
+
value = factory(key);
|
|
499
|
+
this._store[key] = value;
|
|
500
|
+
}
|
|
501
|
+
return value;
|
|
502
|
+
}
|
|
503
|
+
contains(key) {
|
|
504
|
+
return key in this._store;
|
|
505
|
+
}
|
|
506
|
+
remove(key) {
|
|
507
|
+
if (key in this._store) {
|
|
508
|
+
delete this._store[key];
|
|
509
|
+
return true;
|
|
510
|
+
}
|
|
511
|
+
return false;
|
|
512
|
+
}
|
|
513
|
+
clear() {
|
|
514
|
+
this._store = {};
|
|
515
|
+
}
|
|
516
|
+
forEach(callback) {
|
|
517
|
+
for (const key of Object.keys(this._store)) {
|
|
518
|
+
callback(key, this._store[key]);
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
const Tags = {
|
|
523
|
+
EnableFor(obj) {
|
|
524
|
+
obj._tags ?? (obj._tags = {});
|
|
525
|
+
},
|
|
526
|
+
HasTags(obj) {
|
|
527
|
+
return !!obj._tags && Object.keys(obj._tags).length > 0;
|
|
528
|
+
},
|
|
529
|
+
AddTagsTo(obj, tags) {
|
|
530
|
+
obj._tags ?? (obj._tags = {});
|
|
531
|
+
for (const tag of tags.split(/\s+/).filter(Boolean)) {
|
|
532
|
+
obj._tags[tag] = true;
|
|
533
|
+
}
|
|
534
|
+
},
|
|
535
|
+
RemoveTagsFrom(obj, tags) {
|
|
536
|
+
if (!obj._tags) {
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
for (const tag of tags.split(/\s+/).filter(Boolean)) {
|
|
540
|
+
delete obj._tags[tag];
|
|
541
|
+
}
|
|
542
|
+
},
|
|
543
|
+
MatchesQuery(obj, tag) {
|
|
544
|
+
return !!obj._tags && obj._tags[tag] === true;
|
|
545
|
+
},
|
|
546
|
+
GetTags(obj) {
|
|
547
|
+
return obj._tags ? Object.keys(obj._tags) : [];
|
|
548
|
+
}
|
|
549
|
+
};
|
|
550
|
+
class PerformanceMonitor {
|
|
551
|
+
constructor(frameSampleSize = 30) {
|
|
552
|
+
__publicField(this, "_samples", []);
|
|
553
|
+
__publicField(this, "_max");
|
|
554
|
+
__publicField(this, "_lastTime", null);
|
|
555
|
+
__publicField(this, "_enabled", true);
|
|
556
|
+
this._max = frameSampleSize;
|
|
557
|
+
}
|
|
558
|
+
sampleFrame(timeMs = now()) {
|
|
559
|
+
if (!this._enabled) {
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
if (this._lastTime !== null) {
|
|
563
|
+
const delta = timeMs - this._lastTime;
|
|
564
|
+
this._samples.push(delta);
|
|
565
|
+
if (this._samples.length > this._max) {
|
|
566
|
+
this._samples.shift();
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
this._lastTime = timeMs;
|
|
570
|
+
}
|
|
571
|
+
get averageFrameTime() {
|
|
572
|
+
if (this._samples.length === 0) {
|
|
573
|
+
return 0;
|
|
574
|
+
}
|
|
575
|
+
return this._samples.reduce((a, b2) => a + b2, 0) / this._samples.length;
|
|
576
|
+
}
|
|
577
|
+
get averageFPS() {
|
|
578
|
+
const avg = this.averageFrameTime;
|
|
579
|
+
return avg > 0 ? 1e3 / avg : 0;
|
|
580
|
+
}
|
|
581
|
+
get isSaturated() {
|
|
582
|
+
return this._samples.length >= this._max;
|
|
583
|
+
}
|
|
584
|
+
enable() {
|
|
585
|
+
this._enabled = true;
|
|
586
|
+
}
|
|
587
|
+
disable() {
|
|
588
|
+
this._enabled = false;
|
|
589
|
+
}
|
|
590
|
+
reset() {
|
|
591
|
+
this._samples = [];
|
|
592
|
+
this._lastTime = null;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
class FactorGradient {
|
|
596
|
+
constructor(gradient, factor1, factor2 = factor1) {
|
|
597
|
+
this.gradient = gradient;
|
|
598
|
+
this.factor1 = factor1;
|
|
599
|
+
this.factor2 = factor2;
|
|
600
|
+
}
|
|
601
|
+
getFactor() {
|
|
602
|
+
return this.factor1;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
class ColorGradient {
|
|
606
|
+
constructor(gradient, color1, color2) {
|
|
607
|
+
this.gradient = gradient;
|
|
608
|
+
this.color1 = color1;
|
|
609
|
+
this.color2 = color2;
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
function now() {
|
|
613
|
+
return typeof performance !== "undefined" ? performance.now() : Date.now();
|
|
614
|
+
}
|
|
615
|
+
const Logger = {
|
|
616
|
+
NoneLogLevel: 0,
|
|
617
|
+
MessageLogLevel: 1,
|
|
618
|
+
WarningLogLevel: 2,
|
|
619
|
+
ErrorLogLevel: 4,
|
|
620
|
+
AllLogLevel: 7,
|
|
621
|
+
/** Current log-level bitmask. */
|
|
622
|
+
LogLevels: 7,
|
|
623
|
+
Log(message) {
|
|
624
|
+
if (this.LogLevels & this.MessageLogLevel) {
|
|
625
|
+
console.log("BJS - " + message);
|
|
626
|
+
}
|
|
627
|
+
},
|
|
628
|
+
Warn(message) {
|
|
629
|
+
if (this.LogLevels & this.WarningLogLevel) {
|
|
630
|
+
console.warn("BJS - " + message);
|
|
631
|
+
}
|
|
632
|
+
},
|
|
633
|
+
Error(message) {
|
|
634
|
+
if (this.LogLevels & this.ErrorLogLevel) {
|
|
635
|
+
console.error("BJS - " + message);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
};
|
|
639
|
+
const PrecisionDate = {
|
|
640
|
+
get Now() {
|
|
641
|
+
return now();
|
|
642
|
+
}
|
|
643
|
+
};
|
|
644
|
+
class Observable {
|
|
645
|
+
constructor(_onObserverAdded, notifyIfTriggered = false) {
|
|
448
646
|
__publicField(this, "_observers", []);
|
|
647
|
+
__publicField(this, "_hasNotified", false);
|
|
648
|
+
__publicField(this, "_lastNotifiedValue");
|
|
649
|
+
this._onObserverAdded = _onObserverAdded;
|
|
650
|
+
this.notifyIfTriggered = notifyIfTriggered;
|
|
449
651
|
}
|
|
450
652
|
add(callback) {
|
|
653
|
+
var _a;
|
|
451
654
|
this._observers.push(callback);
|
|
655
|
+
(_a = this._onObserverAdded) == null ? void 0 : _a.call(this, callback);
|
|
656
|
+
if (this._hasNotified && this.notifyIfTriggered && this._lastNotifiedValue !== void 0) {
|
|
657
|
+
callback(this._lastNotifiedValue);
|
|
658
|
+
}
|
|
452
659
|
return callback;
|
|
453
660
|
}
|
|
454
661
|
addOnce(callback) {
|
|
@@ -456,8 +663,7 @@ class Observable {
|
|
|
456
663
|
this.removeCallback(wrapper);
|
|
457
664
|
callback(eventData);
|
|
458
665
|
};
|
|
459
|
-
this.
|
|
460
|
-
return wrapper;
|
|
666
|
+
return this.add(wrapper);
|
|
461
667
|
}
|
|
462
668
|
remove(callback) {
|
|
463
669
|
return callback ? this.removeCallback(callback) : false;
|
|
@@ -471,6 +677,10 @@ class Observable {
|
|
|
471
677
|
return false;
|
|
472
678
|
}
|
|
473
679
|
notifyObservers(eventData) {
|
|
680
|
+
if (this.notifyIfTriggered) {
|
|
681
|
+
this._hasNotified = true;
|
|
682
|
+
this._lastNotifiedValue = eventData;
|
|
683
|
+
}
|
|
474
684
|
for (const observer of this._observers.slice()) {
|
|
475
685
|
observer(eventData);
|
|
476
686
|
}
|
|
@@ -480,6 +690,19 @@ class Observable {
|
|
|
480
690
|
}
|
|
481
691
|
clear() {
|
|
482
692
|
this._observers = [];
|
|
693
|
+
this._onObserverAdded = void 0;
|
|
694
|
+
this.cleanLastNotifiedState();
|
|
695
|
+
}
|
|
696
|
+
cleanLastNotifiedState() {
|
|
697
|
+
this._hasNotified = false;
|
|
698
|
+
this._lastNotifiedValue = void 0;
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
async function runLateWork(work) {
|
|
702
|
+
try {
|
|
703
|
+
await work();
|
|
704
|
+
} catch (error) {
|
|
705
|
+
Logger.Error(`Late engine work failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
483
706
|
}
|
|
484
707
|
}
|
|
485
708
|
class AbstractEngine {
|
|
@@ -497,7 +720,8 @@ class AbstractEngine {
|
|
|
497
720
|
__publicField(this, "_scenes", []);
|
|
498
721
|
__publicField(this, "_loopCallbacks", []);
|
|
499
722
|
__publicField(this, "_initialized", false);
|
|
500
|
-
__publicField(this, "
|
|
723
|
+
__publicField(this, "_startupComplete", false);
|
|
724
|
+
__publicField(this, "_startPromise", null);
|
|
501
725
|
/** @internal Active `requestAnimationFrame` id for the scene-less loop, if any. */
|
|
502
726
|
__publicField(this, "_rafId", null);
|
|
503
727
|
/**
|
|
@@ -518,10 +742,9 @@ class AbstractEngine {
|
|
|
518
742
|
/** @internal Deferred startup work (thunks) awaited before the engine starts — e.g. sprite-atlas loads. */
|
|
519
743
|
__publicField(this, "_startupWork", []);
|
|
520
744
|
/**
|
|
521
|
-
* @internal Deferred work awaited
|
|
522
|
-
*
|
|
523
|
-
*
|
|
524
|
-
* registered (Babylon Lite's `registerUtilityLayer` ordering).
|
|
745
|
+
* @internal Deferred work awaited after the main engine renders its first frame
|
|
746
|
+
* — e.g. utility-layer registration, which must follow the main scene but must
|
|
747
|
+
* not block engine startup.
|
|
525
748
|
*/
|
|
526
749
|
__publicField(this, "_lateWork", []);
|
|
527
750
|
this._canvas = canvas;
|
|
@@ -668,8 +891,12 @@ class AbstractEngine {
|
|
|
668
891
|
_registerStartupWork(work) {
|
|
669
892
|
this._startupWork.push(work);
|
|
670
893
|
}
|
|
671
|
-
/** @internal Register
|
|
894
|
+
/** @internal Register work that must run after the main scene is rendering. */
|
|
672
895
|
_registerLateWork(work) {
|
|
896
|
+
if (this._startupComplete) {
|
|
897
|
+
void runLateWork(work);
|
|
898
|
+
return;
|
|
899
|
+
}
|
|
673
900
|
this._lateWork.push(work);
|
|
674
901
|
}
|
|
675
902
|
/** @internal Scenes register themselves on construction. */
|
|
@@ -733,11 +960,46 @@ class AbstractEngine {
|
|
|
733
960
|
endFrame() {
|
|
734
961
|
return unsupported("WebGPUEngine.endFrame", "Babylon Lite's frame graph owns the frame loop; drive rendering with `runRenderLoop`.");
|
|
735
962
|
}
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
963
|
+
/**
|
|
964
|
+
* Babylon.js `engine.currentSampleCount` — the MSAA sample count of the current render target.
|
|
965
|
+
* Babylon Lite manages MSAA internally and exposes no public sample-count accessor, so this
|
|
966
|
+
* needs a tree-shakeable Lite core addition before it can report a real value.
|
|
967
|
+
*/
|
|
968
|
+
get currentSampleCount() {
|
|
969
|
+
return unsupported("AbstractEngine.currentSampleCount", "Babylon Lite manages MSAA internally and exposes no public sample-count accessor.");
|
|
970
|
+
}
|
|
971
|
+
/**
|
|
972
|
+
* Babylon.js `engine.getAlphaToCoverage()` — alpha-to-coverage state. Babylon Lite does not
|
|
973
|
+
* expose an engine-level alpha-to-coverage toggle, so this is unsupported.
|
|
974
|
+
*/
|
|
975
|
+
getAlphaToCoverage() {
|
|
976
|
+
return unsupported("AbstractEngine.getAlphaToCoverage", "Babylon Lite does not expose an engine-level alpha-to-coverage toggle.");
|
|
977
|
+
}
|
|
978
|
+
/**
|
|
979
|
+
* Babylon.js `engine.setAlphaToCoverage(enable)` — toggle alpha-to-coverage. Babylon Lite does
|
|
980
|
+
* not expose an engine-level alpha-to-coverage toggle, so this is unsupported.
|
|
981
|
+
*/
|
|
982
|
+
setAlphaToCoverage(_enable) {
|
|
983
|
+
return unsupported("AbstractEngine.setAlphaToCoverage", "Babylon Lite does not expose an engine-level alpha-to-coverage toggle.");
|
|
984
|
+
}
|
|
985
|
+
/**
|
|
986
|
+
* Babylon.js `engine.updateTextureArrayLayerFromImageSource(texture, source, layer, invertY, premultiplyAlpha)`
|
|
987
|
+
* — the engine extension that uploads a decoded image source into one layer of a 2D array
|
|
988
|
+
* texture. Forwards to Babylon Lite's `uploadImageToArrayLayer`.
|
|
989
|
+
*
|
|
990
|
+
* Babylon.js passes an `InternalTexture`; the compat layer's equivalent handle is the Lite
|
|
991
|
+
* `Texture2DArray` returned by `RawTexture2DArray.getInternalTexture()`, so ported code that
|
|
992
|
+
* goes through `UploadImageToTexture2DArrayLayer` (which is exactly what Babylon.js's helper
|
|
993
|
+
* does) works unchanged.
|
|
994
|
+
*/
|
|
995
|
+
updateTextureArrayLayerFromImageSource(texture, source, layer, invertY = false, premultiplyAlpha = false) {
|
|
996
|
+
uploadImageToArrayLayer(this._lite, texture, layer, source, { invertY, premultiplyAlpha });
|
|
997
|
+
}
|
|
998
|
+
_start() {
|
|
999
|
+
this._startPromise ?? (this._startPromise = this._startCore());
|
|
1000
|
+
return this._startPromise;
|
|
1001
|
+
}
|
|
1002
|
+
async _startCore() {
|
|
741
1003
|
if (this._startupWork.length > 0) {
|
|
742
1004
|
await Promise.all(this._startupWork.map((w) => w()));
|
|
743
1005
|
this._startupWork.length = 0;
|
|
@@ -750,17 +1012,19 @@ class AbstractEngine {
|
|
|
750
1012
|
scene._flushPendingAdds();
|
|
751
1013
|
scene._buildMorphTargets();
|
|
752
1014
|
await scene._loadPendingEnvironment();
|
|
1015
|
+
await enableMirroredMeshes(scene._lite);
|
|
753
1016
|
if (scene._hasShadows()) {
|
|
754
1017
|
await registerSceneWithShadowSupport(scene._lite);
|
|
755
1018
|
} else {
|
|
756
1019
|
await registerScene(scene._lite);
|
|
757
1020
|
}
|
|
758
1021
|
}
|
|
1022
|
+
await startEngine(this._lite);
|
|
1023
|
+
this._startupComplete = true;
|
|
759
1024
|
if (this._lateWork.length > 0) {
|
|
760
|
-
await Promise.all(this._lateWork.map(
|
|
1025
|
+
await Promise.all(this._lateWork.map(runLateWork));
|
|
761
1026
|
this._lateWork.length = 0;
|
|
762
1027
|
}
|
|
763
|
-
await startEngine(this._lite);
|
|
764
1028
|
}
|
|
765
1029
|
_ensureInitialized(api) {
|
|
766
1030
|
if (!this._initialized) {
|
|
@@ -821,8 +1085,22 @@ class NullEngine extends WebGPUEngine {
|
|
|
821
1085
|
}
|
|
822
1086
|
class AbstractScene {
|
|
823
1087
|
constructor() {
|
|
824
|
-
/**
|
|
825
|
-
|
|
1088
|
+
/**
|
|
1089
|
+
* @internal Canonical compat mesh-wrapper registry, keyed by the Lite node each
|
|
1090
|
+
* wrapper carries. Kept in sync with the Lite-core-owned scene list: a wrapper is
|
|
1091
|
+
* registered when its mesh is constructed against the scene and dropped on dispose,
|
|
1092
|
+
* mirroring the core `addToScene` / `removeFromScene` it drives. `scene.meshes` is
|
|
1093
|
+
* derived from this so **every** compat mesh is enumerable — ordinary primitives
|
|
1094
|
+
* (which register straight with the Lite scene) as well as the loader-surfaced
|
|
1095
|
+
* Gaussian-Splatting meshes, which the old array only ever held.
|
|
1096
|
+
*/
|
|
1097
|
+
__publicField(this, "_meshWrappers", /* @__PURE__ */ new Map());
|
|
1098
|
+
/** @internal Stable Babylon.js-compatible array returned by `scene.meshes`. */
|
|
1099
|
+
__publicField(this, "_meshes", []);
|
|
1100
|
+
/** @internal Reused scratch array for reconciling Lite-core mesh order. */
|
|
1101
|
+
__publicField(this, "_orderedCoreMeshes", []);
|
|
1102
|
+
/** @internal Reused membership set for linear-time mesh-order reconciliation. */
|
|
1103
|
+
__publicField(this, "_orderedCoreMeshSet", /* @__PURE__ */ new Set());
|
|
826
1104
|
/** @internal Cameras constructed against this scene (`scene.cameras`). */
|
|
827
1105
|
__publicField(this, "_cameras", []);
|
|
828
1106
|
/** @internal Lights constructed against this scene (`scene.lights`). */
|
|
@@ -831,13 +1109,45 @@ class AbstractScene {
|
|
|
831
1109
|
__publicField(this, "_materials", []);
|
|
832
1110
|
}
|
|
833
1111
|
/**
|
|
834
|
-
*
|
|
835
|
-
*
|
|
836
|
-
*
|
|
837
|
-
*
|
|
1112
|
+
* @internal The Lite-core-owned mesh list backing `scene.meshes`. The concrete
|
|
1113
|
+
* {@link Scene} overrides this to return its Lite `SceneContext.meshes` (the
|
|
1114
|
+
* authoritative list); the abstract base owns no Lite scene, so it returns none.
|
|
1115
|
+
* Returning the core meshes directly is not an option (they are Lite `Mesh`
|
|
1116
|
+
* objects, not compat wrappers) — they only provide the authoritative membership
|
|
1117
|
+
* and order that {@link meshes} maps back onto canonical wrappers.
|
|
1118
|
+
*/
|
|
1119
|
+
_coreMeshList() {
|
|
1120
|
+
return [];
|
|
1121
|
+
}
|
|
1122
|
+
/**
|
|
1123
|
+
* Babylon.js `scene.meshes` — the compat mesh wrappers in the scene. Backed by the
|
|
1124
|
+
* canonical {@link _meshWrappers} registry and kept in sync with the Lite-core-owned
|
|
1125
|
+
* list: the core list ({@link _coreMeshList}) supplies authoritative membership and
|
|
1126
|
+
* ordering, mapped back to each mesh's canonical wrapper so the returned handles are
|
|
1127
|
+
* the right type and keep wrapper identity. Wrappers not yet mirrored into the core
|
|
1128
|
+
* list (transform-only loader roots, primitives whose scene-add is deferred to engine
|
|
1129
|
+
* start, and Gaussian-Splatting meshes that register their renderables outside
|
|
1130
|
+
* `scene.meshes`) retain their registration positions.
|
|
838
1131
|
*/
|
|
839
1132
|
get meshes() {
|
|
840
|
-
|
|
1133
|
+
const orderedCore = this._orderedCoreMeshes;
|
|
1134
|
+
const orderedCoreSet = this._orderedCoreMeshSet;
|
|
1135
|
+
orderedCore.length = 0;
|
|
1136
|
+
orderedCoreSet.clear();
|
|
1137
|
+
for (const core of this._coreMeshList()) {
|
|
1138
|
+
const wrapper = this._meshWrappers.get(core);
|
|
1139
|
+
if (wrapper && !orderedCoreSet.has(wrapper)) {
|
|
1140
|
+
orderedCore.push(wrapper);
|
|
1141
|
+
orderedCoreSet.add(wrapper);
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
let orderedIndex = 0;
|
|
1145
|
+
for (let i2 = 0; i2 < this._meshes.length; i2++) {
|
|
1146
|
+
if (orderedCoreSet.has(this._meshes[i2])) {
|
|
1147
|
+
this._meshes[i2] = orderedCore[orderedIndex++];
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
return this._meshes;
|
|
841
1151
|
}
|
|
842
1152
|
/** Babylon.js `scene.cameras` — every camera constructed against this scene. */
|
|
843
1153
|
get cameras() {
|
|
@@ -851,10 +1161,22 @@ class AbstractScene {
|
|
|
851
1161
|
get materials() {
|
|
852
1162
|
return this._materials;
|
|
853
1163
|
}
|
|
854
|
-
/**
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
1164
|
+
/**
|
|
1165
|
+
* @internal Register a compat mesh wrapper so it appears in `scene.meshes`. Keyed
|
|
1166
|
+
* by the Lite node the wrapper carries (`liteKey`) so it can be reconciled with the
|
|
1167
|
+
* core-owned list — pass an `AbstractMesh`'s `_lite`; loader-surfaced meshes whose
|
|
1168
|
+
* Lite node is not a core scene mesh (Gaussian Splatting) key by the wrapper itself.
|
|
1169
|
+
*/
|
|
1170
|
+
_registerMesh(mesh, liteKey = mesh) {
|
|
1171
|
+
const registered = this._meshWrappers.get(liteKey);
|
|
1172
|
+
if (registered && registered !== mesh) {
|
|
1173
|
+
return;
|
|
1174
|
+
}
|
|
1175
|
+
if (!registered) {
|
|
1176
|
+
this._meshWrappers.set(liteKey, mesh);
|
|
1177
|
+
}
|
|
1178
|
+
if (!this._meshes.includes(mesh)) {
|
|
1179
|
+
this._meshes.push(mesh);
|
|
858
1180
|
}
|
|
859
1181
|
}
|
|
860
1182
|
/** @internal Register a camera so it appears in `scene.cameras`. */
|
|
@@ -885,9 +1207,14 @@ class AbstractScene {
|
|
|
885
1207
|
if (li !== -1) {
|
|
886
1208
|
this._lights.splice(li, 1);
|
|
887
1209
|
}
|
|
888
|
-
const
|
|
1210
|
+
for (const [key, wrapper] of this._meshWrappers) {
|
|
1211
|
+
if (wrapper === node) {
|
|
1212
|
+
this._meshWrappers.delete(key);
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
const mi = this._meshes.indexOf(node);
|
|
889
1216
|
if (mi !== -1) {
|
|
890
|
-
this.
|
|
1217
|
+
this._meshes.splice(mi, 1);
|
|
891
1218
|
}
|
|
892
1219
|
}
|
|
893
1220
|
/** @internal Remove a material from `scene.materials` on dispose. */
|
|
@@ -922,30 +1249,29 @@ class AbstractScene {
|
|
|
922
1249
|
return this._materials.find((m2) => m2.id === id) ?? null;
|
|
923
1250
|
}
|
|
924
1251
|
/**
|
|
925
|
-
* Babylon.js `scene.getMeshByName(name)
|
|
926
|
-
*
|
|
927
|
-
* (
|
|
928
|
-
* when not found, matching Babylon.js.
|
|
1252
|
+
* Babylon.js `scene.getMeshByName(name)` — first mesh in {@link meshes} with a
|
|
1253
|
+
* matching name, else `null`. Enumerates the full canonical mesh registry
|
|
1254
|
+
* (primitives + loader-surfaced meshes), not just the loader-surfaced subset.
|
|
929
1255
|
*/
|
|
930
1256
|
getMeshByName(name) {
|
|
931
|
-
return this.
|
|
1257
|
+
return this.meshes.find((m2) => m2.name === name) ?? null;
|
|
932
1258
|
}
|
|
933
|
-
/** Babylon.js `scene.getMeshById(id)` — first
|
|
1259
|
+
/** Babylon.js `scene.getMeshById(id)` — first mesh whose `id` matches, else `null`. */
|
|
934
1260
|
getMeshById(id) {
|
|
935
|
-
return this.
|
|
1261
|
+
return this.meshes.find((m2) => m2.id === id) ?? null;
|
|
936
1262
|
}
|
|
937
1263
|
/** Babylon.js legacy `scene.getMeshByID(id)` — alias of {@link getMeshById}. */
|
|
938
1264
|
getMeshByID(id) {
|
|
939
1265
|
return this.getMeshById(id);
|
|
940
1266
|
}
|
|
941
|
-
/** Babylon.js `scene.getNodeByName(name)` — searches
|
|
1267
|
+
/** Babylon.js `scene.getNodeByName(name)` — searches meshes, cameras, and lights. */
|
|
942
1268
|
getNodeByName(name) {
|
|
943
|
-
return this.
|
|
1269
|
+
return this.meshes.find((m2) => m2.name === name) ?? this._cameras.find((c2) => c2.name === name) ?? this._lights.find((l) => l.name === name) ?? null;
|
|
944
1270
|
}
|
|
945
|
-
/** Babylon.js `scene.getNodeById(id)` — searches
|
|
1271
|
+
/** Babylon.js `scene.getNodeById(id)` — searches meshes, cameras, and lights by `id`. */
|
|
946
1272
|
getNodeById(id) {
|
|
947
1273
|
const byId = (n2) => n2.id === id;
|
|
948
|
-
return this.
|
|
1274
|
+
return this.meshes.find((m2) => byId(m2)) ?? this._cameras.find((c2) => byId(c2)) ?? this._lights.find((l) => byId(l)) ?? null;
|
|
949
1275
|
}
|
|
950
1276
|
}
|
|
951
1277
|
var PhysicsShapeType = /* @__PURE__ */ ((PhysicsShapeType2) => {
|
|
@@ -1211,6 +1537,34 @@ class ArcRotateCamera extends Camera {
|
|
|
1211
1537
|
set upperRadiusLimit(value) {
|
|
1212
1538
|
this._lite.upperRadiusLimit = value;
|
|
1213
1539
|
}
|
|
1540
|
+
// These input-tuning fields delegate straight through to the underlying Lite
|
|
1541
|
+
// camera so that Babylon.js-style code — which may set them either before or
|
|
1542
|
+
// AFTER attachControl — takes effect. Lite's attachControl reads these live on
|
|
1543
|
+
// every input event, so a post-attach write (as Babylon.js allows) is honored.
|
|
1544
|
+
// Without these accessors a write would land on the wrapper instance and never
|
|
1545
|
+
// reach _lite, leaving zoom/orbit/pan at the Lite defaults (e.g. wheel zoom
|
|
1546
|
+
// running far too fast because a raised wheelPrecision was silently dropped).
|
|
1547
|
+
/** Wheel-zoom sensitivity (HIGHER = slower zoom). Babylon default 3. */
|
|
1548
|
+
get wheelPrecision() {
|
|
1549
|
+
return this._lite.wheelPrecision;
|
|
1550
|
+
}
|
|
1551
|
+
set wheelPrecision(value) {
|
|
1552
|
+
this._lite.wheelPrecision = value;
|
|
1553
|
+
}
|
|
1554
|
+
/** Mouse-drag orbit sensitivity (HIGHER = slower rotation). Babylon default 1000. */
|
|
1555
|
+
get angularSensibility() {
|
|
1556
|
+
return this._lite.angularSensibility;
|
|
1557
|
+
}
|
|
1558
|
+
set angularSensibility(value) {
|
|
1559
|
+
this._lite.angularSensibility = value;
|
|
1560
|
+
}
|
|
1561
|
+
/** Right-drag panning sensitivity in pixels-per-unit (LOWER = faster pan). Babylon default 50. */
|
|
1562
|
+
get panningSensibility() {
|
|
1563
|
+
return this._lite.panningSensibility;
|
|
1564
|
+
}
|
|
1565
|
+
set panningSensibility(value) {
|
|
1566
|
+
this._lite.panningSensibility = value;
|
|
1567
|
+
}
|
|
1214
1568
|
attachControl(canvas, _noPreventDefault) {
|
|
1215
1569
|
var _a;
|
|
1216
1570
|
const detach = attachControl(this._lite, canvas, (_a = this._scene) == null ? void 0 : _a._lite);
|
|
@@ -1405,8 +1759,33 @@ class Material {
|
|
|
1405
1759
|
getClassName() {
|
|
1406
1760
|
return "Material";
|
|
1407
1761
|
}
|
|
1408
|
-
|
|
1409
|
-
|
|
1762
|
+
/**
|
|
1763
|
+
* @internal Copy the shared base + Lite data-property state onto a freshly
|
|
1764
|
+
* constructed clone. The clone keeps the `_buildGroup`/UBO its own factory
|
|
1765
|
+
* created (internal `_`-prefixed fields are never copied), so only the observable
|
|
1766
|
+
* data properties — colours, scalars, and shared texture references — carry over.
|
|
1767
|
+
*/
|
|
1768
|
+
_cloneBaseInto(target) {
|
|
1769
|
+
copyLiteMaterialData(this._lite, target._lite);
|
|
1770
|
+
target.transparencyMode = this.transparencyMode;
|
|
1771
|
+
target.wireframe = this.wireframe;
|
|
1772
|
+
target.backFaceCulling = this._backFaceCulling;
|
|
1773
|
+
}
|
|
1774
|
+
/** The scene this material was constructed against (Babylon.js `Material.getScene`). */
|
|
1775
|
+
getScene() {
|
|
1776
|
+
return this._scene;
|
|
1777
|
+
}
|
|
1778
|
+
/**
|
|
1779
|
+
* The textures currently bound to this material (Babylon.js
|
|
1780
|
+
* `Material.getActiveTextures`). The base material owns no texture slots, so
|
|
1781
|
+
* this returns an empty array; each subclass overrides it to enumerate its own
|
|
1782
|
+
* slots and those of its extensions.
|
|
1783
|
+
*/
|
|
1784
|
+
getActiveTextures() {
|
|
1785
|
+
return [];
|
|
1786
|
+
}
|
|
1787
|
+
_markDirty() {
|
|
1788
|
+
markMaterialUboDirty(this._lite);
|
|
1410
1789
|
}
|
|
1411
1790
|
/**
|
|
1412
1791
|
* @internal Finalize GPU-facing resources before the mesh is registered.
|
|
@@ -1415,9 +1794,48 @@ class Material {
|
|
|
1415
1794
|
*/
|
|
1416
1795
|
_ensureRenderable(_engine) {
|
|
1417
1796
|
}
|
|
1797
|
+
/**
|
|
1798
|
+
* @internal Adopt an owning scene discovered when the material is first assigned
|
|
1799
|
+
* to a mesh (Babylon.js allows `new StandardMaterial(name)` with no scene, then
|
|
1800
|
+
* `mesh.material = mat`). Needed so the texture-readiness path can reconcile the
|
|
1801
|
+
* material into the running scene. Registers with the scene the first time.
|
|
1802
|
+
*/
|
|
1803
|
+
_adoptScene(scene) {
|
|
1804
|
+
if (!this._scene) {
|
|
1805
|
+
this._scene = scene;
|
|
1806
|
+
scene._registerMaterial(this);
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
/**
|
|
1810
|
+
* @internal Reconcile this material into its scene when the scene is already
|
|
1811
|
+
* live: finalize GPU-facing resources ({@link _ensureRenderable}) and rebuild
|
|
1812
|
+
* the renderables of every mesh using it. A no-op before engine start (the
|
|
1813
|
+
* boot-time build handles those meshes) or when the material has no scene.
|
|
1814
|
+
* Shared by the mesh `material` setter and the texture-readiness callback.
|
|
1815
|
+
*/
|
|
1816
|
+
_refreshInScene() {
|
|
1817
|
+
const scene = this._scene;
|
|
1818
|
+
if (!(scene == null ? void 0 : scene._hasStarted)) {
|
|
1819
|
+
return;
|
|
1820
|
+
}
|
|
1821
|
+
this._ensureRenderable(scene.getEngine()._lite);
|
|
1822
|
+
rebuildMaterial(scene._lite, this._lite);
|
|
1823
|
+
}
|
|
1824
|
+
/**
|
|
1825
|
+
* @internal Rebind + rebuild this material once an asynchronously loaded texture
|
|
1826
|
+
* assigned to it becomes GPU-ready. Babylon.js `Texture`s load in the background,
|
|
1827
|
+
* so a texture assigned to a material (or a material assigned to a mesh) before
|
|
1828
|
+
* the load resolves must go back through the rebuild path once the handle exists.
|
|
1829
|
+
* Fires immediately when the texture is already ready (then gated by scene state).
|
|
1830
|
+
*/
|
|
1831
|
+
_watchTexture(texture) {
|
|
1832
|
+
var _a;
|
|
1833
|
+
(_a = texture == null ? void 0 : texture._onReady) == null ? void 0 : _a.call(texture, () => this._refreshInScene());
|
|
1834
|
+
}
|
|
1418
1835
|
dispose() {
|
|
1419
1836
|
var _a;
|
|
1420
1837
|
(_a = this._scene) == null ? void 0 : _a._unregisterMaterial(this);
|
|
1838
|
+
this._scene = void 0;
|
|
1421
1839
|
}
|
|
1422
1840
|
}
|
|
1423
1841
|
class PushMaterial extends Material {
|
|
@@ -1428,6 +1846,17 @@ class PushMaterial extends Material {
|
|
|
1428
1846
|
function readColor3(tuple) {
|
|
1429
1847
|
return tuple ? new Color3(tuple[0], tuple[1], tuple[2]) : new Color3(0, 0, 0);
|
|
1430
1848
|
}
|
|
1849
|
+
function copyLiteMaterialData(src, dst) {
|
|
1850
|
+
const s = src;
|
|
1851
|
+
const d2 = dst;
|
|
1852
|
+
for (const key of Object.keys(s)) {
|
|
1853
|
+
if (key.startsWith("_")) {
|
|
1854
|
+
continue;
|
|
1855
|
+
}
|
|
1856
|
+
const value = s[key];
|
|
1857
|
+
d2[key] = Array.isArray(value) ? value.slice() : value;
|
|
1858
|
+
}
|
|
1859
|
+
}
|
|
1431
1860
|
class StandardMaterial extends PushMaterial {
|
|
1432
1861
|
constructor(name, scene) {
|
|
1433
1862
|
super(name, scene);
|
|
@@ -1498,6 +1927,7 @@ class StandardMaterial extends PushMaterial {
|
|
|
1498
1927
|
set diffuseTexture(texture) {
|
|
1499
1928
|
this._diffuseTexture = texture;
|
|
1500
1929
|
this._lite.diffuseTexture = (texture == null ? void 0 : texture._lite) ?? null;
|
|
1930
|
+
this._watchTexture(texture);
|
|
1501
1931
|
this._markDirty();
|
|
1502
1932
|
}
|
|
1503
1933
|
/**
|
|
@@ -1519,6 +1949,7 @@ class StandardMaterial extends PushMaterial {
|
|
|
1519
1949
|
set bumpTexture(texture) {
|
|
1520
1950
|
this._bumpTexture = texture;
|
|
1521
1951
|
this._lite.bumpTexture = (texture == null ? void 0 : texture._lite) ?? null;
|
|
1952
|
+
this._watchTexture(texture);
|
|
1522
1953
|
this._markDirty();
|
|
1523
1954
|
}
|
|
1524
1955
|
get emissiveTexture() {
|
|
@@ -1527,8 +1958,23 @@ class StandardMaterial extends PushMaterial {
|
|
|
1527
1958
|
set emissiveTexture(texture) {
|
|
1528
1959
|
this._emissiveTexture = texture;
|
|
1529
1960
|
this._lite.emissiveTexture = (texture == null ? void 0 : texture._lite) ?? null;
|
|
1961
|
+
this._watchTexture(texture);
|
|
1530
1962
|
this._markDirty();
|
|
1531
1963
|
}
|
|
1964
|
+
/** Enumerate the standard-material texture slots that are bound (Babylon.js `getActiveTextures`). */
|
|
1965
|
+
getActiveTextures() {
|
|
1966
|
+
const textures = [];
|
|
1967
|
+
if (this._diffuseTexture) {
|
|
1968
|
+
textures.push(this._diffuseTexture);
|
|
1969
|
+
}
|
|
1970
|
+
if (this._bumpTexture) {
|
|
1971
|
+
textures.push(this._bumpTexture);
|
|
1972
|
+
}
|
|
1973
|
+
if (this._emissiveTexture) {
|
|
1974
|
+
textures.push(this._emissiveTexture);
|
|
1975
|
+
}
|
|
1976
|
+
return textures;
|
|
1977
|
+
}
|
|
1532
1978
|
/**
|
|
1533
1979
|
* @internal Re-bind texture maps to the Lite material. Babylon.js `Texture`s
|
|
1534
1980
|
* load asynchronously, so when `material.diffuseTexture = new Texture(url)` ran
|
|
@@ -1553,6 +1999,20 @@ class StandardMaterial extends PushMaterial {
|
|
|
1553
1999
|
}
|
|
1554
2000
|
this._markDirty();
|
|
1555
2001
|
}
|
|
2002
|
+
/**
|
|
2003
|
+
* Babylon.js `StandardMaterial.clone(name)`. Copies the diffuse/specular/emissive/
|
|
2004
|
+
* ambient colours and scalars, shares the diffuse/bump/emissive texture references,
|
|
2005
|
+
* and gives the clone its own Lite standard-material renderable.
|
|
2006
|
+
*/
|
|
2007
|
+
clone(name) {
|
|
2008
|
+
const cloned = new StandardMaterial(name, this._scene);
|
|
2009
|
+
this._cloneBaseInto(cloned);
|
|
2010
|
+
cloned.useAlphaFromDiffuseTexture = this.useAlphaFromDiffuseTexture;
|
|
2011
|
+
cloned._diffuseTexture = this._diffuseTexture;
|
|
2012
|
+
cloned._bumpTexture = this._bumpTexture;
|
|
2013
|
+
cloned._emissiveTexture = this._emissiveTexture;
|
|
2014
|
+
return cloned;
|
|
2015
|
+
}
|
|
1556
2016
|
}
|
|
1557
2017
|
class PBRClearCoatConfiguration {
|
|
1558
2018
|
constructor(_props, _markDirty) {
|
|
@@ -1590,6 +2050,7 @@ class PBRClearCoatConfiguration {
|
|
|
1590
2050
|
}
|
|
1591
2051
|
class PBRSheenConfiguration {
|
|
1592
2052
|
constructor(_props, _markDirty) {
|
|
2053
|
+
__publicField(this, "_texture", null);
|
|
1593
2054
|
this._props = _props;
|
|
1594
2055
|
this._markDirty = _markDirty;
|
|
1595
2056
|
}
|
|
@@ -1622,12 +2083,22 @@ class PBRSheenConfiguration {
|
|
|
1622
2083
|
this._props.color = [value.r, value.g, value.b];
|
|
1623
2084
|
this._markDirty();
|
|
1624
2085
|
}
|
|
1625
|
-
/** Babylon.js `sheen.texture`.
|
|
2086
|
+
/** Babylon.js `sheen.texture`. Retains the wrapper and binds the Lite handle if the texture has resolved. */
|
|
2087
|
+
get texture() {
|
|
2088
|
+
return this._texture;
|
|
2089
|
+
}
|
|
1626
2090
|
set texture(value) {
|
|
2091
|
+
this._texture = value;
|
|
1627
2092
|
if (value == null ? void 0 : value._lite) {
|
|
1628
2093
|
this._props.texture = value._lite;
|
|
1629
|
-
|
|
2094
|
+
} else {
|
|
2095
|
+
delete this._props.texture;
|
|
1630
2096
|
}
|
|
2097
|
+
this._markDirty();
|
|
2098
|
+
}
|
|
2099
|
+
/** Enumerate the sheen texture slot for `Material.getActiveTextures`. */
|
|
2100
|
+
getActiveTextures() {
|
|
2101
|
+
return this._texture ? [this._texture] : [];
|
|
1631
2102
|
}
|
|
1632
2103
|
}
|
|
1633
2104
|
class PBRAnisotropicConfiguration {
|
|
@@ -1704,6 +2175,7 @@ class PBRMaterial extends PushMaterial {
|
|
|
1704
2175
|
super(name, scene);
|
|
1705
2176
|
/** @internal Underlying Babylon Lite PBR-material props. */
|
|
1706
2177
|
__publicField(this, "_lite");
|
|
2178
|
+
__publicField(this, "_albedoFactor", [1, 1, 1, 1]);
|
|
1707
2179
|
__publicField(this, "_albedoTexture", null);
|
|
1708
2180
|
/**
|
|
1709
2181
|
* Babylon.js `material.forceIrradianceInFragment`. Babylon Lite computes
|
|
@@ -1714,6 +2186,7 @@ class PBRMaterial extends PushMaterial {
|
|
|
1714
2186
|
__publicField(this, "_sheen");
|
|
1715
2187
|
__publicField(this, "_anisotropy");
|
|
1716
2188
|
__publicField(this, "_iridescence");
|
|
2189
|
+
__publicField(this, "_environmentTexture", null);
|
|
1717
2190
|
this._lite = createPbrMaterial();
|
|
1718
2191
|
if (!this._lite.baseColorFactor) {
|
|
1719
2192
|
this._lite.baseColorFactor = [1, 1, 1, 1];
|
|
@@ -1723,12 +2196,11 @@ class PBRMaterial extends PushMaterial {
|
|
|
1723
2196
|
return "PBRMaterial";
|
|
1724
2197
|
}
|
|
1725
2198
|
get albedoColor() {
|
|
1726
|
-
|
|
1727
|
-
return f2 ? new Color3(f2[0], f2[1], f2[2]) : new Color3(1, 1, 1);
|
|
2199
|
+
return new Color3(this._albedoFactor[0], this._albedoFactor[1], this._albedoFactor[2]);
|
|
1728
2200
|
}
|
|
1729
2201
|
set albedoColor(value) {
|
|
1730
|
-
|
|
1731
|
-
this._lite.baseColorFactor = [
|
|
2202
|
+
this._albedoFactor = [value.r, value.g, value.b, this._albedoFactor[3]];
|
|
2203
|
+
this._lite.baseColorFactor = [...this._albedoFactor];
|
|
1732
2204
|
this._markDirty();
|
|
1733
2205
|
}
|
|
1734
2206
|
/**
|
|
@@ -1741,8 +2213,27 @@ class PBRMaterial extends PushMaterial {
|
|
|
1741
2213
|
}
|
|
1742
2214
|
set albedoTexture(texture) {
|
|
1743
2215
|
this._albedoTexture = texture;
|
|
2216
|
+
this._watchTexture(texture);
|
|
1744
2217
|
this._markDirty();
|
|
1745
2218
|
}
|
|
2219
|
+
/**
|
|
2220
|
+
* Enumerate every bound PBR texture slot, including extension sub-configurations
|
|
2221
|
+
* (Babylon.js `PBRMaterial.getActiveTextures`).
|
|
2222
|
+
*/
|
|
2223
|
+
getActiveTextures() {
|
|
2224
|
+
const textures = [];
|
|
2225
|
+
if (this._albedoTexture) {
|
|
2226
|
+
textures.push(this._albedoTexture);
|
|
2227
|
+
}
|
|
2228
|
+
const environmentTexture = this.environmentTexture;
|
|
2229
|
+
if (environmentTexture) {
|
|
2230
|
+
textures.push(environmentTexture);
|
|
2231
|
+
}
|
|
2232
|
+
if (this._sheen) {
|
|
2233
|
+
textures.push(...this._sheen.getActiveTextures());
|
|
2234
|
+
}
|
|
2235
|
+
return textures;
|
|
2236
|
+
}
|
|
1746
2237
|
get metallic() {
|
|
1747
2238
|
return this._lite.metallicFactor ?? 1;
|
|
1748
2239
|
}
|
|
@@ -1838,9 +2329,10 @@ class PBRMaterial extends PushMaterial {
|
|
|
1838
2329
|
*/
|
|
1839
2330
|
get environmentTexture() {
|
|
1840
2331
|
var _a;
|
|
1841
|
-
return ((_a = this._scene) == null ? void 0 : _a.environmentTexture) ?? null;
|
|
2332
|
+
return this._environmentTexture ?? ((_a = this._scene) == null ? void 0 : _a.environmentTexture) ?? null;
|
|
1842
2333
|
}
|
|
1843
2334
|
set environmentTexture(value) {
|
|
2335
|
+
this._environmentTexture = value;
|
|
1844
2336
|
if (this._scene) {
|
|
1845
2337
|
this._scene.environmentTexture = value;
|
|
1846
2338
|
}
|
|
@@ -1857,10 +2349,11 @@ class PBRMaterial extends PushMaterial {
|
|
|
1857
2349
|
const albedo = this._albedoTexture;
|
|
1858
2350
|
if (albedo == null ? void 0 : albedo._lite) {
|
|
1859
2351
|
lite.baseColorTexture = albedo._lite;
|
|
2352
|
+
lite.baseColorFactor = [...this._albedoFactor];
|
|
1860
2353
|
lite.gammaAlbedo = albedo.gammaSpace ?? true;
|
|
1861
2354
|
}
|
|
1862
2355
|
if (!lite.baseColorTexture) {
|
|
1863
|
-
const f2 =
|
|
2356
|
+
const f2 = this._albedoFactor;
|
|
1864
2357
|
lite.baseColorTexture = createSolidTexture2D(engine, f2[0], f2[1], f2[2], f2[3]);
|
|
1865
2358
|
lite.baseColorFactor = [1, 1, 1, 1];
|
|
1866
2359
|
}
|
|
@@ -1872,6 +2365,44 @@ class PBRMaterial extends PushMaterial {
|
|
|
1872
2365
|
lite.metallicFactor = 1;
|
|
1873
2366
|
}
|
|
1874
2367
|
}
|
|
2368
|
+
/**
|
|
2369
|
+
* Babylon.js `PBRMaterial.clone(name)`. Copies the albedo/metallic/roughness/
|
|
2370
|
+
* emissive state, shares the albedo texture reference, gives the clone independent
|
|
2371
|
+
* clearcoat/sheen/anisotropy/iridescence sub-configurations (sharing any nested
|
|
2372
|
+
* texture), and a fresh Lite PBR renderable.
|
|
2373
|
+
*/
|
|
2374
|
+
clone(name) {
|
|
2375
|
+
const cloned = new PBRMaterial(name, this._scene);
|
|
2376
|
+
this._clonePbrInto(cloned);
|
|
2377
|
+
return cloned;
|
|
2378
|
+
}
|
|
2379
|
+
/**
|
|
2380
|
+
* @internal Copy PBR-specific compat + Lite state onto a freshly constructed PBR
|
|
2381
|
+
* clone (used by every `PBRMaterial` subclass so each returns its own concrete
|
|
2382
|
+
* type). The base `_cloneBaseInto` shares the sub-config objects by reference; this
|
|
2383
|
+
* re-copies them so the clone's `clearCoat`/`sheen`/… mutate independently while
|
|
2384
|
+
* still sharing any nested texture handle.
|
|
2385
|
+
*/
|
|
2386
|
+
_clonePbrInto(target) {
|
|
2387
|
+
this._cloneBaseInto(target);
|
|
2388
|
+
target.forceIrradianceInFragment = this.forceIrradianceInFragment;
|
|
2389
|
+
target._albedoFactor = [...this._albedoFactor];
|
|
2390
|
+
target._albedoTexture = this._albedoTexture;
|
|
2391
|
+
const src = this._lite;
|
|
2392
|
+
const dst = target._lite;
|
|
2393
|
+
if (src.clearCoat) {
|
|
2394
|
+
dst.clearCoat = { ...src.clearCoat };
|
|
2395
|
+
}
|
|
2396
|
+
if (src.sheen) {
|
|
2397
|
+
dst.sheen = { ...src.sheen };
|
|
2398
|
+
}
|
|
2399
|
+
if (src.anisotropy) {
|
|
2400
|
+
dst.anisotropy = { ...src.anisotropy };
|
|
2401
|
+
}
|
|
2402
|
+
if (src.iridescence) {
|
|
2403
|
+
dst.iridescence = { ...src.iridescence };
|
|
2404
|
+
}
|
|
2405
|
+
}
|
|
1875
2406
|
}
|
|
1876
2407
|
class PBRMetallicRoughnessMaterial extends PBRMaterial {
|
|
1877
2408
|
getClassName() {
|
|
@@ -1884,6 +2415,11 @@ class PBRMetallicRoughnessMaterial extends PBRMaterial {
|
|
|
1884
2415
|
set baseColor(value) {
|
|
1885
2416
|
this.albedoColor = value;
|
|
1886
2417
|
}
|
|
2418
|
+
clone(name) {
|
|
2419
|
+
const cloned = new PBRMetallicRoughnessMaterial(name, this._scene);
|
|
2420
|
+
this._clonePbrInto(cloned);
|
|
2421
|
+
return cloned;
|
|
2422
|
+
}
|
|
1887
2423
|
}
|
|
1888
2424
|
class PBRSpecularGlossinessMaterial extends PBRMaterial {
|
|
1889
2425
|
getClassName() {
|
|
@@ -1902,6 +2438,11 @@ class PBRSpecularGlossinessMaterial extends PBRMaterial {
|
|
|
1902
2438
|
set glossiness(value) {
|
|
1903
2439
|
this.roughness = 1 - value;
|
|
1904
2440
|
}
|
|
2441
|
+
clone(name) {
|
|
2442
|
+
const cloned = new PBRSpecularGlossinessMaterial(name, this._scene);
|
|
2443
|
+
this._clonePbrInto(cloned);
|
|
2444
|
+
return cloned;
|
|
2445
|
+
}
|
|
1905
2446
|
}
|
|
1906
2447
|
const AnimationKeyInterpolation = {
|
|
1907
2448
|
NONE: 0,
|
|
@@ -2394,8 +2935,10 @@ class AnimationGroup {
|
|
|
2394
2935
|
}
|
|
2395
2936
|
const DEFAULT_SKYBOX_URL = "https://assets.babylonjs.com/core/environments/backgroundSkybox.dds";
|
|
2396
2937
|
const DEFAULT_GROUND_URL = "https://assets.babylonjs.com/core/environments/backgroundGround.png";
|
|
2397
|
-
const DEFAULT_BRDF_URL = "/brdf-lut.png";
|
|
2398
2938
|
const DEFAULT_ENV_URL = "https://assets.babylonjs.com/environments/environmentSpecular.env";
|
|
2939
|
+
async function getBrdfLutUrl() {
|
|
2940
|
+
return (await import("./brdf-lut-data-BFfYlW71.js")).BRDF_LUT_DATA_URL;
|
|
2941
|
+
}
|
|
2399
2942
|
const _Scene = class _Scene extends AbstractScene {
|
|
2400
2943
|
constructor(engine) {
|
|
2401
2944
|
super();
|
|
@@ -2427,6 +2970,7 @@ const _Scene = class _Scene extends AbstractScene {
|
|
|
2427
2970
|
__publicField(this, "_pendingAdds", []);
|
|
2428
2971
|
__publicField(this, "_started", false);
|
|
2429
2972
|
__publicField(this, "_envTexture", null);
|
|
2973
|
+
__publicField(this, "_brdfTexture", null);
|
|
2430
2974
|
__publicField(this, "_defaultEnvOptions", null);
|
|
2431
2975
|
__publicField(this, "_shadowGenerators", []);
|
|
2432
2976
|
__publicField(this, "_pendingTextures", []);
|
|
@@ -2520,6 +3064,16 @@ const _Scene = class _Scene extends AbstractScene {
|
|
|
2520
3064
|
this._renderedAFrame = true;
|
|
2521
3065
|
this.onBeforeRenderObservable.notifyObservers(this);
|
|
2522
3066
|
}
|
|
3067
|
+
/**
|
|
3068
|
+
* @internal The Lite-core-owned mesh list backing `scene.meshes`. Babylon Lite's
|
|
3069
|
+
* `SceneContext` owns the authoritative array of scene meshes; the base
|
|
3070
|
+
* `AbstractScene.meshes` maps it back onto the canonical compat wrappers. Guarded
|
|
3071
|
+
* for prototype-only instances that have no `_lite` (GPU-free unit tests).
|
|
3072
|
+
*/
|
|
3073
|
+
_coreMeshList() {
|
|
3074
|
+
var _a;
|
|
3075
|
+
return ((_a = this._lite) == null ? void 0 : _a.meshes) ?? [];
|
|
3076
|
+
}
|
|
2523
3077
|
getEngine() {
|
|
2524
3078
|
return this._engine;
|
|
2525
3079
|
}
|
|
@@ -2531,6 +3085,16 @@ const _Scene = class _Scene extends AbstractScene {
|
|
|
2531
3085
|
getUniqueId() {
|
|
2532
3086
|
return this.uniqueId;
|
|
2533
3087
|
}
|
|
3088
|
+
/**
|
|
3089
|
+
* @internal Whether the engine has started, i.e. deferred mesh adds have been
|
|
3090
|
+
* flushed and meshes are live in the Lite scene. Used by the mesh `material`
|
|
3091
|
+
* setter and texture-readiness path to decide whether a material change must be
|
|
3092
|
+
* reconciled into the running scene (ensure renderable + rebuild) or is still
|
|
3093
|
+
* safely handled by the boot-time build.
|
|
3094
|
+
*/
|
|
3095
|
+
get _hasStarted() {
|
|
3096
|
+
return this._started;
|
|
3097
|
+
}
|
|
2534
3098
|
/**
|
|
2535
3099
|
* @internal Add a mesh to the Lite scene, deferring until engine start if the
|
|
2536
3100
|
* engine has not started yet (so a later `mesh.material = …` is captured in the
|
|
@@ -2613,8 +3177,15 @@ const _Scene = class _Scene extends AbstractScene {
|
|
|
2613
3177
|
}
|
|
2614
3178
|
/** @internal Register a `NodeMaterial` whose parse the engine drives after shadow build. */
|
|
2615
3179
|
_registerNodeMaterial(material) {
|
|
3180
|
+
if (this._started) {
|
|
3181
|
+
this._engine._registerLateWork(() => material._parse(this._engine._lite, this._liteShadowGenerators()));
|
|
3182
|
+
return;
|
|
3183
|
+
}
|
|
2616
3184
|
this._nodeMaterials.push(material);
|
|
2617
3185
|
}
|
|
3186
|
+
_liteShadowGenerators() {
|
|
3187
|
+
return this._shadowGenerators.map((g2) => g2._liteGen).filter((g2) => g2 !== void 0);
|
|
3188
|
+
}
|
|
2618
3189
|
/**
|
|
2619
3190
|
* @internal Parse all registered `NodeMaterial`s, passing the scene's built Lite
|
|
2620
3191
|
* shadow generators so NME shadow-receiver blocks sample them (Babylon.js wires
|
|
@@ -2626,7 +3197,7 @@ const _Scene = class _Scene extends AbstractScene {
|
|
|
2626
3197
|
return;
|
|
2627
3198
|
}
|
|
2628
3199
|
const engine = this._engine._lite;
|
|
2629
|
-
const liteGens = this.
|
|
3200
|
+
const liteGens = this._liteShadowGenerators();
|
|
2630
3201
|
await Promise.all(this._nodeMaterials.map((m2) => m2._parse(engine, liteGens)));
|
|
2631
3202
|
this._nodeMaterials.length = 0;
|
|
2632
3203
|
}
|
|
@@ -2791,6 +3362,47 @@ const _Scene = class _Scene extends AbstractScene {
|
|
|
2791
3362
|
set environmentTexture(value) {
|
|
2792
3363
|
this._envTexture = value;
|
|
2793
3364
|
}
|
|
3365
|
+
/**
|
|
3366
|
+
* Babylon.js `scene.environmentBRDFTexture` — the BRDF lookup used by PBR materials.
|
|
3367
|
+
* Babylon.js defaults this to an embedded Base64 LUT and lets apps swap in one of the
|
|
3368
|
+
* published variants (e.g. `https://assets.babylonjs.com/environments/correlatedMSBRDF_RGBD.png`).
|
|
3369
|
+
*
|
|
3370
|
+
* Two deliberate divergences: the getter returns `null` while unset (Babylon.js
|
|
3371
|
+
* populates it with the decoded default once a PBR material is created, whereas Lite
|
|
3372
|
+
* keeps the default as an embedded data URL and never materialises a texture object),
|
|
3373
|
+
* and the assigned texture's own GPU upload goes unused because Babylon Lite decodes
|
|
3374
|
+
* the LUT itself, from the URL, as part of building the environment.
|
|
3375
|
+
*/
|
|
3376
|
+
get environmentBRDFTexture() {
|
|
3377
|
+
return this._brdfTexture;
|
|
3378
|
+
}
|
|
3379
|
+
set environmentBRDFTexture(value) {
|
|
3380
|
+
this._brdfTexture = value;
|
|
3381
|
+
}
|
|
3382
|
+
/**
|
|
3383
|
+
* Resolve the BRDF LUT URL for the environment loaders: an app-supplied
|
|
3384
|
+
* `environmentBRDFTexture`, else the embedded Babylon.js-style default.
|
|
3385
|
+
*/
|
|
3386
|
+
async _resolveBrdfUrl() {
|
|
3387
|
+
const override = this._brdfTexture;
|
|
3388
|
+
if (!override) {
|
|
3389
|
+
return await getBrdfLutUrl();
|
|
3390
|
+
}
|
|
3391
|
+
const url = (override.url ?? override.name).trim();
|
|
3392
|
+
if (!url) {
|
|
3393
|
+
Logger.Warn(
|
|
3394
|
+
`scene.environmentBRDFTexture: the assigned ${override.getClassName()} has no source URL, so the built-in LUT is used instead. Assign a \`Texture\` created from a URL to override it.`
|
|
3395
|
+
);
|
|
3396
|
+
return await getBrdfLutUrl();
|
|
3397
|
+
}
|
|
3398
|
+
if (url.split(/[?#]/)[0].toLowerCase().endsWith(".dds")) {
|
|
3399
|
+
Logger.Warn(
|
|
3400
|
+
`scene.environmentBRDFTexture '${url}': Babylon Lite decodes the BRDF LUT from an RGBD-encoded PNG and cannot read DDS, so the built-in LUT is used instead. Use the PNG variant (e.g. https://assets.babylonjs.com/environments/correlatedMSBRDF_RGBD.png) to silence this.`
|
|
3401
|
+
);
|
|
3402
|
+
return await getBrdfLutUrl();
|
|
3403
|
+
}
|
|
3404
|
+
return url;
|
|
3405
|
+
}
|
|
2794
3406
|
/**
|
|
2795
3407
|
* Babylon.js `scene.createDefaultEnvironment` — adds an IBL skybox and ground.
|
|
2796
3408
|
* Babylon Lite performs this through `loadEnvironment` (deferred to engine start),
|
|
@@ -2855,13 +3467,13 @@ const _Scene = class _Scene extends AbstractScene {
|
|
|
2855
3467
|
});
|
|
2856
3468
|
} else if (envUrl.toLowerCase().endsWith(".dds")) {
|
|
2857
3469
|
await loadDdsEnvironment(this._lite, envUrl, {
|
|
2858
|
-
brdfUrl:
|
|
3470
|
+
brdfUrl: await this._resolveBrdfUrl(),
|
|
2859
3471
|
skipSkybox: !(opts == null ? void 0 : opts.createSkybox),
|
|
2860
3472
|
skipGround: !(opts == null ? void 0 : opts.createGround)
|
|
2861
3473
|
});
|
|
2862
3474
|
} else {
|
|
2863
3475
|
await loadEnvironment(this._lite, envUrl, {
|
|
2864
|
-
brdfUrl:
|
|
3476
|
+
brdfUrl: await this._resolveBrdfUrl(),
|
|
2865
3477
|
skyboxUrl,
|
|
2866
3478
|
skipSkybox: !(opts == null ? void 0 : opts.createSkybox),
|
|
2867
3479
|
groundTextureUrl: (opts == null ? void 0 : opts.createGround) ? DEFAULT_GROUND_URL : void 0,
|
|
@@ -3025,10 +3637,10 @@ class Light extends Node {
|
|
|
3025
3637
|
constructor(name, scene) {
|
|
3026
3638
|
super(name, scene);
|
|
3027
3639
|
/**
|
|
3028
|
-
* @internal When the light is disabled
|
|
3029
|
-
*
|
|
3030
|
-
*
|
|
3031
|
-
*
|
|
3640
|
+
* @internal When the light is effectively disabled, its Lite intensity is
|
|
3641
|
+
* forced to `0` (zero contribution) and the caller-visible intensity is
|
|
3642
|
+
* parked here so {@link intensity} keeps reporting the real value and
|
|
3643
|
+
* re-enabling restores it. `null` means the light is effectively enabled.
|
|
3032
3644
|
*/
|
|
3033
3645
|
__publicField(this, "_disabledIntensity", null);
|
|
3034
3646
|
/**
|
|
@@ -3074,23 +3686,17 @@ class Light extends Node {
|
|
|
3074
3686
|
this._liteIntensity = value;
|
|
3075
3687
|
}
|
|
3076
3688
|
}
|
|
3077
|
-
/**
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
* re-enable). The logical intensity value is preserved across the toggle.
|
|
3082
|
-
*/
|
|
3083
|
-
setEnabled(value) {
|
|
3084
|
-
if (value !== this.isEnabled()) {
|
|
3085
|
-
if (!value) {
|
|
3689
|
+
/** @internal Materialize local and inherited enabled state in Babylon Lite. */
|
|
3690
|
+
_onEffectiveEnabledStateChanged(enabled) {
|
|
3691
|
+
if (!enabled) {
|
|
3692
|
+
if (this._disabledIntensity === null) {
|
|
3086
3693
|
this._disabledIntensity = this._liteIntensity;
|
|
3087
3694
|
this._liteIntensity = 0;
|
|
3088
|
-
} else if (this._disabledIntensity !== null) {
|
|
3089
|
-
this._liteIntensity = this._disabledIntensity;
|
|
3090
|
-
this._disabledIntensity = null;
|
|
3091
3695
|
}
|
|
3696
|
+
} else if (this._disabledIntensity !== null) {
|
|
3697
|
+
this._liteIntensity = this._disabledIntensity;
|
|
3698
|
+
this._disabledIntensity = null;
|
|
3092
3699
|
}
|
|
3093
|
-
super.setEnabled(value);
|
|
3094
3700
|
}
|
|
3095
3701
|
/** Detach this light's shadow generator (compat for `light.shadowEnabled = false`). */
|
|
3096
3702
|
set shadowEnabled(enabled) {
|
|
@@ -3565,6 +4171,16 @@ class GaussianSplattingMesh extends TransformNode {
|
|
|
3565
4171
|
__publicField(this, "_ctorUrl");
|
|
3566
4172
|
/** @internal Optional Lite shader-fragment plugins applied at load (scene 126). */
|
|
3567
4173
|
__publicField(this, "_fragments");
|
|
4174
|
+
/**
|
|
4175
|
+
* Babylon.js `gs.safeOrbitCameraLimits` — safe-orbit camera limits parsed from the source
|
|
4176
|
+
* file's metadata (Adobe safe-orbit extension), or `null` when the file carries none.
|
|
4177
|
+
*
|
|
4178
|
+
* Babylon Lite's splat loaders (`loadSplat` / `loadSOG` / `loadSPZ`) do not parse the Adobe
|
|
4179
|
+
* safe-orbit metadata block, so this stays `null` — matching BJS's own default for a file
|
|
4180
|
+
* without the extension. Populating it from real metadata needs a (non-tree-shakeable) change
|
|
4181
|
+
* to Lite's splat loaders; the field is exposed here for shape parity so ported reads resolve.
|
|
4182
|
+
*/
|
|
4183
|
+
__publicField(this, "safeOrbitCameraLimits", null);
|
|
3568
4184
|
this._ctorUrl = url ?? null;
|
|
3569
4185
|
}
|
|
3570
4186
|
getClassName() {
|
|
@@ -3691,10 +4307,43 @@ class BaseTexture {
|
|
|
3691
4307
|
__publicField(this, "name", "");
|
|
3692
4308
|
/** @internal The underlying Lite texture handle. Undefined until the async load resolves. */
|
|
3693
4309
|
__publicField(this, "_lite");
|
|
4310
|
+
/** @internal One-shot listeners fired when the GPU handle first resolves (see {@link _onReady}). */
|
|
4311
|
+
__publicField(this, "_readyListeners");
|
|
3694
4312
|
}
|
|
3695
4313
|
getClassName() {
|
|
3696
4314
|
return "BaseTexture";
|
|
3697
4315
|
}
|
|
4316
|
+
/**
|
|
4317
|
+
* @internal Register a callback fired once this texture's GPU handle resolves.
|
|
4318
|
+
* Owning compat materials use it to rebind and rebuild once an asynchronously
|
|
4319
|
+
* loaded texture becomes available. Fires immediately if the handle already
|
|
4320
|
+
* exists; otherwise queues until {@link _notifyReady}. One-shot per listener.
|
|
4321
|
+
*/
|
|
4322
|
+
_onReady(listener) {
|
|
4323
|
+
if (this._lite) {
|
|
4324
|
+
listener();
|
|
4325
|
+
return;
|
|
4326
|
+
}
|
|
4327
|
+
(this._readyListeners ?? (this._readyListeners = [])).push(listener);
|
|
4328
|
+
}
|
|
4329
|
+
/** @internal Fire and clear the readiness listeners (called by subclasses once `_lite` resolves). */
|
|
4330
|
+
_notifyReady() {
|
|
4331
|
+
const listeners = this._readyListeners;
|
|
4332
|
+
if (listeners) {
|
|
4333
|
+
this._readyListeners = void 0;
|
|
4334
|
+
for (const listener of listeners) {
|
|
4335
|
+
listener();
|
|
4336
|
+
}
|
|
4337
|
+
}
|
|
4338
|
+
}
|
|
4339
|
+
/**
|
|
4340
|
+
* Babylon.js `BaseTexture.getInternalTexture()` — the backend texture handle. Babylon.js
|
|
4341
|
+
* returns an `InternalTexture`; the compat layer's equivalent is the Lite texture handle,
|
|
4342
|
+
* which is what the compat engine's texture methods accept.
|
|
4343
|
+
*/
|
|
4344
|
+
getInternalTexture() {
|
|
4345
|
+
return this._lite ?? null;
|
|
4346
|
+
}
|
|
3698
4347
|
dispose() {
|
|
3699
4348
|
}
|
|
3700
4349
|
}
|
|
@@ -3703,6 +4352,7 @@ const _Texture = class _Texture extends BaseTexture {
|
|
|
3703
4352
|
var _a;
|
|
3704
4353
|
super();
|
|
3705
4354
|
__publicField(this, "_ready");
|
|
4355
|
+
__publicField(this, "_onLoadObservable");
|
|
3706
4356
|
/** Babylon.js texture UV tiling (applied to the Lite material at bind time). */
|
|
3707
4357
|
__publicField(this, "uScale", 1);
|
|
3708
4358
|
__publicField(this, "vScale", 1);
|
|
@@ -3741,8 +4391,13 @@ const _Texture = class _Texture extends BaseTexture {
|
|
|
3741
4391
|
const loadOpts = scene ? { invertY: this._invertY, mipMaps: !this._noMipmap, ...filterOpts } : {};
|
|
3742
4392
|
this._ready = loadCompatTexture(engine, url, loadOpts).then((tex) => {
|
|
3743
4393
|
this._lite = tex;
|
|
3744
|
-
|
|
3745
|
-
|
|
4394
|
+
try {
|
|
4395
|
+
this._notifyLoadObservable();
|
|
4396
|
+
if (onLoad) {
|
|
4397
|
+
onLoad();
|
|
4398
|
+
}
|
|
4399
|
+
} finally {
|
|
4400
|
+
this._notifyReady();
|
|
3746
4401
|
}
|
|
3747
4402
|
});
|
|
3748
4403
|
scene == null ? void 0 : scene._trackTextureLoad(this._ready);
|
|
@@ -3769,6 +4424,23 @@ const _Texture = class _Texture extends BaseTexture {
|
|
|
3769
4424
|
whenReadyAsync() {
|
|
3770
4425
|
return this._ready;
|
|
3771
4426
|
}
|
|
4427
|
+
/** Babylon.js `Texture.onLoadObservable`, allocated only when code subscribes. */
|
|
4428
|
+
get onLoadObservable() {
|
|
4429
|
+
let observable = this._onLoadObservable;
|
|
4430
|
+
if (!observable) {
|
|
4431
|
+
observable = new Observable(void 0, true);
|
|
4432
|
+
this._onLoadObservable = observable;
|
|
4433
|
+
if (this.isReady()) {
|
|
4434
|
+
observable.notifyObservers(this);
|
|
4435
|
+
}
|
|
4436
|
+
}
|
|
4437
|
+
return observable;
|
|
4438
|
+
}
|
|
4439
|
+
_notifyLoadObservable() {
|
|
4440
|
+
if (this._onLoadObservable) {
|
|
4441
|
+
this._onLoadObservable.notifyObservers(this);
|
|
4442
|
+
}
|
|
4443
|
+
}
|
|
3772
4444
|
/** Babylon.js `BaseTexture.isReady()` — true once the GPU handle has resolved. */
|
|
3773
4445
|
isReady() {
|
|
3774
4446
|
return this._lite !== void 0;
|
|
@@ -4002,55 +4674,197 @@ class RenderTargetTexture {
|
|
|
4002
4674
|
unsupported("RenderTargetTexture", "Offscreen rendering uses Babylon Lite's frame-graph render-target APIs (`createRenderTargetTexture` / render tasks).");
|
|
4003
4675
|
}
|
|
4004
4676
|
}
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4677
|
+
var ScenePerformancePriority = /* @__PURE__ */ ((ScenePerformancePriority2) => {
|
|
4678
|
+
ScenePerformancePriority2[ScenePerformancePriority2["BackwardCompatible"] = 0] = "BackwardCompatible";
|
|
4679
|
+
ScenePerformancePriority2[ScenePerformancePriority2["Intermediate"] = 1] = "Intermediate";
|
|
4680
|
+
ScenePerformancePriority2[ScenePerformancePriority2["Aggressive"] = 2] = "Aggressive";
|
|
4681
|
+
return ScenePerformancePriority2;
|
|
4682
|
+
})(ScenePerformancePriority || {});
|
|
4683
|
+
var ShaderLanguage = /* @__PURE__ */ ((ShaderLanguage2) => {
|
|
4684
|
+
ShaderLanguage2[ShaderLanguage2["GLSL"] = 0] = "GLSL";
|
|
4685
|
+
ShaderLanguage2[ShaderLanguage2["WGSL"] = 1] = "WGSL";
|
|
4686
|
+
return ShaderLanguage2;
|
|
4687
|
+
})(ShaderLanguage || {});
|
|
4688
|
+
class ImageProcessingConfiguration {
|
|
4689
|
+
}
|
|
4690
|
+
__publicField(ImageProcessingConfiguration, "TONEMAPPING_STANDARD", 0);
|
|
4691
|
+
__publicField(ImageProcessingConfiguration, "TONEMAPPING_ACES", 1);
|
|
4692
|
+
__publicField(ImageProcessingConfiguration, "TONEMAPPING_KHR_PBR_NEUTRAL", 2);
|
|
4693
|
+
const Constants = {
|
|
4694
|
+
MATERIAL_ClockWiseSideOrientation: 0,
|
|
4695
|
+
MATERIAL_CounterClockWiseSideOrientation: 1,
|
|
4696
|
+
MATERIAL_TriangleFillMode: 0,
|
|
4697
|
+
MATERIAL_WireFrameFillMode: 1,
|
|
4698
|
+
MATERIAL_PointFillMode: 2,
|
|
4699
|
+
ALPHA_DISABLE: 0,
|
|
4700
|
+
ALPHA_ADD: 1,
|
|
4701
|
+
ALPHA_COMBINE: 2,
|
|
4702
|
+
ALPHA_ONEONE: 6,
|
|
4703
|
+
ALPHA_PREMULTIPLIED: 7,
|
|
4704
|
+
ALPHA_REPLACE_COLOR: 21,
|
|
4705
|
+
MATERIAL_OPAQUE: 0,
|
|
4706
|
+
MATERIAL_ALPHATEST: 1,
|
|
4707
|
+
MATERIAL_ALPHABLEND: 2,
|
|
4708
|
+
TEXTURE_CLAMP_ADDRESSMODE: 0,
|
|
4709
|
+
TEXTURE_WRAP_ADDRESSMODE: 1,
|
|
4710
|
+
TEXTURE_MIRROR_ADDRESSMODE: 2,
|
|
4711
|
+
TEXTURE_NEAREST_SAMPLINGMODE: 1,
|
|
4712
|
+
TEXTURE_BILINEAR_SAMPLINGMODE: 2,
|
|
4713
|
+
TEXTURE_TRILINEAR_SAMPLINGMODE: 3,
|
|
4714
|
+
TEXTUREFORMAT_RGBA: 5,
|
|
4715
|
+
TEXTURETYPE_UNSIGNED_BYTE: 0
|
|
4716
|
+
};
|
|
4717
|
+
class RawTexture2DArray extends BaseTexture {
|
|
4718
|
+
constructor(data, width, height, depth, format, scene, generateMipMaps = true, _invertY = false, _samplingMode = 3, _textureType, _creationFlags, _mipLevelCount) {
|
|
4719
|
+
super();
|
|
4720
|
+
/** @internal The underlying Lite 2D-array handle (aliases `_lite`). */
|
|
4721
|
+
__publicField(this, "_liteArray");
|
|
4722
|
+
/** Babylon.js `RawTexture2DArray.is2DArray` — always true. */
|
|
4723
|
+
__publicField(this, "is2DArray", true);
|
|
4724
|
+
/** @internal Owning compat scene. */
|
|
4725
|
+
__publicField(this, "_sceneRef");
|
|
4726
|
+
this.format = format;
|
|
4727
|
+
this._sceneRef = scene;
|
|
4728
|
+
const engine = scene.getEngine()._lite;
|
|
4729
|
+
const tex = data === null ? createTexture2DArray(engine, width, height, depth, { mipMaps: generateMipMaps }) : createTexture2DArrayFromPixels(engine, toRgbaBytes(data, width, height, depth), width, height, depth, { mipMaps: generateMipMaps });
|
|
4730
|
+
this._liteArray = tex;
|
|
4731
|
+
this._lite = tex;
|
|
4022
4732
|
}
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4733
|
+
getClassName() {
|
|
4734
|
+
return "RawTexture2DArray";
|
|
4735
|
+
}
|
|
4736
|
+
/** Babylon.js `RawTexture2DArray.depth` — the number of array layers. */
|
|
4737
|
+
get depth() {
|
|
4738
|
+
var _a;
|
|
4739
|
+
return ((_a = this._liteArray) == null ? void 0 : _a.layers) ?? 0;
|
|
4740
|
+
}
|
|
4741
|
+
/** The scene this texture belongs to (Babylon.js `ThinTexture.getScene`). */
|
|
4742
|
+
getScene() {
|
|
4743
|
+
return this._sceneRef;
|
|
4744
|
+
}
|
|
4745
|
+
/**
|
|
4746
|
+
* Babylon.js `RawTexture2DArray.getInternalTexture()` — the backend handle the compat
|
|
4747
|
+
* engine's texture methods accept (Lite's `Texture2DArray`).
|
|
4748
|
+
*/
|
|
4749
|
+
getInternalTexture() {
|
|
4750
|
+
return this._liteArray ?? null;
|
|
4751
|
+
}
|
|
4752
|
+
/** Babylon.js `RawTexture2DArray.update(data)` — replace the base mip of every layer. */
|
|
4753
|
+
update(data) {
|
|
4754
|
+
this.updateMipLevel(data, 0);
|
|
4755
|
+
}
|
|
4756
|
+
/**
|
|
4757
|
+
* Babylon.js `RawTexture2DArray.updateMipLevel(data, mipLevel)` — replace one mip level of
|
|
4758
|
+
* every layer. Level dimensions are `max(1, size >> mipLevel)`; writing level 0 of a
|
|
4759
|
+
* mipmapped array regenerates the rest of the chain, exactly as Babylon.js does.
|
|
4760
|
+
*/
|
|
4761
|
+
updateMipLevel(data, mipLevel) {
|
|
4762
|
+
const array = this._liteArray;
|
|
4763
|
+
if (!array) {
|
|
4764
|
+
return;
|
|
4029
4765
|
}
|
|
4030
|
-
|
|
4766
|
+
const width = Math.max(1, array.width >> mipLevel);
|
|
4767
|
+
const height = Math.max(1, array.height >> mipLevel);
|
|
4768
|
+
updateTexture2DArrayFromPixels(this._sceneRef.getEngine()._lite, array, toRgbaBytes(data, width, height, array.layers), mipLevel);
|
|
4031
4769
|
}
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
const positions = this._mesh._cpuPositions;
|
|
4035
|
-
return kind === "position" ? positions ?? null : null;
|
|
4770
|
+
whenReadyAsync() {
|
|
4771
|
+
return Promise.resolve();
|
|
4036
4772
|
}
|
|
4037
|
-
/**
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4773
|
+
/**
|
|
4774
|
+
* @internal Reconcile the image-URL construction path
|
|
4775
|
+
* ({@link CreateTexture2DArrayFromImageUrlsAsync}) into the single BJS-named
|
|
4776
|
+
* class without re-running the allocating constructor.
|
|
4777
|
+
*/
|
|
4778
|
+
static _fromLite(liteArray, format, scene) {
|
|
4779
|
+
const tex = Object.create(RawTexture2DArray.prototype);
|
|
4780
|
+
tex.name = "";
|
|
4781
|
+
tex.is2DArray = true;
|
|
4782
|
+
tex.format = format;
|
|
4783
|
+
tex._sceneRef = scene;
|
|
4784
|
+
tex._liteArray = liteArray;
|
|
4785
|
+
tex._lite = liteArray;
|
|
4786
|
+
return tex;
|
|
4787
|
+
}
|
|
4788
|
+
/** Babylon.js `RawTexture2DArray.CreateRGBATexture` — RGBA raw-bytes factory. */
|
|
4789
|
+
static CreateRGBATexture(data, width, height, depth, scene, generateMipMaps = true, invertY = false, samplingMode = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE, type = Constants.TEXTURETYPE_UNSIGNED_BYTE) {
|
|
4790
|
+
return new RawTexture2DArray(data, width, height, depth, Constants.TEXTUREFORMAT_RGBA, scene, generateMipMaps, invertY, samplingMode, type);
|
|
4791
|
+
}
|
|
4792
|
+
}
|
|
4793
|
+
async function CreateTexture2DArrayFromKTX2Async(scene, data, options) {
|
|
4794
|
+
let buffer;
|
|
4795
|
+
if (typeof data === "string") {
|
|
4796
|
+
const response = await fetch(data);
|
|
4797
|
+
if (!response.ok) {
|
|
4798
|
+
throw new Error(`Failed to fetch KTX2 file "${data}": ${response.status} ${response.statusText}`);
|
|
4799
|
+
}
|
|
4800
|
+
buffer = new Uint8Array(await response.arrayBuffer());
|
|
4801
|
+
} else {
|
|
4802
|
+
buffer = data;
|
|
4803
|
+
}
|
|
4804
|
+
const samplingMode = (options == null ? void 0 : options.samplingMode) ?? Constants.TEXTURE_TRILINEAR_SAMPLINGMODE;
|
|
4805
|
+
const nearest = samplingMode === Constants.TEXTURE_NEAREST_SAMPLINGMODE;
|
|
4806
|
+
const bilinear = samplingMode === Constants.TEXTURE_BILINEAR_SAMPLINGMODE;
|
|
4807
|
+
const liteArray = await createTexture2DArrayFromKtx2(scene.getEngine()._lite, buffer, {
|
|
4808
|
+
generateMipMaps: (options == null ? void 0 : options.generateMipMaps) ?? true,
|
|
4809
|
+
invertY: (options == null ? void 0 : options.invertY) ?? false,
|
|
4810
|
+
minFilter: nearest ? "nearest" : "linear",
|
|
4811
|
+
magFilter: nearest ? "nearest" : "linear",
|
|
4812
|
+
mipmapFilter: nearest || bilinear ? "nearest" : "linear"
|
|
4813
|
+
});
|
|
4814
|
+
return RawTexture2DArray._fromLite(liteArray, Constants.TEXTUREFORMAT_RGBA, scene);
|
|
4815
|
+
}
|
|
4816
|
+
function liteArrayOf(texture) {
|
|
4817
|
+
const array = texture.getInternalTexture();
|
|
4818
|
+
if (!array) {
|
|
4819
|
+
throw new Error("Cannot upload to a 2D array texture that has no internal texture.");
|
|
4041
4820
|
}
|
|
4821
|
+
return array;
|
|
4822
|
+
}
|
|
4823
|
+
function UploadImageToTexture2DArrayLayer(texture, source, layer, options) {
|
|
4824
|
+
const array = liteArrayOf(texture);
|
|
4825
|
+
if (!Number.isInteger(layer) || layer < 0 || layer >= texture.depth) {
|
|
4826
|
+
throw new Error(`Layer ${layer} is out of range for a 2D array texture with ${texture.depth} layers.`);
|
|
4827
|
+
}
|
|
4828
|
+
texture.getScene().getEngine().updateTextureArrayLayerFromImageSource(array, source, layer, (options == null ? void 0 : options.invertY) ?? false, (options == null ? void 0 : options.premultiplyAlpha) ?? false);
|
|
4829
|
+
}
|
|
4830
|
+
async function LoadImageToTexture2DArrayLayerAsync(texture, url, layer, options) {
|
|
4831
|
+
const array = liteArrayOf(texture);
|
|
4832
|
+
await loadImageToArrayLayer(texture.getScene().getEngine()._lite, array, layer, url, {
|
|
4833
|
+
invertY: (options == null ? void 0 : options.invertY) ?? false,
|
|
4834
|
+
premultiplyAlpha: (options == null ? void 0 : options.premultiplyAlpha) ?? false
|
|
4835
|
+
});
|
|
4836
|
+
}
|
|
4837
|
+
async function CreateTexture2DArrayFromImageUrlsAsync(scene, urls, options) {
|
|
4838
|
+
const liteArray = await createTexture2DArrayFromUrls(scene.getEngine()._lite, urls, {
|
|
4839
|
+
mipMaps: (options == null ? void 0 : options.generateMipMaps) ?? true,
|
|
4840
|
+
invertY: (options == null ? void 0 : options.invertY) ?? false,
|
|
4841
|
+
premultiplyAlpha: (options == null ? void 0 : options.premultiplyAlpha) ?? false
|
|
4842
|
+
});
|
|
4843
|
+
return RawTexture2DArray._fromLite(liteArray, Constants.TEXTUREFORMAT_RGBA, scene);
|
|
4042
4844
|
}
|
|
4043
|
-
function collectLoadedMeshes(container) {
|
|
4044
|
-
const renderable = getContainerMeshes(container);
|
|
4845
|
+
function collectLoadedMeshes(container, registry, scene) {
|
|
4045
4846
|
const result = [];
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
if (
|
|
4049
|
-
|
|
4847
|
+
const visited = /* @__PURE__ */ new Set();
|
|
4848
|
+
const visit = (node, parent) => {
|
|
4849
|
+
if (visited.has(node)) {
|
|
4850
|
+
return;
|
|
4050
4851
|
}
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4852
|
+
const lite = node;
|
|
4853
|
+
if (!lite._gpu && !Array.isArray(lite.children)) {
|
|
4854
|
+
return;
|
|
4855
|
+
}
|
|
4856
|
+
visited.add(node);
|
|
4857
|
+
let wrapper = registry.get(node);
|
|
4858
|
+
if (!wrapper || scene && wrapper.getScene() !== scene) {
|
|
4859
|
+
wrapper = Mesh._fromLiteHierarchy(node, container, scene, registry, parent);
|
|
4860
|
+
}
|
|
4861
|
+
result.push(wrapper);
|
|
4862
|
+
for (const child of lite.children ?? []) {
|
|
4863
|
+
visit(child, wrapper);
|
|
4864
|
+
}
|
|
4865
|
+
};
|
|
4866
|
+
for (const entity of container.entities) {
|
|
4867
|
+
visit(entity, null);
|
|
4054
4868
|
}
|
|
4055
4869
|
return result;
|
|
4056
4870
|
}
|
|
@@ -4072,18 +4886,29 @@ class AssetContainer {
|
|
|
4072
4886
|
constructor(lite) {
|
|
4073
4887
|
/** @internal Underlying Babylon Lite asset container. */
|
|
4074
4888
|
__publicField(this, "_lite");
|
|
4889
|
+
/** @internal Canonical loaded-mesh wrappers, cached per Lite node for stable identity. */
|
|
4890
|
+
__publicField(this, "_meshRegistry", /* @__PURE__ */ new Map());
|
|
4891
|
+
/** @internal The compat scene this container was added to, if any (drives scene-aware wrappers). */
|
|
4892
|
+
__publicField(this, "_scene");
|
|
4075
4893
|
this._lite = lite;
|
|
4076
4894
|
}
|
|
4077
4895
|
get animationGroups() {
|
|
4078
4896
|
return this._lite.animationGroups ?? [];
|
|
4079
4897
|
}
|
|
4080
|
-
/**
|
|
4898
|
+
/**
|
|
4899
|
+
* Flat list of the loaded meshes as canonical, stable-identity compat `Mesh`
|
|
4900
|
+
* handles (`__root__` at index 0, matching Babylon.js). Repeated reads return
|
|
4901
|
+
* the same wrapper objects, and — once the container is added to a scene — the
|
|
4902
|
+
* same handles `scene.meshes` exposes.
|
|
4903
|
+
*/
|
|
4081
4904
|
get meshes() {
|
|
4082
|
-
return collectLoadedMeshes(this._lite);
|
|
4905
|
+
return collectLoadedMeshes(this._lite, this._meshRegistry, this._scene);
|
|
4083
4906
|
}
|
|
4084
4907
|
/** Add every entity, animation group, camera, and clear colour to the scene. */
|
|
4085
4908
|
addAllToScene(scene) {
|
|
4086
4909
|
addToScene(scene._lite, this._lite);
|
|
4910
|
+
this._scene = scene;
|
|
4911
|
+
collectLoadedMeshes(this._lite, this._meshRegistry, scene);
|
|
4087
4912
|
scene._surfaceLoadedCamera();
|
|
4088
4913
|
}
|
|
4089
4914
|
dispose() {
|
|
@@ -5385,19 +6210,39 @@ class NodeMaterialBlockProxy {
|
|
|
5385
6210
|
}
|
|
5386
6211
|
}
|
|
5387
6212
|
class NodeMaterial {
|
|
5388
|
-
constructor(name,
|
|
6213
|
+
constructor(name, scene, json = {}) {
|
|
5389
6214
|
__publicField(this, "name");
|
|
5390
6215
|
__publicField(this, "backFaceCulling", true);
|
|
5391
6216
|
/** @internal The compiled Lite node material. Undefined until the async parse resolves. */
|
|
5392
6217
|
__publicField(this, "_lite");
|
|
5393
6218
|
__publicField(this, "_json");
|
|
5394
6219
|
__publicField(this, "_textureOverrides", {});
|
|
6220
|
+
__publicField(this, "_scene");
|
|
6221
|
+
__publicField(this, "_pendingBindings", /* @__PURE__ */ new Map());
|
|
6222
|
+
__publicField(this, "_parsed", false);
|
|
5395
6223
|
this.name = name;
|
|
6224
|
+
this._scene = scene;
|
|
5396
6225
|
this._json = json;
|
|
5397
6226
|
}
|
|
5398
6227
|
getClassName() {
|
|
5399
6228
|
return "NodeMaterial";
|
|
5400
6229
|
}
|
|
6230
|
+
/**
|
|
6231
|
+
* Babylon.js `NodeMaterial.clone(name)`. Reuses the same NME source graph and the
|
|
6232
|
+
* captured per-block texture overrides (textures shared by reference, as
|
|
6233
|
+
* Babylon.js does), registering the clone with the scene so it parses/compiles its
|
|
6234
|
+
* own Lite node material (own renderable) at engine start.
|
|
6235
|
+
*/
|
|
6236
|
+
clone(name) {
|
|
6237
|
+
const cloned = new NodeMaterial(name, this._scene, this._json);
|
|
6238
|
+
for (const [block, tex] of Object.entries(this._textureOverrides)) {
|
|
6239
|
+
cloned._textureOverrides[block] = tex;
|
|
6240
|
+
}
|
|
6241
|
+
cloned.backFaceCulling = this.backFaceCulling;
|
|
6242
|
+
cloned._lite = this._lite;
|
|
6243
|
+
this._scene._registerNodeMaterial(cloned);
|
|
6244
|
+
return cloned;
|
|
6245
|
+
}
|
|
5401
6246
|
/** Babylon.js `getBlockByName(name)` — returns a proxy that captures texture overrides. */
|
|
5402
6247
|
getBlockByName(name) {
|
|
5403
6248
|
return new NodeMaterialBlockProxy(this, name);
|
|
@@ -5420,6 +6265,15 @@ class NodeMaterial {
|
|
|
5420
6265
|
/** @internal Parse already happened via the scene-tracked promise; nothing to finalize. */
|
|
5421
6266
|
_ensureRenderable(_engine) {
|
|
5422
6267
|
}
|
|
6268
|
+
/** @internal Bind a mesh immediately and refresh it if still assigned when parsing finishes. */
|
|
6269
|
+
_bindMesh(mesh, isCurrent) {
|
|
6270
|
+
if (!this._parsed) {
|
|
6271
|
+
this._pendingBindings.set(mesh, isCurrent);
|
|
6272
|
+
}
|
|
6273
|
+
if (this._lite) {
|
|
6274
|
+
mesh.material = this._lite;
|
|
6275
|
+
}
|
|
6276
|
+
}
|
|
5423
6277
|
dispose() {
|
|
5424
6278
|
}
|
|
5425
6279
|
/** @internal Resolve override textures, then parse + compile the NME graph. */
|
|
@@ -5436,14 +6290,24 @@ class NodeMaterial {
|
|
|
5436
6290
|
textures[blockName] = tex._lite;
|
|
5437
6291
|
}
|
|
5438
6292
|
}
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
6293
|
+
try {
|
|
6294
|
+
this._lite = await parseNodeMaterialFromSnippet(engine, "", {
|
|
6295
|
+
json: this._json,
|
|
6296
|
+
...overrides.length ? { textures } : {},
|
|
6297
|
+
// Babylon.js wires shadows into the scene globally; Babylon Lite takes them
|
|
6298
|
+
// at NME parse time, so NME shadow-receiver blocks sample the scene's
|
|
6299
|
+
// generators (e.g. ground `receiveShadows` in scenes 65/66).
|
|
6300
|
+
...shadowGenerators.length ? { shadowGenerators } : {}
|
|
6301
|
+
});
|
|
6302
|
+
this._parsed = true;
|
|
6303
|
+
for (const [mesh, isCurrent] of this._pendingBindings) {
|
|
6304
|
+
if (isCurrent()) {
|
|
6305
|
+
mesh.material = this._lite;
|
|
6306
|
+
}
|
|
6307
|
+
}
|
|
6308
|
+
} finally {
|
|
6309
|
+
this._pendingBindings.clear();
|
|
6310
|
+
}
|
|
5447
6311
|
}
|
|
5448
6312
|
/**
|
|
5449
6313
|
* Babylon.js `NodeMaterial.Parse(source, scene, rootUrl?)` — parse an NME graph
|
|
@@ -5539,363 +6403,131 @@ class EasingFunction {
|
|
|
5539
6403
|
return this.easeInCore(gradient);
|
|
5540
6404
|
case EASINGMODE_EASEOUT:
|
|
5541
6405
|
return 1 - this.easeInCore(1 - gradient);
|
|
5542
|
-
default:
|
|
5543
|
-
return gradient >= 0.5 ? 1 - this.easeInCore((1 - gradient) * 2) * 0.5 : this.easeInCore(gradient * 2) * 0.5;
|
|
5544
|
-
}
|
|
5545
|
-
}
|
|
5546
|
-
}
|
|
5547
|
-
__publicField(EasingFunction, "EASINGMODE_EASEIN", EASINGMODE_EASEIN);
|
|
5548
|
-
__publicField(EasingFunction, "EASINGMODE_EASEOUT", EASINGMODE_EASEOUT);
|
|
5549
|
-
__publicField(EasingFunction, "EASINGMODE_EASEINOUT", EASINGMODE_EASEINOUT);
|
|
5550
|
-
class CircleEase extends EasingFunction {
|
|
5551
|
-
easeInCore(gradient) {
|
|
5552
|
-
const g2 = Math.max(0, Math.min(1, gradient));
|
|
5553
|
-
return 1 - Math.sqrt(1 - g2 * g2);
|
|
5554
|
-
}
|
|
5555
|
-
}
|
|
5556
|
-
class QuadraticEase extends EasingFunction {
|
|
5557
|
-
easeInCore(gradient) {
|
|
5558
|
-
return gradient * gradient;
|
|
5559
|
-
}
|
|
5560
|
-
}
|
|
5561
|
-
class CubicEase extends EasingFunction {
|
|
5562
|
-
easeInCore(gradient) {
|
|
5563
|
-
return gradient * gradient * gradient;
|
|
5564
|
-
}
|
|
5565
|
-
}
|
|
5566
|
-
class QuarticEase extends EasingFunction {
|
|
5567
|
-
easeInCore(gradient) {
|
|
5568
|
-
return gradient * gradient * gradient * gradient;
|
|
5569
|
-
}
|
|
5570
|
-
}
|
|
5571
|
-
class QuinticEase extends EasingFunction {
|
|
5572
|
-
easeInCore(gradient) {
|
|
5573
|
-
return gradient * gradient * gradient * gradient * gradient;
|
|
5574
|
-
}
|
|
5575
|
-
}
|
|
5576
|
-
class SineEase extends EasingFunction {
|
|
5577
|
-
easeInCore(gradient) {
|
|
5578
|
-
return 1 - Math.sin(Math.PI / 2 * (1 - gradient));
|
|
5579
|
-
}
|
|
5580
|
-
}
|
|
5581
|
-
class ExponentialEase extends EasingFunction {
|
|
5582
|
-
constructor(exponent = 2) {
|
|
5583
|
-
super();
|
|
5584
|
-
this.exponent = exponent;
|
|
5585
|
-
}
|
|
5586
|
-
easeInCore(gradient) {
|
|
5587
|
-
if (this.exponent <= 0) {
|
|
5588
|
-
return gradient;
|
|
5589
|
-
}
|
|
5590
|
-
return (Math.exp(this.exponent * gradient) - 1) / (Math.exp(this.exponent) - 1);
|
|
5591
|
-
}
|
|
5592
|
-
}
|
|
5593
|
-
class BackEase extends EasingFunction {
|
|
5594
|
-
constructor(amplitude = 1) {
|
|
5595
|
-
super();
|
|
5596
|
-
this.amplitude = amplitude;
|
|
5597
|
-
}
|
|
5598
|
-
easeInCore(gradient) {
|
|
5599
|
-
const num = Math.max(0, this.amplitude);
|
|
5600
|
-
return Math.pow(gradient, 3) - gradient * num * Math.sin(Math.PI * gradient);
|
|
5601
|
-
}
|
|
5602
|
-
}
|
|
5603
|
-
class ElasticEase extends EasingFunction {
|
|
5604
|
-
constructor(oscillations = 3, springiness = 3) {
|
|
5605
|
-
super();
|
|
5606
|
-
this.oscillations = oscillations;
|
|
5607
|
-
this.springiness = springiness;
|
|
5608
|
-
}
|
|
5609
|
-
easeInCore(gradient) {
|
|
5610
|
-
const num2 = Math.max(0, this.oscillations);
|
|
5611
|
-
const num3 = Math.max(0, this.springiness);
|
|
5612
|
-
const num = num3 === 0 ? gradient : (Math.exp(num3 * gradient) - 1) / (Math.exp(num3) - 1);
|
|
5613
|
-
return num * Math.sin((2 * Math.PI * num2 + Math.PI / 2) * gradient);
|
|
5614
|
-
}
|
|
5615
|
-
}
|
|
5616
|
-
class BounceEase extends EasingFunction {
|
|
5617
|
-
constructor(bounces = 3, bounciness = 2) {
|
|
5618
|
-
super();
|
|
5619
|
-
this.bounces = bounces;
|
|
5620
|
-
this.bounciness = bounciness;
|
|
5621
|
-
}
|
|
5622
|
-
easeInCore(gradient) {
|
|
5623
|
-
const num = Math.max(0, this.bounces);
|
|
5624
|
-
let bounciness = this.bounciness;
|
|
5625
|
-
if (bounciness <= 1) {
|
|
5626
|
-
bounciness = 1.001;
|
|
5627
|
-
}
|
|
5628
|
-
const num2 = Math.pow(bounciness, num);
|
|
5629
|
-
const num3 = 1 - bounciness;
|
|
5630
|
-
const num4 = (1 - num2) / num3 + num2 * 0.5;
|
|
5631
|
-
const num5 = gradient * num4;
|
|
5632
|
-
const num6 = Math.log(-num5 * (1 - bounciness) + 1) / Math.log(bounciness);
|
|
5633
|
-
const num7 = Math.floor(num6);
|
|
5634
|
-
const num8 = num7 + 1;
|
|
5635
|
-
const num9 = (1 - Math.pow(bounciness, num7)) / (num3 * num4);
|
|
5636
|
-
const num10 = (1 - Math.pow(bounciness, num8)) / (num3 * num4);
|
|
5637
|
-
const num11 = (num9 + num10) * 0.5;
|
|
5638
|
-
const num12 = gradient - num11;
|
|
5639
|
-
const num13 = num11 - num9;
|
|
5640
|
-
return -Math.pow(1 / bounciness, num - num7) / (num13 * num13) * (num12 - num13) * (num12 + num13);
|
|
5641
|
-
}
|
|
5642
|
-
}
|
|
5643
|
-
const Tools = {
|
|
5644
|
-
/** High-resolution timestamp in milliseconds. */
|
|
5645
|
-
Now() {
|
|
5646
|
-
return typeof performance !== "undefined" ? performance.now() : Date.now();
|
|
5647
|
-
},
|
|
5648
|
-
ToRadians(degrees) {
|
|
5649
|
-
return degrees * Math.PI / 180;
|
|
5650
|
-
},
|
|
5651
|
-
ToDegrees(radians) {
|
|
5652
|
-
return radians * 180 / Math.PI;
|
|
5653
|
-
},
|
|
5654
|
-
/** Clamp `value` into the inclusive `[min, max]` range. */
|
|
5655
|
-
Clamp(value, min = 0, max = 1) {
|
|
5656
|
-
return Math.min(max, Math.max(min, value));
|
|
5657
|
-
},
|
|
5658
|
-
/** Generate an RFC4122 v4 UUID (used by Babylon.js for unique ids). */
|
|
5659
|
-
RandomId() {
|
|
5660
|
-
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c2) => {
|
|
5661
|
-
const r = Math.random() * 16 | 0;
|
|
5662
|
-
const v = c2 === "x" ? r : r & 3 | 8;
|
|
5663
|
-
return v.toString(16);
|
|
5664
|
-
});
|
|
5665
|
-
}
|
|
5666
|
-
};
|
|
5667
|
-
class SmartArray {
|
|
5668
|
-
constructor(capacity) {
|
|
5669
|
-
__publicField(this, "data");
|
|
5670
|
-
__publicField(this, "length", 0);
|
|
5671
|
-
this.data = new Array(capacity);
|
|
5672
|
-
}
|
|
5673
|
-
push(value) {
|
|
5674
|
-
this.data[this.length++] = value;
|
|
5675
|
-
if (this.length > this.data.length) {
|
|
5676
|
-
this.data.length = this.length;
|
|
5677
|
-
}
|
|
5678
|
-
}
|
|
5679
|
-
reset() {
|
|
5680
|
-
this.length = 0;
|
|
5681
|
-
}
|
|
5682
|
-
concat(array) {
|
|
5683
|
-
for (let i2 = 0; i2 < array.length; i2++) {
|
|
5684
|
-
this.push(array.data[i2]);
|
|
5685
|
-
}
|
|
5686
|
-
}
|
|
5687
|
-
dispose() {
|
|
5688
|
-
this.reset();
|
|
5689
|
-
this.data.length = 0;
|
|
5690
|
-
}
|
|
5691
|
-
}
|
|
5692
|
-
class StringDictionary {
|
|
5693
|
-
constructor() {
|
|
5694
|
-
__publicField(this, "_store", {});
|
|
5695
|
-
}
|
|
5696
|
-
get count() {
|
|
5697
|
-
return Object.keys(this._store).length;
|
|
5698
|
-
}
|
|
5699
|
-
add(key, value) {
|
|
5700
|
-
if (key in this._store) {
|
|
5701
|
-
return false;
|
|
5702
|
-
}
|
|
5703
|
-
this._store[key] = value;
|
|
5704
|
-
return true;
|
|
5705
|
-
}
|
|
5706
|
-
set(key, value) {
|
|
5707
|
-
if (!(key in this._store)) {
|
|
5708
|
-
return false;
|
|
5709
|
-
}
|
|
5710
|
-
this._store[key] = value;
|
|
5711
|
-
return true;
|
|
5712
|
-
}
|
|
5713
|
-
get(key) {
|
|
5714
|
-
return this._store[key];
|
|
5715
|
-
}
|
|
5716
|
-
getOrAddWithFactory(key, factory) {
|
|
5717
|
-
let value = this._store[key];
|
|
5718
|
-
if (value === void 0) {
|
|
5719
|
-
value = factory(key);
|
|
5720
|
-
this._store[key] = value;
|
|
5721
|
-
}
|
|
5722
|
-
return value;
|
|
5723
|
-
}
|
|
5724
|
-
contains(key) {
|
|
5725
|
-
return key in this._store;
|
|
5726
|
-
}
|
|
5727
|
-
remove(key) {
|
|
5728
|
-
if (key in this._store) {
|
|
5729
|
-
delete this._store[key];
|
|
5730
|
-
return true;
|
|
5731
|
-
}
|
|
5732
|
-
return false;
|
|
5733
|
-
}
|
|
5734
|
-
clear() {
|
|
5735
|
-
this._store = {};
|
|
5736
|
-
}
|
|
5737
|
-
forEach(callback) {
|
|
5738
|
-
for (const key of Object.keys(this._store)) {
|
|
5739
|
-
callback(key, this._store[key]);
|
|
5740
|
-
}
|
|
5741
|
-
}
|
|
5742
|
-
}
|
|
5743
|
-
const Tags = {
|
|
5744
|
-
EnableFor(obj) {
|
|
5745
|
-
obj._tags ?? (obj._tags = {});
|
|
5746
|
-
},
|
|
5747
|
-
HasTags(obj) {
|
|
5748
|
-
return !!obj._tags && Object.keys(obj._tags).length > 0;
|
|
5749
|
-
},
|
|
5750
|
-
AddTagsTo(obj, tags) {
|
|
5751
|
-
obj._tags ?? (obj._tags = {});
|
|
5752
|
-
for (const tag of tags.split(/\s+/).filter(Boolean)) {
|
|
5753
|
-
obj._tags[tag] = true;
|
|
5754
|
-
}
|
|
5755
|
-
},
|
|
5756
|
-
RemoveTagsFrom(obj, tags) {
|
|
5757
|
-
if (!obj._tags) {
|
|
5758
|
-
return;
|
|
5759
|
-
}
|
|
5760
|
-
for (const tag of tags.split(/\s+/).filter(Boolean)) {
|
|
5761
|
-
delete obj._tags[tag];
|
|
5762
|
-
}
|
|
5763
|
-
},
|
|
5764
|
-
MatchesQuery(obj, tag) {
|
|
5765
|
-
return !!obj._tags && obj._tags[tag] === true;
|
|
5766
|
-
},
|
|
5767
|
-
GetTags(obj) {
|
|
5768
|
-
return obj._tags ? Object.keys(obj._tags) : [];
|
|
5769
|
-
}
|
|
5770
|
-
};
|
|
5771
|
-
class PerformanceMonitor {
|
|
5772
|
-
constructor(frameSampleSize = 30) {
|
|
5773
|
-
__publicField(this, "_samples", []);
|
|
5774
|
-
__publicField(this, "_max");
|
|
5775
|
-
__publicField(this, "_lastTime", null);
|
|
5776
|
-
__publicField(this, "_enabled", true);
|
|
5777
|
-
this._max = frameSampleSize;
|
|
5778
|
-
}
|
|
5779
|
-
sampleFrame(timeMs = now()) {
|
|
5780
|
-
if (!this._enabled) {
|
|
5781
|
-
return;
|
|
5782
|
-
}
|
|
5783
|
-
if (this._lastTime !== null) {
|
|
5784
|
-
const delta = timeMs - this._lastTime;
|
|
5785
|
-
this._samples.push(delta);
|
|
5786
|
-
if (this._samples.length > this._max) {
|
|
5787
|
-
this._samples.shift();
|
|
5788
|
-
}
|
|
6406
|
+
default:
|
|
6407
|
+
return gradient >= 0.5 ? 1 - this.easeInCore((1 - gradient) * 2) * 0.5 : this.easeInCore(gradient * 2) * 0.5;
|
|
5789
6408
|
}
|
|
5790
|
-
this._lastTime = timeMs;
|
|
5791
6409
|
}
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
6410
|
+
}
|
|
6411
|
+
__publicField(EasingFunction, "EASINGMODE_EASEIN", EASINGMODE_EASEIN);
|
|
6412
|
+
__publicField(EasingFunction, "EASINGMODE_EASEOUT", EASINGMODE_EASEOUT);
|
|
6413
|
+
__publicField(EasingFunction, "EASINGMODE_EASEINOUT", EASINGMODE_EASEINOUT);
|
|
6414
|
+
class CircleEase extends EasingFunction {
|
|
6415
|
+
easeInCore(gradient) {
|
|
6416
|
+
const g2 = Math.max(0, Math.min(1, gradient));
|
|
6417
|
+
return 1 - Math.sqrt(1 - g2 * g2);
|
|
5797
6418
|
}
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
6419
|
+
}
|
|
6420
|
+
class QuadraticEase extends EasingFunction {
|
|
6421
|
+
easeInCore(gradient) {
|
|
6422
|
+
return gradient * gradient;
|
|
5801
6423
|
}
|
|
5802
|
-
|
|
5803
|
-
|
|
6424
|
+
}
|
|
6425
|
+
class CubicEase extends EasingFunction {
|
|
6426
|
+
easeInCore(gradient) {
|
|
6427
|
+
return gradient * gradient * gradient;
|
|
5804
6428
|
}
|
|
5805
|
-
|
|
5806
|
-
|
|
6429
|
+
}
|
|
6430
|
+
class QuarticEase extends EasingFunction {
|
|
6431
|
+
easeInCore(gradient) {
|
|
6432
|
+
return gradient * gradient * gradient * gradient;
|
|
5807
6433
|
}
|
|
5808
|
-
|
|
5809
|
-
|
|
6434
|
+
}
|
|
6435
|
+
class QuinticEase extends EasingFunction {
|
|
6436
|
+
easeInCore(gradient) {
|
|
6437
|
+
return gradient * gradient * gradient * gradient * gradient;
|
|
5810
6438
|
}
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
6439
|
+
}
|
|
6440
|
+
class SineEase extends EasingFunction {
|
|
6441
|
+
easeInCore(gradient) {
|
|
6442
|
+
return 1 - Math.sin(Math.PI / 2 * (1 - gradient));
|
|
5814
6443
|
}
|
|
5815
6444
|
}
|
|
5816
|
-
class
|
|
5817
|
-
constructor(
|
|
5818
|
-
|
|
5819
|
-
this.
|
|
5820
|
-
this.factor2 = factor2;
|
|
6445
|
+
class ExponentialEase extends EasingFunction {
|
|
6446
|
+
constructor(exponent = 2) {
|
|
6447
|
+
super();
|
|
6448
|
+
this.exponent = exponent;
|
|
5821
6449
|
}
|
|
5822
|
-
|
|
5823
|
-
|
|
6450
|
+
easeInCore(gradient) {
|
|
6451
|
+
if (this.exponent <= 0) {
|
|
6452
|
+
return gradient;
|
|
6453
|
+
}
|
|
6454
|
+
return (Math.exp(this.exponent * gradient) - 1) / (Math.exp(this.exponent) - 1);
|
|
5824
6455
|
}
|
|
5825
6456
|
}
|
|
5826
|
-
class
|
|
5827
|
-
constructor(
|
|
5828
|
-
|
|
5829
|
-
this.
|
|
5830
|
-
|
|
6457
|
+
class BackEase extends EasingFunction {
|
|
6458
|
+
constructor(amplitude = 1) {
|
|
6459
|
+
super();
|
|
6460
|
+
this.amplitude = amplitude;
|
|
6461
|
+
}
|
|
6462
|
+
easeInCore(gradient) {
|
|
6463
|
+
const num = Math.max(0, this.amplitude);
|
|
6464
|
+
return Math.pow(gradient, 3) - gradient * num * Math.sin(Math.PI * gradient);
|
|
5831
6465
|
}
|
|
5832
6466
|
}
|
|
5833
|
-
|
|
5834
|
-
|
|
6467
|
+
class ElasticEase extends EasingFunction {
|
|
6468
|
+
constructor(oscillations = 3, springiness = 3) {
|
|
6469
|
+
super();
|
|
6470
|
+
this.oscillations = oscillations;
|
|
6471
|
+
this.springiness = springiness;
|
|
6472
|
+
}
|
|
6473
|
+
easeInCore(gradient) {
|
|
6474
|
+
const num2 = Math.max(0, this.oscillations);
|
|
6475
|
+
const num3 = Math.max(0, this.springiness);
|
|
6476
|
+
const num = num3 === 0 ? gradient : (Math.exp(num3 * gradient) - 1) / (Math.exp(num3) - 1);
|
|
6477
|
+
return num * Math.sin((2 * Math.PI * num2 + Math.PI / 2) * gradient);
|
|
6478
|
+
}
|
|
5835
6479
|
}
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
if (
|
|
5846
|
-
|
|
6480
|
+
class BounceEase extends EasingFunction {
|
|
6481
|
+
constructor(bounces = 3, bounciness = 2) {
|
|
6482
|
+
super();
|
|
6483
|
+
this.bounces = bounces;
|
|
6484
|
+
this.bounciness = bounciness;
|
|
6485
|
+
}
|
|
6486
|
+
easeInCore(gradient) {
|
|
6487
|
+
const num = Math.max(0, this.bounces);
|
|
6488
|
+
let bounciness = this.bounciness;
|
|
6489
|
+
if (bounciness <= 1) {
|
|
6490
|
+
bounciness = 1.001;
|
|
5847
6491
|
}
|
|
6492
|
+
const num2 = Math.pow(bounciness, num);
|
|
6493
|
+
const num3 = 1 - bounciness;
|
|
6494
|
+
const num4 = (1 - num2) / num3 + num2 * 0.5;
|
|
6495
|
+
const num5 = gradient * num4;
|
|
6496
|
+
const num6 = Math.log(-num5 * (1 - bounciness) + 1) / Math.log(bounciness);
|
|
6497
|
+
const num7 = Math.floor(num6);
|
|
6498
|
+
const num8 = num7 + 1;
|
|
6499
|
+
const num9 = (1 - Math.pow(bounciness, num7)) / (num3 * num4);
|
|
6500
|
+
const num10 = (1 - Math.pow(bounciness, num8)) / (num3 * num4);
|
|
6501
|
+
const num11 = (num9 + num10) * 0.5;
|
|
6502
|
+
const num12 = gradient - num11;
|
|
6503
|
+
const num13 = num11 - num9;
|
|
6504
|
+
return -Math.pow(1 / bounciness, num - num7) / (num13 * num13) * (num12 - num13) * (num12 + num13);
|
|
6505
|
+
}
|
|
6506
|
+
}
|
|
6507
|
+
const Tools = {
|
|
6508
|
+
/** High-resolution timestamp in milliseconds. */
|
|
6509
|
+
Now() {
|
|
6510
|
+
return typeof performance !== "undefined" ? performance.now() : Date.now();
|
|
5848
6511
|
},
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
console.warn("BJS - " + message);
|
|
5852
|
-
}
|
|
6512
|
+
ToRadians(degrees) {
|
|
6513
|
+
return degrees * Math.PI / 180;
|
|
5853
6514
|
},
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
6515
|
+
ToDegrees(radians) {
|
|
6516
|
+
return radians * 180 / Math.PI;
|
|
6517
|
+
},
|
|
6518
|
+
/** Clamp `value` into the inclusive `[min, max]` range. */
|
|
6519
|
+
Clamp(value, min = 0, max = 1) {
|
|
6520
|
+
return Math.min(max, Math.max(min, value));
|
|
6521
|
+
},
|
|
6522
|
+
/** Generate an RFC4122 v4 UUID (used by Babylon.js for unique ids). */
|
|
6523
|
+
RandomId() {
|
|
6524
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c2) => {
|
|
6525
|
+
const r2 = Math.random() * 16 | 0;
|
|
6526
|
+
const v = c2 === "x" ? r2 : r2 & 3 | 8;
|
|
6527
|
+
return v.toString(16);
|
|
6528
|
+
});
|
|
5863
6529
|
}
|
|
5864
6530
|
};
|
|
5865
|
-
var ScenePerformancePriority = /* @__PURE__ */ ((ScenePerformancePriority2) => {
|
|
5866
|
-
ScenePerformancePriority2[ScenePerformancePriority2["BackwardCompatible"] = 0] = "BackwardCompatible";
|
|
5867
|
-
ScenePerformancePriority2[ScenePerformancePriority2["Intermediate"] = 1] = "Intermediate";
|
|
5868
|
-
ScenePerformancePriority2[ScenePerformancePriority2["Aggressive"] = 2] = "Aggressive";
|
|
5869
|
-
return ScenePerformancePriority2;
|
|
5870
|
-
})(ScenePerformancePriority || {});
|
|
5871
|
-
var ShaderLanguage = /* @__PURE__ */ ((ShaderLanguage2) => {
|
|
5872
|
-
ShaderLanguage2[ShaderLanguage2["GLSL"] = 0] = "GLSL";
|
|
5873
|
-
ShaderLanguage2[ShaderLanguage2["WGSL"] = 1] = "WGSL";
|
|
5874
|
-
return ShaderLanguage2;
|
|
5875
|
-
})(ShaderLanguage || {});
|
|
5876
|
-
class ImageProcessingConfiguration {
|
|
5877
|
-
}
|
|
5878
|
-
__publicField(ImageProcessingConfiguration, "TONEMAPPING_STANDARD", 0);
|
|
5879
|
-
__publicField(ImageProcessingConfiguration, "TONEMAPPING_ACES", 1);
|
|
5880
|
-
__publicField(ImageProcessingConfiguration, "TONEMAPPING_KHR_PBR_NEUTRAL", 2);
|
|
5881
|
-
const Constants = {
|
|
5882
|
-
MATERIAL_ClockWiseSideOrientation: 0,
|
|
5883
|
-
MATERIAL_CounterClockWiseSideOrientation: 1,
|
|
5884
|
-
MATERIAL_TriangleFillMode: 0,
|
|
5885
|
-
MATERIAL_WireFrameFillMode: 1,
|
|
5886
|
-
MATERIAL_PointFillMode: 2,
|
|
5887
|
-
ALPHA_DISABLE: 0,
|
|
5888
|
-
ALPHA_ADD: 1,
|
|
5889
|
-
ALPHA_COMBINE: 2,
|
|
5890
|
-
ALPHA_ONEONE: 6,
|
|
5891
|
-
ALPHA_PREMULTIPLIED: 7,
|
|
5892
|
-
MATERIAL_OPAQUE: 0,
|
|
5893
|
-
MATERIAL_ALPHATEST: 1,
|
|
5894
|
-
MATERIAL_ALPHABLEND: 2,
|
|
5895
|
-
TEXTURE_CLAMP_ADDRESSMODE: 0,
|
|
5896
|
-
TEXTURE_WRAP_ADDRESSMODE: 1,
|
|
5897
|
-
TEXTURE_MIRROR_ADDRESSMODE: 2
|
|
5898
|
-
};
|
|
5899
6531
|
const ActionManagerTriggers = {
|
|
5900
6532
|
NothingTrigger: 0,
|
|
5901
6533
|
OnPickTrigger: 1,
|
|
@@ -7227,17 +7859,26 @@ class ClusteredLightContainer {
|
|
|
7227
7859
|
}
|
|
7228
7860
|
class ParticleSystem {
|
|
7229
7861
|
constructor() {
|
|
7230
|
-
unsupported(
|
|
7862
|
+
unsupported(
|
|
7863
|
+
"ParticleSystem",
|
|
7864
|
+
"Babylon Lite backs serialized Node Particle Editor graphs via `NodeParticleSystemSet` (`Parse`/`ParseFromSnippetAsync` → `buildAsync` → `start`), not the imperative classic `ParticleSystem` construction API (emitters, over-lifetime gradients, `minEmitBox`)."
|
|
7865
|
+
);
|
|
7231
7866
|
}
|
|
7232
7867
|
}
|
|
7233
7868
|
class GPUParticleSystem {
|
|
7234
7869
|
constructor() {
|
|
7235
|
-
unsupported(
|
|
7870
|
+
unsupported(
|
|
7871
|
+
"GPUParticleSystem",
|
|
7872
|
+
"Babylon Lite has no GPU-compute particle path. Its node-particle runtime (`NodeParticleSystemSet`) is a CPU struct-of-arrays simulation; use `NodeParticleSystemSet.ParseFromSnippetAsync` → `buildAsync` instead."
|
|
7873
|
+
);
|
|
7236
7874
|
}
|
|
7237
7875
|
}
|
|
7238
7876
|
class SolidParticleSystem {
|
|
7239
7877
|
constructor() {
|
|
7240
|
-
unsupported(
|
|
7878
|
+
unsupported(
|
|
7879
|
+
"SolidParticleSystem",
|
|
7880
|
+
"Solid particle systems (per-particle mesh copies) are not backed by Babylon Lite. Consider native thin instances for many-copies use cases; node-particle billboards are available via `NodeParticleSystemSet`."
|
|
7881
|
+
);
|
|
7241
7882
|
}
|
|
7242
7883
|
}
|
|
7243
7884
|
class HighlightLayer {
|
|
@@ -7462,12 +8103,10 @@ class SSAO2RenderingPipeline {
|
|
|
7462
8103
|
}
|
|
7463
8104
|
class ParticleHelper {
|
|
7464
8105
|
constructor() {
|
|
7465
|
-
unsupported(
|
|
7466
|
-
|
|
7467
|
-
|
|
7468
|
-
|
|
7469
|
-
constructor() {
|
|
7470
|
-
unsupported("ParticleSystemSet", "Particle systems are not implemented in Babylon Lite.");
|
|
8106
|
+
unsupported(
|
|
8107
|
+
"ParticleHelper",
|
|
8108
|
+
"The imperative particle-preset helper is not backed. Babylon Lite renders serialized Node Particle Editor graphs (`NodeParticleSystemSet.ParseFromSnippetAsync` → `buildAsync`), not preset-driven imperative `ParticleSystem`s."
|
|
8109
|
+
);
|
|
7471
8110
|
}
|
|
7472
8111
|
}
|
|
7473
8112
|
class PointsCloudSystem {
|
|
@@ -7555,6 +8194,139 @@ class SceneOptimizer {
|
|
|
7555
8194
|
unsupported("SceneOptimizer", "Automatic scene optimisation is not implemented in the compat layer.");
|
|
7556
8195
|
}
|
|
7557
8196
|
}
|
|
8197
|
+
class ParticleSystemSet {
|
|
8198
|
+
constructor() {
|
|
8199
|
+
/** @internal The built Lite node-particle set (null for a directly-constructed empty set). */
|
|
8200
|
+
__publicField(this, "_lite", null);
|
|
8201
|
+
/** @internal The compat scene the set was built against (set by `buildAsync`). */
|
|
8202
|
+
__publicField(this, "_scene", null);
|
|
8203
|
+
__publicField(this, "_started", false);
|
|
8204
|
+
}
|
|
8205
|
+
getClassName() {
|
|
8206
|
+
return "ParticleSystemSet";
|
|
8207
|
+
}
|
|
8208
|
+
/**
|
|
8209
|
+
* Babylon.js `ParticleSystemSet.systems` — the array of per-system
|
|
8210
|
+
* `ParticleSystem` handles. Not backed: Lite's node-particle runtime is a fused
|
|
8211
|
+
* struct-of-arrays simulation with no per-system BJS `ParticleSystem` object to
|
|
8212
|
+
* expose. Drive the set as a whole via {@link start} instead.
|
|
8213
|
+
*/
|
|
8214
|
+
get systems() {
|
|
8215
|
+
return unsupported(
|
|
8216
|
+
"ParticleSystemSet.systems",
|
|
8217
|
+
"Babylon Lite's node-particle runtime is a fused struct-of-arrays simulation and exposes no per-system BJS ParticleSystem handle. Start/stop the whole set via `set.start()` / `set.dispose()`."
|
|
8218
|
+
);
|
|
8219
|
+
}
|
|
8220
|
+
/**
|
|
8221
|
+
* Babylon.js `ParticleSystemSet.start()` — begin all systems. Forwards to Lite
|
|
8222
|
+
* `registerNodeParticleSet`, which renders each system as a camera-facing
|
|
8223
|
+
* billboard and advances it once per frame. Idempotent.
|
|
8224
|
+
*/
|
|
8225
|
+
start() {
|
|
8226
|
+
if (this._started || !this._lite || !this._scene) {
|
|
8227
|
+
return;
|
|
8228
|
+
}
|
|
8229
|
+
this._started = true;
|
|
8230
|
+
registerNodeParticleSet(this._scene._lite, this._lite, { autoStart: true });
|
|
8231
|
+
}
|
|
8232
|
+
/**
|
|
8233
|
+
* Babylon.js `ParticleSystemSet.dispose()` — stop the systems. Lite exposes no
|
|
8234
|
+
* unregister for an already-registered billboard system, so this stops emission
|
|
8235
|
+
* on every built system (via `stopParticleSystem`); the last-emitted particles
|
|
8236
|
+
* finish their lifetime.
|
|
8237
|
+
*/
|
|
8238
|
+
dispose() {
|
|
8239
|
+
if (!this._lite) {
|
|
8240
|
+
return;
|
|
8241
|
+
}
|
|
8242
|
+
for (const system of this._lite.systems) {
|
|
8243
|
+
stopParticleSystem(system);
|
|
8244
|
+
}
|
|
8245
|
+
}
|
|
8246
|
+
}
|
|
8247
|
+
class NodeParticleSystemSet {
|
|
8248
|
+
constructor(name = "") {
|
|
8249
|
+
__publicField(this, "name");
|
|
8250
|
+
/** @internal Inline serialized graph (from `Parse` / `ParseFromFileAsync`); null when built from a snippet id. */
|
|
8251
|
+
__publicField(this, "_source", null);
|
|
8252
|
+
/** @internal Snippet id (from `ParseFromSnippetAsync`); null when built from inline JSON. */
|
|
8253
|
+
__publicField(this, "_snippetId", null);
|
|
8254
|
+
this.name = name;
|
|
8255
|
+
}
|
|
8256
|
+
getClassName() {
|
|
8257
|
+
return "NodeParticleSystemSet";
|
|
8258
|
+
}
|
|
8259
|
+
/**
|
|
8260
|
+
* Babylon.js `NodeParticleSystemSet.buildAsync(scene)` — compile the graph into
|
|
8261
|
+
* a live {@link ParticleSystemSet}. Forwards to Lite
|
|
8262
|
+
* `parseNodeParticleSetFromSnippet`, which parses and builds in one shot (from
|
|
8263
|
+
* the recorded snippet id or inline JSON).
|
|
8264
|
+
*/
|
|
8265
|
+
async buildAsync(scene, _verbose = false) {
|
|
8266
|
+
const engine = scene.getEngine()._lite;
|
|
8267
|
+
const liteSet = this._snippetId !== null ? await parseNodeParticleSetFromSnippet(engine, scene._lite, this._snippetId, {}) : await parseNodeParticleSetFromSnippet(engine, scene._lite, "", { json: this._source ?? {} });
|
|
8268
|
+
const set2 = new ParticleSystemSet();
|
|
8269
|
+
set2._lite = liteSet;
|
|
8270
|
+
set2._scene = scene;
|
|
8271
|
+
return set2;
|
|
8272
|
+
}
|
|
8273
|
+
/** Babylon.js `NodeParticleSystemSet.Parse(source)` — deserialize an inline graph. */
|
|
8274
|
+
static Parse(source) {
|
|
8275
|
+
const name = (source == null ? void 0 : source.name) ?? "";
|
|
8276
|
+
const set2 = new NodeParticleSystemSet(name);
|
|
8277
|
+
set2._source = source;
|
|
8278
|
+
return set2;
|
|
8279
|
+
}
|
|
8280
|
+
/**
|
|
8281
|
+
* Babylon.js `NodeParticleSystemSet.ParseFromSnippetAsync(snippetId)` — load a
|
|
8282
|
+
* graph from the snippet server. The network fetch is deferred to `buildAsync`
|
|
8283
|
+
* (Lite fuses fetch+parse+build), so this resolves immediately with the id.
|
|
8284
|
+
*/
|
|
8285
|
+
static ParseFromSnippetAsync(snippetId, nodeParticleSet) {
|
|
8286
|
+
const set2 = nodeParticleSet ?? new NodeParticleSystemSet();
|
|
8287
|
+
set2._snippetId = snippetId;
|
|
8288
|
+
set2.name = snippetId;
|
|
8289
|
+
return Promise.resolve(set2);
|
|
8290
|
+
}
|
|
8291
|
+
/**
|
|
8292
|
+
* Babylon.js `NodeParticleSystemSet.ParseFromFileAsync(name, url)` — load a
|
|
8293
|
+
* serialized graph from a URL, then behave like {@link Parse}.
|
|
8294
|
+
*/
|
|
8295
|
+
static async ParseFromFileAsync(name, url, nodeParticleSet) {
|
|
8296
|
+
const response = await fetch(url);
|
|
8297
|
+
const source = await response.json();
|
|
8298
|
+
const set2 = nodeParticleSet ?? new NodeParticleSystemSet(name);
|
|
8299
|
+
set2.name = name;
|
|
8300
|
+
set2._source = source;
|
|
8301
|
+
return set2;
|
|
8302
|
+
}
|
|
8303
|
+
/** Babylon.js `NodeParticleSystemSet.CreateDefault(name)`. Requires programmatic block authoring — not backed. */
|
|
8304
|
+
static CreateDefault(_name) {
|
|
8305
|
+
return unsupported(
|
|
8306
|
+
"NodeParticleSystemSet.CreateDefault",
|
|
8307
|
+
"Babylon Lite consumes a serialized node-particle graph (snippet id or JSON); it has no programmatic block-authoring API to assemble a default graph. Load a graph via `Parse` / `ParseFromSnippetAsync` instead."
|
|
8308
|
+
);
|
|
8309
|
+
}
|
|
8310
|
+
get attachedBlocks() {
|
|
8311
|
+
return unsupported(
|
|
8312
|
+
"NodeParticleSystemSet.attachedBlocks",
|
|
8313
|
+
"Babylon Lite consumes a serialized node-particle graph and exposes no programmatic block graph. Load and build a graph via `Parse` / `ParseFromSnippetAsync` + `buildAsync`."
|
|
8314
|
+
);
|
|
8315
|
+
}
|
|
8316
|
+
getBlockByName(_name) {
|
|
8317
|
+
return unsupported("NodeParticleSystemSet.getBlockByName", "Babylon Lite exposes no programmatic node-particle block graph to query.");
|
|
8318
|
+
}
|
|
8319
|
+
serialize() {
|
|
8320
|
+
return unsupported("NodeParticleSystemSet.serialize", "Babylon Lite exposes no programmatic node-particle block graph to serialize.");
|
|
8321
|
+
}
|
|
8322
|
+
editAsync() {
|
|
8323
|
+
return unsupported("NodeParticleSystemSet.editAsync", "The Node Particle Editor UI is not part of the Babylon Lite compat layer.");
|
|
8324
|
+
}
|
|
8325
|
+
dispose() {
|
|
8326
|
+
this._source = null;
|
|
8327
|
+
this._snippetId = null;
|
|
8328
|
+
}
|
|
8329
|
+
}
|
|
7558
8330
|
export {
|
|
7559
8331
|
AbstractAssetTask,
|
|
7560
8332
|
AbstractAudioAnalyzer,
|
|
@@ -7606,10 +8378,10 @@ export {
|
|
|
7606
8378
|
Bone,
|
|
7607
8379
|
BounceEase,
|
|
7608
8380
|
BouncingBehavior,
|
|
7609
|
-
|
|
8381
|
+
B as BoundingBox,
|
|
7610
8382
|
BoundingBoxGizmo,
|
|
7611
8383
|
BoundingBoxRenderer,
|
|
7612
|
-
BoundingInfo,
|
|
8384
|
+
b as BoundingInfo,
|
|
7613
8385
|
c as BoundingSphere,
|
|
7614
8386
|
CSG,
|
|
7615
8387
|
CSG2,
|
|
@@ -7640,7 +8412,11 @@ export {
|
|
|
7640
8412
|
CreateSoundSourceAsync,
|
|
7641
8413
|
h as CreateSphere,
|
|
7642
8414
|
CreateStreamingSoundAsync,
|
|
7643
|
-
|
|
8415
|
+
CreateTexture2DArrayFromImageUrlsAsync,
|
|
8416
|
+
CreateTexture2DArrayFromKTX2Async,
|
|
8417
|
+
i as CreateTiledBox,
|
|
8418
|
+
j as CreateTiledPlane,
|
|
8419
|
+
k as CreateTorus,
|
|
7644
8420
|
CubeTexture,
|
|
7645
8421
|
CubicEase,
|
|
7646
8422
|
Curve3,
|
|
@@ -7710,12 +8486,13 @@ export {
|
|
|
7710
8486
|
LinesMesh,
|
|
7711
8487
|
LiteCompatError,
|
|
7712
8488
|
LoadAssetContainerAsync,
|
|
8489
|
+
LoadImageToTexture2DArrayLayerAsync,
|
|
7713
8490
|
Logger,
|
|
7714
8491
|
MainAudioBus,
|
|
7715
8492
|
Material,
|
|
7716
8493
|
Matrix,
|
|
7717
8494
|
Mesh,
|
|
7718
|
-
|
|
8495
|
+
m as MeshBuilder,
|
|
7719
8496
|
MeshoptCompression,
|
|
7720
8497
|
MirrorTexture,
|
|
7721
8498
|
MorphTarget,
|
|
@@ -7724,6 +8501,7 @@ export {
|
|
|
7724
8501
|
MultiPointerScaleBehavior,
|
|
7725
8502
|
Node,
|
|
7726
8503
|
NodeMaterial,
|
|
8504
|
+
NodeParticleSystemSet,
|
|
7727
8505
|
NullEngine,
|
|
7728
8506
|
OBJFileLoader,
|
|
7729
8507
|
Observable,
|
|
@@ -7765,6 +8543,7 @@ export {
|
|
|
7765
8543
|
Quaternion,
|
|
7766
8544
|
QuinticEase,
|
|
7767
8545
|
RawTexture,
|
|
8546
|
+
RawTexture2DArray,
|
|
7768
8547
|
RawTexture3D,
|
|
7769
8548
|
Ray,
|
|
7770
8549
|
RecastJSPlugin,
|
|
@@ -7821,21 +8600,22 @@ export {
|
|
|
7821
8600
|
UninstallHtmlInCanvasPolyfill,
|
|
7822
8601
|
UniversalCamera,
|
|
7823
8602
|
UploadHtmlElementToTexture,
|
|
8603
|
+
UploadImageToTexture2DArrayLayer,
|
|
7824
8604
|
UtilityLayerRenderer,
|
|
7825
8605
|
ValueCondition,
|
|
7826
8606
|
ValueConditionOperators,
|
|
7827
|
-
|
|
8607
|
+
n as Vector2,
|
|
7828
8608
|
Vector3,
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
8609
|
+
o as Vector4,
|
|
8610
|
+
p as VertexBuffer,
|
|
8611
|
+
q as VertexData,
|
|
7832
8612
|
Viewport,
|
|
7833
8613
|
VirtualJoystick,
|
|
7834
8614
|
WebGPUEngine,
|
|
7835
8615
|
WebXRCamera,
|
|
7836
8616
|
WeightedSound,
|
|
7837
8617
|
t as transformCoordinates,
|
|
7838
|
-
|
|
8618
|
+
r as transformNormal,
|
|
7839
8619
|
unsupported
|
|
7840
8620
|
};
|
|
7841
8621
|
//# sourceMappingURL=index.js.map
|