@babylonjs/lite-compat 1.15.0-preview → 1.17.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/navigation.d.ts CHANGED
@@ -2,6 +2,7 @@ import { AnisotropyProps } from '@babylonjs/lite';
2
2
  import { ClearCoatProps } from '@babylonjs/lite';
3
3
  import { EngineOptions } from '@babylonjs/lite';
4
4
  import { IridescenceProps } from '@babylonjs/lite';
5
+ import { LineMaterial } from '@babylonjs/lite';
5
6
  import { Mesh } from '@babylonjs/lite';
6
7
  import { NavCrowd } from '@babylonjs/lite';
7
8
  import { NavigationPlugin } from '@babylonjs/lite';
@@ -11,6 +12,7 @@ import { RenderCanvas } from '@babylonjs/lite';
11
12
  import { SceneNode } from '@babylonjs/lite';
12
13
  import { SheenProps } from '@babylonjs/lite';
13
14
  import { Texture2D } from '@babylonjs/lite';
15
+ import { Texture2DArray } from '@babylonjs/lite';
14
16
 
15
17
  declare abstract class AbstractEngine {
16
18
  /**
@@ -25,7 +27,8 @@ declare abstract class AbstractEngine {
25
27
  protected readonly _scenes: Scene[];
26
28
  protected readonly _loopCallbacks: Array<() => void>;
27
29
  protected _initialized: boolean;
28
- private _started;
29
30
  /**
31
+ private _startupComplete;
32
+ private _startPromise;
30
33
  /**
31
34
  * Babylon.js `engine.useReverseDepthBuffer`. Babylon Lite owns its depth
32
35
  * configuration internally, so this is a settable no-op kept for API shape.
33
36
  */
@@ -109,7 +112,35 @@ declare abstract class AbstractEngine {
109
112
  beginFrame(): never;
110
113
  /** Babylon.js manual frame-pump exit point — unsupported (Lite's frame graph owns the frame). */
111
114
  endFrame(): never;
115
+ /**
116
+ * Babylon.js `engine.currentSampleCount` — the MSAA sample count of the current render target.
117
+ * Babylon Lite manages MSAA internally and exposes no public sample-count accessor, so this
118
+ * needs a tree-shakeable Lite core addition before it can report a real value.
119
+ */
120
+ get currentSampleCount(): never;
121
+ /**
122
+ * Babylon.js `engine.getAlphaToCoverage()` — alpha-to-coverage state. Babylon Lite does not
123
+ * expose an engine-level alpha-to-coverage toggle, so this is unsupported.
124
+ */
125
+ getAlphaToCoverage(): never;
126
+ /**
127
+ * Babylon.js `engine.setAlphaToCoverage(enable)` — toggle alpha-to-coverage. Babylon Lite does
128
+ * not expose an engine-level alpha-to-coverage toggle, so this is unsupported.
129
+ */
130
+ setAlphaToCoverage(_enable: boolean): never;
131
+ /**
132
+ * Babylon.js `engine.updateTextureArrayLayerFromImageSource(texture, source, layer, invertY, premultiplyAlpha)`
133
+ * — the engine extension that uploads a decoded image source into one layer of a 2D array
134
+ * texture. Forwards to Babylon Lite's `uploadImageToArrayLayer`.
135
+ *
136
+ * Babylon.js passes an `InternalTexture`; the compat layer's equivalent handle is the Lite
137
+ * `Texture2DArray` returned by `RawTexture2DArray.getInternalTexture()`, so ported code that
138
+ * goes through `UploadImageToTexture2DArrayLayer` (which is exactly what Babylon.js's helper
139
+ * does) works unchanged.
140
+ */
141
+ updateTextureArrayLayerFromImageSource(texture: Texture2DArray, source: GPUCopyExternalImageSource, layer: number, invertY?: boolean, premultiplyAlpha?: boolean): void;
112
142
  private _start;
143
+ private _startCore;
113
144
  private _ensureInitialized;
114
145
  }
115
146
 
@@ -118,7 +149,7 @@ declare abstract class AbstractEngine {
118
149
  * visibility, and shadow-receipt. Concrete meshes derive from this.
119
150
  */
120
151
  declare class AbstractMesh extends TransformNode {
121
152
  private _material;
122
- private _visible;
153
+ protected _visible: boolean;
123
154
  constructor(name: string, lite: Mesh, scene?: Scene);
124
155
  getClassName(): string;
125
156
  get material(): CompatMaterial | null;
126
157
  set material(value: CompatMaterial | null);
@@ -126,19 +157,28 @@ declare class AbstractMesh extends TransformNode {
126
157
  private _material;
127
158
  set isVisible(value: boolean);
128
159
  get receiveShadows(): boolean;
129
160
  set receiveShadows(value: boolean);
130
- setEnabled(enabled: boolean): void;
131
- /**
132
- * Babylon.js `mesh.getBoundingInfo()` — local-space AABB of this mesh. Babylon
133
- * Lite stores `boundMin`/`boundMax` (local space) on factory- and loader-built
134
- * meshes; when absent (e.g. a placeholder mesh whose bounds were never computed)
135
- * we fold the retained CPU positions through Lite's `computeAabb`. A mesh with
136
- * no geometry returns a degenerate zero-size box.
161
+ protected _onEffectiveEnabledStateChanged(enabled: boolean): void;
137
162
  /**
163
+ * Babylon.js `mesh.getBoundingInfo()` — the mesh's AABB. `minimum`/`maximum`
164
+ * are the local-space bounds; the returned `BoundingInfo`'s world members
165
+ * (`minimumWorld`/`maximumWorld`/`centerWorld`/…) are derived by transforming
166
+ * the eight local corners by the mesh's world matrix, so a mesh at (1,2,3)
167
+ * reports correctly-offset world bounds. Babylon Lite stores `boundMin`/
168
+ * `boundMax` (local space) on factory- and loader-built meshes; when absent
169
+ * (e.g. a placeholder mesh whose bounds were never computed) we fold the
170
+ * retained CPU positions through Lite's `computeAabb`. A mesh with no geometry
171
+ * returns a degenerate zero-size box.
138
172
  */
139
173
  getBoundingInfo(): BoundingInfo;
174
+ /** Compat handle over Babylon Lite's world matrix for bounds derivation. Returns
175
+ * `undefined` when the Lite node hasn't computed one (world bounds fall back to
176
+ * local). */
177
+ private _worldMatrixForBounds;
140
178
  /**
141
- * Babylon.js `mesh.getVerticesData(kind)` — read back the CPU geometry buffer
142
- * for `position` / `normal` / `uv`. Babylon Lite retains these on the mesh
143
- * (for picking + device-loss recovery); other kinds are not stored.
179
+ * Babylon.js `mesh.getVerticesData(kind)` — read back the CPU geometry buffer.
180
+ * `position` / `normal` / `uv` come from the buffers Babylon Lite retains on the
181
+ * mesh (for picking + device-loss recovery). Prefer the last compat-side value
182
+ * for `uv2` / `tangent` / `color`, falling back to attributes retained by Lite
183
+ * for loader- and factory-created meshes.
144
184
  */
145
185
  getVerticesData(kind: string): Float32Array | null;
146
186
  /**
@@ -149,8 +189,22 @@ declare class AbstractMesh extends TransformNode {
149
189
  private _material;
150
190
  * (`matricesIndices`, etc.) are accepted but not applied (Babylon Lite drives
151
191
  * skinning through its own loaded-skeleton path).
152
192
  */
153
- setVerticesData(kind: string, data: number[] | Float32Array, _updatable?: boolean): void;
154
193
  private _lastColors;
155
- /** Babylon.js `mesh.getTotalVertices()` — vertex count from the position buffer. */
194
+ setVerticesData(kind: string, data: number[] | Float32Array, _updatable?: boolean): void;
195
+ /**
196
+ * Babylon.js `mesh.getIndices()` — read back the mesh's index (topology) buffer.
197
+ * Babylon Lite retains the indices on the mesh as a `Uint32Array` (for picking +
198
+ * device-loss recovery), so we return that directly; a mesh with no geometry
199
+ * returns `null`.
200
+ */
201
+ getIndices(_copyWhenShared?: boolean, forceCopy?: boolean): Uint32Array | null;
202
+ /**
203
+ * Babylon.js `mesh.setIndices(indices)` — replace the mesh's index (topology)
204
+ * buffer. Babylon Lite re-uploads the geometry in place via `resizeMeshGeometry`,
205
+ * keeping the existing position/normal/uv/tangent/color attributes and swapping
206
+ * only the indices. Returns the mesh for chaining.
207
+ */
208
+ setIndices(indices: number[] | Uint16Array | Uint32Array | Int32Array, _totalVertices?: number | null, _updatable?: boolean): this;
156
209
  private _lastTangents;
210
+ private _lastColors;
157
211
  /** Babylon.js `mesh.getTotalVertices()` — vertex count from the position buffer. */
158
212
  getTotalVertices(): number;
159
213
  /**
160
214
  * Babylon.js `mesh.refreshBoundingInfo()` — Babylon Lite recomputes a mesh's
@@ -158,23 +212,32 @@ declare class AbstractMesh extends TransformNode {
158
212
  private _material;
159
213
  * no-op that returns the mesh for chaining. The deformed-pick options
160
214
  * (`applySkeleton` / `applyMorph`) are accepted for parity but not used.
161
215
  */
162
- refreshBoundingInfo(_options?: unknown): this;
163
- /**
216
+ refreshBoundingInfo(_options?: unknown): this;
164
217
  /**
165
218
  * Babylon.js `mesh.bakeCurrentTransformIntoVertices()` — fold the node's local
166
- * transform (position / rotation / scaling) into the CPU geometry and reset the
167
- * transform to identity. Babylon Lite has no built-in mesh-transform bake, so we
168
- * transform the retained CPU positions (full matrix) and normals (rotation only,
169
- * renormalized), re-upload via `resizeMeshGeometry`, then clear the transform.
219
+ * transform (position / rotation / scaling) into the CPU geometry via the shared
220
+ * {@link _bakeMatrix} helper, then reset the node transform to identity (the
221
+ * geometry now carries it).
170
222
  */
171
223
  bakeCurrentTransformIntoVertices(): this;
224
+ /**
225
+ * Babylon.js `mesh.bakeTransformIntoVertices(transform)` — fold an **arbitrary**
226
+ * matrix into the CPU geometry via the shared {@link _bakeMatrix} helper. Unlike
227
+ * {@link bakeCurrentTransformIntoVertices}, the node's own transform is **not**
228
+ * reset: the supplied matrix is independent of the node transform.
229
+ */
230
+ bakeTransformIntoVertices(transform: Matrix): this;
172
231
  dispose(): void;
173
232
  }
174
233
 
175
234
  declare abstract class AbstractScene {
176
235
  /**
177
- * Babylon.js `scene.meshes`. Babylon Lite does not expose a public scene-mesh
178
- * registry, so this tracks the meshes the compat layer creates against a scene
179
- * which need lookup (currently Gaussian-Splatting meshes surfaced through the
180
- * loader). Other primitives register with the Lite scene directly.
236
+ * Babylon.js `scene.meshes` — the compat mesh wrappers in the scene. Backed by the
237
+ * canonical {@link _meshWrappers} registry and kept in sync with the Lite-core-owned
238
+ * list: the core list ({@link _coreMeshList}) supplies authoritative membership and
239
+ * ordering, mapped back to each mesh's canonical wrapper so the returned handles are
240
+ * the right type and keep wrapper identity. Wrappers not yet mirrored into the core
241
+ * list (transform-only loader roots, primitives whose scene-add is deferred to engine
242
+ * start, and Gaussian-Splatting meshes that register their renderables outside
243
+ * `scene.meshes`) retain their registration positions.
181
244
  */
182
245
  get meshes(): TransformNode[];
183
246
  /** Babylon.js `scene.cameras` — every camera constructed against this scene. */
@@ -195,19 +258,18 @@ declare abstract class AbstractScene {
195
258
  /**
196
259
  /** Babylon.js `scene.getMaterialById(id)` — first material whose `id` matches, else `null`. */
197
260
  getMaterialById(id: string): Material | null;
198
261
  /**
199
- * Babylon.js `scene.getMeshByName(name)`. Babylon Lite has no public scene-mesh
200
- * registry, so this searches the compat meshes tracked through `scene.meshes`
201
- * (currently meshes the loader surfaces, e.g. Gaussian-Splatting). Returns `null`
202
- * when not found, matching Babylon.js.
262
+ * Babylon.js `scene.getMeshByName(name)` — first mesh in {@link meshes} with a
263
+ * matching name, else `null`. Enumerates the full canonical mesh registry
264
+ * (primitives + loader-surfaced meshes), not just the loader-surfaced subset.
203
265
  */
204
266
  getMeshByName(name: string): TransformNode | null;
205
- /** Babylon.js `scene.getMeshById(id)` — first tracked mesh whose `id` matches, else `null`. */
267
+ /** Babylon.js `scene.getMeshById(id)` — first mesh whose `id` matches, else `null`. */
206
268
  getMeshById(id: string): TransformNode | null;
207
269
  /** Babylon.js legacy `scene.getMeshByID(id)` — alias of {@link getMeshById}. */
208
270
  getMeshByID(id: string): TransformNode | null;
209
- /** Babylon.js `scene.getNodeByName(name)` — searches tracked meshes, cameras, and lights. */
271
+ /** Babylon.js `scene.getNodeByName(name)` — searches meshes, cameras, and lights. */
210
272
  getNodeByName(name: string): Node_2 | null;
211
- /** Babylon.js `scene.getNodeById(id)` — searches tracked meshes, cameras, and lights by `id`. */
273
+ /** Babylon.js `scene.getNodeById(id)` — searches meshes, cameras, and lights by `id`. */
212
274
  getNodeById(id: string): Node_2 | null;
213
275
  }
214
276
 
@@ -356,45 +418,68 @@ declare class AnimationGroup {
356
418
  declare type AnimationGroupState = "init" | "playing" | "paused" | "stopped";
357
419
 
358
420
  declare abstract class BaseTexture {
359
- name: string;
360
421
  getClassName(): string;
422
+ name: string;
361
423
  getClassName(): string;
362
424
  /**
425
+ * Babylon.js `BaseTexture.getInternalTexture()` — the backend texture handle. Babylon.js
426
+ * returns an `InternalTexture`; the compat layer's equivalent is the Lite texture handle,
427
+ * which is what the compat engine's texture methods accept.
428
+ */
429
+ getInternalTexture(): Texture2D | null;
363
430
  abstract whenReadyAsync(): Promise<void>;
364
431
  dispose(): void;
365
432
  }
366
433
 
367
434
  declare class BoundingBox {
368
- minimum: Vector3;
369
- maximum: Vector3;
370
- center: Vector3;
371
- extendSize: Vector3;
372
- /** World-space AABB corners. Equal to `minimum`/`maximum` when the box is
373
- * already built in world space (as the loader's `getBoundingInfo` does). */
374
- minimumWorld: Vector3;
375
- maximumWorld: Vector3;
376
- /** The 8 corner points (min/max combinations). */
377
- vectors: Vector3[];
378
- constructor(min: Vector3, max: Vector3);
379
- intersectsPoint(point: Vector3): boolean;
435
+ readonly minimum: Vector3;
436
+ readonly maximum: Vector3;
437
+ readonly center: Vector3;
438
+ readonly extendSize: Vector3;
439
+ /** Center of the AABB in world space. */
440
+ readonly centerWorld: Vector3;
441
+ /** Half-size of the AABB in world space (multiply by 2 for the full size). */
442
+ readonly extendSizeWorld: Vector3;
443
+ /** Minimum corner of the world-space AABB. */
444
+ readonly minimumWorld: Vector3;
445
+ /** Maximum corner of the world-space AABB. */
446
+ readonly maximumWorld: Vector3;
447
+ /** The 8 corner points in local space (min/max combinations). */
448
+ readonly vectors: Vector3[];
449
+ /** The 8 corner points transformed into world space. */
450
+ readonly vectorsWorld: Vector3[];
451
+ /** The three world-space axis directions of the box (rows of the world matrix). */
452
+ readonly directions: Vector3[];
453
+ private _worldMatrix;
454
+ constructor(min: Vector3, max: Vector3, worldMatrix?: Matrix);
455
+ reConstruct(min: Vector3, max: Vector3, worldMatrix?: Matrix): void;
456
+ getWorldMatrix(): Matrix;
380
457
  intersectsPoint(point: Vector3): boolean;
381
458
  static Intersects(a: BoundingBox, b: BoundingBox): boolean;
382
459
  }
383
460
 
384
461
  declare class BoundingInfo {
385
462
  boundingBox: BoundingBox;
386
463
  boundingSphere: BoundingSphere;
387
- constructor(min: Vector3, max: Vector3);
464
+ constructor(min: Vector3, max: Vector3, worldMatrix?: Matrix);
388
465
  get minimum(): Vector3;
389
466
  get maximum(): Vector3;
390
467
  intersectsPoint(point: Vector3): boolean;
391
- /** World-matrix-aware reframe is not modelled here; reframe by rebuilding from transformed corners. */
392
- reConstruct(min: Vector3, max: Vector3, _worldMatrix?: Matrix): void;
468
+ /** Babylon.js `BoundingInfo.update` — re-derive the world-space bounds from the
469
+ * local geometry and a new world matrix. */
470
+ update(worldMatrix: Matrix): void;
471
+ /** Rebuild the local bounds and (optionally) re-derive world-space bounds from
472
+ * the supplied world matrix, transforming all eight corners. */
473
+ reConstruct(min: Vector3, max: Vector3, worldMatrix?: Matrix): void;
393
474
  }
394
475
 
395
476
  declare class BoundingSphere {
396
- center: Vector3;
477
+ readonly center: Vector3;
397
478
  radius: number;
398
- minimum: Vector3;
399
- maximum: Vector3;
400
- constructor(min: Vector3, max: Vector3);
401
- intersectsPoint(point: Vector3): boolean;
479
+ readonly centerWorld: Vector3;
480
+ radiusWorld: number;
481
+ readonly minimum: Vector3;
482
+ readonly maximum: Vector3;
483
+ private _worldMatrix;
484
+ constructor(min: Vector3, max: Vector3, worldMatrix?: Matrix);
485
+ reConstruct(min: Vector3, max: Vector3, worldMatrix?: Matrix): void;
486
+ getWorldMatrix(): Matrix;
402
487
  intersectsPoint(point: Vector3): boolean;
403
488
  static Intersects(a: BoundingSphere, b: BoundingSphere): boolean;
404
489
  }
405
490
 
@@ -470,7 +555,7 @@ declare class Color4 {
470
555
  static FromInts(r: number, g: number, b: number, a: number): Color4;
471
556
  }
472
557
 
473
- declare type CompatMaterial = StandardMaterial | PBRMaterial | NodeMaterial | GridMaterial;
558
+ declare type CompatMaterial = StandardMaterial | PBRMaterial | NodeMaterial | GridMaterial | LinesMaterial;
474
559
 
475
560
  /**
476
561
  * Babylon.js `@babylonjs/addons/navigation` `CreateNavigationPluginAsync`. The
@@ -490,19 +575,21 @@ export declare function CreateNavigationPluginAsync(_options?: {
490
575
  * actual GPU work happens when it is assigned to `scene.environmentTexture` and
491
576
  * the engine starts (see `Scene` env handling).
492
577
  */
493
- declare class CubeTexture {
578
+ declare class CubeTexture extends BaseTexture {
494
579
  /** Source URL of the (prefiltered) environment. */
495
580
  readonly url: string;
496
581
  /** Babylon.js `coordinatesMode` (skybox = 5). Recorded for API parity. */
497
582
  coordinatesMode: number;
498
- name: string;
499
583
  gammaSpace: boolean;
500
584
  level: number;
501
585
  /** Fires when the cube map is "ready" (resolved on a microtask in this compat layer). */
502
586
  readonly onLoadObservable: Observable<CubeTexture>;
503
587
  private _ready;
588
+ private readonly _readyPromise;
504
589
  constructor(url: string, _scene?: unknown, _extensions?: unknown, _noMipmap?: boolean, _files?: unknown, onLoad?: (() => void) | null, _onError?: unknown, _format?: unknown, _prefiltered?: boolean);
590
+ getClassName(): string;
505
591
  /** Babylon.js `BaseTexture.isReady()`. */
506
592
  isReady(): boolean;
593
+ whenReadyAsync(): Promise<void>;
507
594
  /** Babylon.js `CubeTexture.CreateFromPrefilteredData(url, scene)`. */
508
595
  static CreateFromPrefilteredData(url: string, scene?: unknown): CubeTexture;
509
596
  dispose(): void;
@@ -607,21 +694,23 @@ declare class HavokPlugin {
607
694
  * `scene.environmentTexture` and the engine starts, at which point the scene
608
695
  * routes it through Babylon Lite's native `loadHdrEnvironment`.
609
696
  */
610
- declare class HDRCubeTexture {
697
+ declare class HDRCubeTexture extends BaseTexture {
611
698
  /** Source URL of the `.hdr` panorama. */
612
699
  readonly url: string;
613
700
  /** Requested cubemap face size (BJS `size`); forwarded to Lite's `faceSize`. */
614
701
  readonly size: number;
615
702
  /** Babylon.js `coordinatesMode` (skybox = 5). Recorded for API parity. */
616
703
  coordinatesMode: number;
617
- name: string;
618
704
  gammaSpace: boolean;
619
705
  level: number;
620
706
  /** Fires when the HDR environment is "ready" (resolved on a microtask). */
621
707
  readonly onLoadObservable: Observable<HDRCubeTexture>;
622
708
  private _ready;
709
+ private readonly _readyPromise;
623
710
  constructor(url: string, _sceneOrEngine?: unknown, size?: number, _noMipmap?: boolean, _generateHarmonics?: boolean, _gammaSpace?: boolean, _prefilterOnLoad?: boolean, onLoad?: (() => void) | null);
711
+ getClassName(): string;
624
712
  /** Babylon.js `BaseTexture.isReady()`. */
625
713
  isReady(): boolean;
714
+ whenReadyAsync(): Promise<void>;
626
715
  dispose(): void;
627
716
  }
628
717
 
@@ -639,19 +728,18 @@ declare abstract class Light extends Node_2 {
639
728
  protected constructor(name: st
640
729
  * carries `0`, but the getter still returns the logical value the caller set.
641
730
  */
642
731
  get intensity(): number;
643
- set intensity(value: number);
644
- /**
645
- * Babylon.js `light.setEnabled(false)` — toggle the light's contribution.
646
- * Babylon Lite has no per-light enable flag, so a disabled light is expressed
647
- * by zeroing its intensity in the shared lights UBO (and restoring it on
648
- * re-enable). The logical intensity value is preserved across the toggle.
649
- */
650
- setEnabled(value: boolean): void;
651
- /** Detach this light's shadow generator (compat for `light.shadowEnabled = false`). */
732
+ set intensity(value: number);
652
733
  /** Detach this light's shadow generator (compat for `light.shadowEnabled = false`). */
653
734
  set shadowEnabled(enabled: boolean);
654
735
  dispose(): void;
655
736
  }
656
737
 
738
+ declare class LinesMaterial extends Material {
739
+ readonly _lite: LineMaterial;
740
+ constructor(name: string, lite: LineMaterial, scene?: Scene);
741
+ getClassName(): string;
742
+ clone(name: string): LinesMaterial;
743
+ }
744
+
657
745
  /** Babylon.js `Material` — base class for all materials. */
658
746
  declare abstract class Material {
659
747
  name: string;
@@ -663,6 +751,22 @@ declare abstract class Material {
663
751
  set backFaceCulling(value: boolean);
664
752
  /** Wireframe rendering toggle (not honoured by all Lite materials). */
665
753
  wireframe: boolean;
666
754
  protected constructor(name: string, scene?: Scene);
667
755
  getClassName(): string;
756
+ /**
757
+ * Babylon.js `Material.clone(name)` — return a deep copy of this material under
758
+ * a new name. Textures are **shared** by reference (matching Babylon.js), but the
759
+ * clone gets its **own** Babylon Lite renderable (a fresh `_buildGroup` / UBO from
760
+ * its factory) rather than aliasing the source's, so the two materials render and
761
+ * dirty-track independently. Each concrete subclass copies its own property set.
762
+ */
763
+ abstract clone(name: string): Material;
668
764
  /** The scene this material was constructed against (Babylon.js `Material.getScene`). */
765
+ getScene(): Scene | undefined;
766
+ /**
767
+ * The textures currently bound to this material (Babylon.js
768
+ * `Material.getActiveTextures`). The base material owns no texture slots, so
769
+ * this returns an empty array; each subclass overrides it to enumerate its own
770
+ * slots and those of its extensions.
771
+ */
772
+ getActiveTextures(): BaseTexture[];
669
773
  protected _markDirty(): void;
670
774
  dispose(): void;
671
775
  }
672
776
 
@@ -724,8 +828,7 @@ declare class Matrix {
724
828
  /** Babylon.js `Mesh` — a concrete renderable mesh with geometry. */
725
829
  declare class Mesh_2 extends AbstractMesh {
726
830
  constructor(name: string, sceneOrLite?: Scene | Mesh, scene?: Scene);
727
- getClassName(): string;
728
- private _morphTargetManager;
831
+ getClassName(): string;
729
832
  private _morphTargetManager;
730
833
  /**
731
834
  * Babylon.js `mesh.morphTargetManager`. Babylon Lite builds morph GPU data via
732
835
  * `createMorphTargets` and stores it on the Lite mesh; the compat manager is
@@ -754,10 +857,43 @@ declare class Mesh_2 extends AbstractMesh {
754
857
  * API. Applied immediately to the Lite mesh (before the scene builds).
755
858
  */
756
859
  thinInstanceSetBuffer(kind: string, buffer: Float32Array | null, _stride?: number): void;
757
- /** Deep mesh clone — not yet wrapped. */
758
- clone(): never;
860
+ /**
861
+ * Babylon.js `mesh.clone(name, newParent?, doNotCloneChildren?)` — a new mesh
862
+ * that shares this mesh's geometry. Forwards to Lite's `cloneTransformNode`,
863
+ * which shares the `_gpu`/skeleton/morph/thin-instance resources with the clone
864
+ * under ref-counting (so both meshes own the buffers and they survive until the
865
+ * last is disposed). Babylon.js uses the requested name verbatim, derives clone
866
+ * IDs from that name plus the source ID, and prefixes descendant names with the
867
+ * root clone name. The source material is kept (BJS shares it by reference), and
868
+ * the clone is registered with the same compat scene through its own wrapper.
869
+ * An omitted or `null` `newParent` keeps the source parent.
870
+ * `doNotCloneChildren` drops the descendants Lite always clones.
871
+ */
872
+ clone(name?: string, newParent?: Node_2 | null, doNotCloneChildren?: boolean): Mesh_2;
873
+ private static _wrapCloneHierarchy;
759
874
  /** Level-of-detail — unsupported (no LOD system in Babylon Lite). */
760
875
  addLODLevel(): never;
876
+ /**
877
+ * Babylon.js `Mesh.MergeMeshes` — bake several meshes into one, transforming
878
+ * each source's geometry by its world matrix. Signature:
879
+ * `MergeMeshes(meshes, disposeSource?, allow32BitsIndices?, meshSubclass?, subdivideWithSubMeshes?, multiMultiMaterials?)`.
880
+ * Uses the compat-local `mergeMeshGeometry`; the merged mesh lives at
881
+ * identity (world transforms are baked in) and takes the first mesh's material.
882
+ *
883
+ * **Supported semantics** (everything else is rejected, never silently dropped):
884
+ * - `disposeSource` (default `true`) — source meshes are disposed after merge.
885
+ * - `allow32BitsIndices` — Lite indices are always uint32, so 32-bit is always
886
+ * available. When `allow32BitsIndices` is falsy and the merged vertex count
887
+ * reaches 65536, this returns `null`, exactly like Babylon.js.
888
+ * - Positions, normals (world-transformed) and one UV set are carried.
889
+ *
890
+ * **Rejected** (throws `LiteCompatError`): `multiMultiMaterials` /
891
+ * `subdivideWithSubMeshes` (Lite has no submesh / multi-material partitioning),
892
+ * a supplied `meshSubclass` target, and sources carrying vertex colours,
893
+ * tangents or a second UV set, or sources carrying skeleton, morph-target, or
894
+ * vertex-animation data (Lite would have to drop them).
895
+ */
896
+ static MergeMeshes(meshes: (Mesh_2 | null | undefined)[], disposeSource?: boolean, allow32BitsIndices?: boolean, meshSubclass?: Mesh_2, subdivideWithSubMeshes?: boolean, multiMultiMaterials?: boolean): Mesh_2 | null;
761
897
  }
762
898
 
763
899
  /** Babylon.js `MorphTarget` — a single named morph influence with absolute target geometry. */
@@ -824,17 +960,26 @@ declare abstract class Node_2 {
824
960
  * descendant nodes that are meshes (all descendants by default).
825
961
  */
826
962
  getChildMeshes(directDescendantsOnly?: boolean, predicate?: (node: Node_2) => boolean): Node_2[];
827
- isEnabled(): boolean;
828
- setEnabled(value: boolean): void;
829
- isDisposed(): boolean;
830
- dispose(): void;
963
+ isEnabled(checkAncestors?: boolean): boolean;
964
+ setEnabled(value: boolean): void;
831
965
  isDisposed(): boolean;
966
+ dispose(doNotRecurse?: boolean): void;
832
967
 
833
968
  declare class NodeMaterial {
834
969
  name: string;
835
970
  backFaceCulling: boolean;
836
971
  private readonly _json;
837
972
  private readonly _textureOverrides;
838
- constructor(name: string, _scene: Scene, json?: object | string);
973
+ private readonly _scene;
974
+ private readonly _pendingBindings;
975
+ private _parsed;
976
+ constructor(name: string, scene: Scene, json?: object | string);
839
977
  getClassName(): string;
978
+ /**
979
+ * Babylon.js `NodeMaterial.clone(name)`. Reuses the same NME source graph and the
980
+ * captured per-block texture overrides (textures shared by reference, as
981
+ * Babylon.js does), registering the clone with the scene so it parses/compiles its
982
+ * own Lite node material (own renderable) at engine start.
983
+ */
984
+ clone(name: string): NodeMaterial;
840
985
  /** Babylon.js `getBlockByName(name)` — returns a proxy that captures texture overrides. */
841
986
  getBlockByName(name: string): NodeMaterialBlockProxy;
842
987
  /** Babylon.js `NodeMaterial.build()` — Lite builds during parse, so this is a no-op. */
843
988
  build(_verbose?: boolean): void;
844
989
  dispose(): void;
845
990
  /**
@@ -856,7 +1001,12 @@ declare class NodeMaterialBlockProxy {
856
1001
  }
857
1002
 
858
1003
  declare class Observable<T> {
1004
+ private _onObserverAdded?;
1005
+ notifyIfTriggered: boolean;
859
1006
  private _observers;
1007
+ private _hasNotified;
1008
+ private _lastNotifiedValue;
1009
+ constructor(_onObserverAdded?: ((observer: ObserverCallback<T>) => void) | undefined, notifyIfTriggered?: boolean);
860
1010
  add(callback: ObserverCallback<T>): ObserverCallback<T>;
861
1011
  addOnce(callback: ObserverCallback<T>): ObserverCallback<T>;
862
1012
  remove(callback: ObserverCallback<T> | null | undefined): boolean;
@@ -864,6 +1014,7 @@ declare class Observable<T> {
864
1014
  notifyObservers(eventData?: T): void;
865
1015
  hasObservers(): boolean;
866
1016
  clear(): void;
1017
+ cleanLastNotifiedState(): void;
867
1018
  }
868
1019
 
869
1020
  /**
@@ -929,7 +1080,8 @@ declare class PBRIridescenceConfiguration {
929
1080
  set maximumThickness(value: number);
930
1081
  }
931
1082
 
932
- declare class PBRMaterial extends PushMaterial {
933
1083
  constructor(name: string, scene?: Scene);
1084
+ declare class PBRMaterial extends PushMaterial {
934
1085
  private _albedoFactor;
1086
+ constructor(name: string, scene?: Scene);
935
1087
  getClassName(): string;
936
1088
  get albedoColor(): Color3;
937
1089
  set albedoColor(value: Color3);
@@ -941,6 +1093,11 @@ declare class PBRMaterial extends PushMaterial {
941
1093
  constructor(name: string, s
942
1094
  get albedoTexture(): BaseTexture | null;
943
1095
  set albedoTexture(texture: BaseTexture | null);
944
1096
  private _albedoTexture;
1097
+ /**
1098
+ * Enumerate every bound PBR texture slot, including extension sub-configurations
1099
+ * (Babylon.js `PBRMaterial.getActiveTextures`).
1100
+ */
1101
+ getActiveTextures(): BaseTexture[];
945
1102
  get metallic(): number;
946
1103
  set metallic(value: number);
947
1104
  get roughness(): number;
@@ -986,8 +1143,15 @@ declare class PBRMaterial extends PushMaterial {
986
1143
  constructor(name: string, s
987
1144
  */
988
1145
  get environmentTexture(): CubeTexture | HDRCubeTexture | null;
989
1146
  set environmentTexture(value: CubeTexture | HDRCubeTexture | null);
1147
+ private _environmentTexture;
990
1148
  get reflectionTexture(): CubeTexture | HDRCubeTexture | null;
991
- set reflectionTexture(value: CubeTexture | HDRCubeTexture | null);
1149
+ set reflectionTexture(value: CubeTexture | HDRCubeTexture | null);
992
1150
  /**
1151
+ * Babylon.js `PBRMaterial.clone(name)`. Copies the albedo/metallic/roughness/
1152
+ * emissive state, shares the albedo texture reference, gives the clone independent
1153
+ * clearcoat/sheen/anisotropy/iridescence sub-configurations (sharing any nested
1154
+ * texture), and a fresh Lite PBR renderable.
1155
+ */
1156
+ clone(name: string): PBRMaterial;
993
1157
 
994
1158
  /** Babylon.js `PBRSheenConfiguration` — the `pbr.sheen` sub-object over Lite `SheenProps`. */
995
1159
  declare class PBRSheenConfiguration {
@@ -1002,10 +1166,12 @@ declare class PBRSheenConfiguration {
1002
1166
  set roughness(value: number);
1003
1167
  get color(): Color3;
1004
1168
  set color(value: Color3);
1005
- /** Babylon.js `sheen.texture`. Binds the Lite handle if the texture has resolved. */
1006
- set texture(value: {
1007
- _lite?: Texture2D;
1008
- } | null);
1169
+ /** Babylon.js `sheen.texture`. Retains the wrapper and binds the Lite handle if the texture has resolved. */
1170
+ get texture(): BaseTexture | null;
1171
+ set texture(value: BaseTexture | null);
1172
+ private _texture;
1173
+ /** Enumerate the sheen texture slot for `Material.getActiveTextures`. */
1174
+ getActiveTextures(): BaseTexture[];
1009
1175
  }
1010
1176
 
1011
1177
  /**
@@ -1070,6 +1236,11 @@ declare class Quaternion {
1070
1236
  * from the rotation part of `matrix`. Backed by Lite's `quatFromRotationMatrix`.
1071
1237
  */
1072
1238
  fromRotationMatrix(matrix: Matrix): this;
1239
+ /**
1240
+ * Babylon.js `Quaternion.toRotationMatrix` — write this quaternion's rotation
1241
+ * into `result`.
1242
+ */
1243
+ toRotationMatrix<T extends Matrix>(result: T): T;
1073
1244
  clone(): Quaternion;
1074
1245
  equals(other: Quaternion): boolean;
1075
1246
  asArray(): [number, number, number, number];
@@ -1182,6 +1353,7 @@ declare class Scene extends AbstractScene {
1182
1353
  /** Babylon.js fog-mode constant
1183
1354
  private _fogDensity;
1184
1355
  private _fogColor;
1185
1356
  private _started;
1186
1357
  private _envTexture;
1358
+ private _brdfTexture;
1187
1359
  private _defaultEnvOptions;
1188
1360
  private readonly _shadowGenerators;
1189
1361
  private readonly _pendingTextures;
@@ -1195,7 +1367,7 @@ declare class Scene extends AbstractScene {
1195
1367
  /** Babylon.js fog-mode constant
1196
1368
  /** Babylon.js `scene.getClassName()`. */
1197
1369
  getClassName(): string;
1198
1370
  /** Babylon.js `scene.getUniqueId()` — the process-unique scene id. */
1199
- getUniqueId(): number;
1200
1371
  /**
1372
+ getUniqueId(): number;
1201
1373
  private _liteShadowGenerators;
1202
1374
  /**
1203
1375
  * Babylon.js `scene.defaultMaterial` — a shared `StandardMaterial` applied to
1204
1376
  * meshes that have no material assigned. Babylon Lite requires every mesh to
1205
1377
  * carry a material to render, so the mesh wrappers assign this lazily-created
@@ -1266,6 +1438,24 @@ declare class Scene extends AbstractScene {
1266
1438
  /** Babylon.js fog-mode constant
1267
1439
  set clipPlane(value: Plane | null);
1268
1440
  get environmentTexture(): CubeTexture | HDRCubeTexture | null;
1269
1441
  set environmentTexture(value: CubeTexture | HDRCubeTexture | null);
1442
+ /**
1443
+ * Babylon.js `scene.environmentBRDFTexture` — the BRDF lookup used by PBR materials.
1444
+ * Babylon.js defaults this to an embedded Base64 LUT and lets apps swap in one of the
1445
+ * published variants (e.g. `https://assets.babylonjs.com/environments/correlatedMSBRDF_RGBD.png`).
1446
+ *
1447
+ * Two deliberate divergences: the getter returns `null` while unset (Babylon.js
1448
+ * populates it with the decoded default once a PBR material is created, whereas Lite
1449
+ * keeps the default as an embedded data URL and never materialises a texture object),
1450
+ * and the assigned texture's own GPU upload goes unused because Babylon Lite decodes
1451
+ * the LUT itself, from the URL, as part of building the environment.
1452
+ */
1453
+ get environmentBRDFTexture(): BaseTexture | null;
1454
+ set environmentBRDFTexture(value: BaseTexture | null);
1455
+ /**
1456
+ * Resolve the BRDF LUT URL for the environment loaders: an app-supplied
1457
+ * `environmentBRDFTexture`, else the embedded Babylon.js-style default.
1458
+ */
1459
+ private _resolveBrdfUrl;
1270
1460
  /**
1271
1461
  * Babylon.js `scene.createDefaultEnvironment` — adds an IBL skybox and ground.
1272
1462
  * Babylon Lite performs this through `loadEnvironment` (deferred to engine start),
@@ -1374,7 +1564,15 @@ declare class StandardMaterial extends PushMaterial {
1374
1564
  constructor(name: stri
1375
1565
  set emissiveTexture(texture: BaseTexture | null);
1376
1566
  private _diffuseTexture;
1377
1567
  private _bumpTexture;
1378
- private _emissiveTexture;
1568
+ private _emissiveTexture;
1569
+ /** Enumerate the standard-material texture slots that are bound (Babylon.js `getActiveTextures`). */
1570
+ getActiveTextures(): BaseTexture[];
1379
1571
  /**
1572
+ * Babylon.js `StandardMaterial.clone(name)`. Copies the diffuse/specular/emissive/
1573
+ * ambient colours and scalars, shares the diffuse/bump/emissive texture references,
1574
+ * and gives the clone its own Lite standard-material renderable.
1575
+ */
1576
+ clone(name: string): StandardMaterial;
1577
+ }
1380
1578
 
1381
1579
  declare interface TextureLike {
1382
1580
  _lite?: Texture2D;