@babylonjs/lite-compat 1.39.2 → 1.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,22 +1,57 @@
1
1
  # Changelog
2
2
 
3
- ## @babylonjs/lite v1.39.2
3
+ ## @babylonjs/lite v1.40.0
4
4
 
5
5
  ### ✨ Features
6
6
 
7
+ - **compat:** add texture readback and sync color hex ([#916](https://github.com/BabylonJS/Babylon-Lite/pull/916))
8
+
9
+ ### 🐛 Bug Fixes
10
+
11
+ - **post-process:** scale-relative degeneracy guard for screen-space depth normals ([#912](https://github.com/BabylonJS/Babylon-Lite/pull/912))
12
+
13
+ ### ⚡ Performance
14
+
15
+ - **shadow:** reconcile PCF shadow casters incrementally ([#915](https://github.com/BabylonJS/Babylon-Lite/pull/915))
16
+ - **frame-graph:** add addMeshesToTask / removeMeshesFromTask batch APIs ([#910](https://github.com/BabylonJS/Babylon-Lite/pull/910))
17
+
18
+ ### 🏗️ Build & CI
19
+
20
+ - deploy versioned playground from release tags and retire npm publish pipelines ([#911](https://github.com/BabylonJS/Babylon-Lite/pull/911))
21
+
22
+ **Full Changelog**: https://github.com/BabylonJS/Babylon-Lite/compare/npm-lite-v1.39.3...npm-lite-v1.40.0
23
+
24
+ ## @babylonjs/lite v1.39.3
25
+
26
+ ### ⚠️ BREAKING CHANGES
27
+
28
+ - **scene:** add per-family scene collections for text, depth-hosted sprites, and billboards ([#907](https://github.com/BabylonJS/Babylon-Lite/pull/907))
29
+
30
+ ### ✨ Features
31
+
32
+ - **compat:** wrap native SSAO2 rendering pipeline ([#908](https://github.com/BabylonJS/Babylon-Lite/pull/908))
33
+ - add public texture pixel readback ([#906](https://github.com/BabylonJS/Babylon-Lite/pull/906))
34
+ - **compat:** wrap HTML-in-Canvas polyfill lifecycle ([#903](https://github.com/BabylonJS/Babylon-Lite/pull/903))
35
+ - **compat:** support texture replacement and stub indirect submeshes ([#901](https://github.com/BabylonJS/Babylon-Lite/pull/901))
7
36
  - **compat:** sync bent normals and BJS 9.35 APIs ([#896](https://github.com/BabylonJS/Babylon-Lite/pull/896))
8
37
  - **engine:** add createDevice for early WebGPU device acquisition ([#900](https://github.com/BabylonJS/Babylon-Lite/pull/900))
9
38
 
10
39
  ### 🐛 Bug Fixes
11
40
 
41
+ - **ktx2:** retry failed transcoder WASM fetches ([#905](https://github.com/BabylonJS/Babylon-Lite/pull/905))
42
+ - **texture:** restore HTML texture elements relocated by HTML-in-Canvas polyfills ([#897](https://github.com/BabylonJS/Babylon-Lite/pull/897))
12
43
  - **build:** rewrite all static Lite error messages ([#899](https://github.com/BabylonJS/Babylon-Lite/pull/899))
13
44
  - **demos:** repair ambient occlusion deployment and controls ([#894](https://github.com/BabylonJS/Babylon-Lite/pull/894))
14
45
 
46
+ ### 🏗️ Build & CI
47
+
48
+ - add dependency review workflow ([#904](https://github.com/BabylonJS/Babylon-Lite/pull/904))
49
+
15
50
  ### 🔧 Other Changes
16
51
 
17
52
  - Clone rotation fix ([#893](https://github.com/BabylonJS/Babylon-Lite/pull/893))
18
53
 
19
- **Full Changelog**: https://github.com/BabylonJS/Babylon-Lite/compare/npm-lite-v1.39.0...npm-lite-v1.39.2
54
+ **Full Changelog**: https://github.com/BabylonJS/Babylon-Lite/compare/npm-lite-v1.39.0...npm-lite-v1.39.3
20
55
 
21
56
  ## @babylonjs/lite v1.39.0
22
57
 
package/README.md CHANGED
@@ -128,7 +128,7 @@ overloads within a supported area may still be absent.
128
128
  | CSG / CSG2 | ✅ | over Lite boolean ops |
129
129
  | Gizmos (position/rotation/scale/bounding-box/light/camera + `GizmoManager`) | ⚡ | over Lite gizmo suite; `isEnabled` toggles per-axis interactivity (display-only when disabled) |
130
130
  | Materials (`StandardMaterial`, `PBRMaterial`, metallic-rough / spec-gloss, `NodeMaterial`) | ⚡ | Includes native bent-normal IBL occlusion and cloned loaded PBR materials; BJS parallax scale semantics, Gaussian-splat plugins, preprocessed `ShaderMaterial`, `MultiMaterial`, `BackgroundMaterial`, and `OpenPBRMaterial` remain unsupported |
131
- | Textures (`Texture`, `RawTexture`, `RawTexture2DArray`, `RawTexture3D`, `DynamicTexture`, `HtmlTexture`, `ExternalTexture`, cube textures) | ⚡ | New texture/scatter processors support exact constant-only paths; textured operands need BJS's missing procedural render-target pipeline and throw. Arrays, base-level 3D volumes, dynamic/HTML/external textures, and cube environments work; `RenderTargetTexture` / `MirrorTexture` remain unsupported |
131
+ | Textures (`Texture`, `RawTexture`, `RawTexture2DArray`, `RawTexture3D`, `DynamicTexture`, `HtmlTexture`, `ExternalTexture`, cube textures) | ⚡ | URL textures support ready-image replacement with material rebinding. `BaseTexture.readPixels` forwards GPU-backed color textures to Lite RGBA8 readback with mip, array-layer, caller-buffer, and crop support; environment cube handles have no standalone readback allocation. Texture/scatter processors support exact constant-only paths; textured operands need BJS's missing procedural render-target pipeline and throw. Arrays, base-level 3D volumes, dynamic/HTML/external textures, and cube environments work; `RenderTargetTexture` / `MirrorTexture` remain unsupported |
132
132
  | Animation (keyframe `Animation`, easing, `Animatable`, `AnimationGroup` incl. weighted/additive blend) | ⚡ | All standard easing classes, including `PowerEase` / `BezierCurveEase`, reuse Lite's native functional curves; `beginAnimation` / `beginDirectAnimation` delegate supported float/vector/quaternion tracks to Lite property animation; unsupported tracks use an explicit compat evaluator; structural groups remain compat-owned; loaded glTF skeletal blending supported; root-motion analysis/controller APIs throw |
133
133
  | Morph targets (`MorphTarget` / `MorphTargetManager`) | ✅ | over Lite morph targets, including named loader-produced targets and live influence writes |
134
134
  | Sprites (`SpriteManager` / `Sprite`) | ⚡ | camera-facing billboards; `SpriteMap` / packed atlas unsupported |
@@ -137,7 +137,7 @@ overloads within a supported area may still be absent.
137
137
  | Audio V2 (`AudioEngineV2`, `StaticSound`, `StreamingSound`, `AudioBus`, buses/sources/analyzer) | ⚡ | over Lite's AudioV2 port; `MainAudioBus` spatial/analyzer and a second main bus unsupported |
138
138
  | Physics (`HavokPlugin`, `scene.enablePhysics`/`getPhysicsEngine`, `PhysicsAggregate`/`PhysicsBody`/`PhysicsShape`) | ⚡ | Native Havok V2 forwarding for common body/shape operations, thin-instance bodies, and filtered raycasts with instance indices; unrecognized enum values throw at the compat boundary |
139
139
  | Particles (`NodeParticleSystemSet` / `ParticleSystemSet` — Node Particle Editor) | ⚡ | NPE snippet/JSON graphs: `Parse`/`ParseFromSnippetAsync` → `buildAsync` → `start`, with stable named systems through both `set.systems` and `scene.particleSystems`, plus `isStarted`; imperative classic/GPU/solid construction and programmatic block authoring remain unsupported |
140
- | Post-processes, layers (glow/highlight), probes, WebXR | ❌ | Babylon.js wrapper classes remain unsupported; Lite SSAO has materially different sampling/intensity/blur semantics and is available through native tasks |
140
+ | Post-processes, layers (glow/highlight), probes, WebXR | ⚡ | `SSAO2RenderingPipeline` forwards its common scene/camera lifecycle and settings to Lite's native SSAO controller; estimator-specific controls are readback-only. Other Babylon.js post-process wrapper classes, layers, probes, and WebXR remain unsupported |
141
141
 
142
142
  ### `@babylonjs/loaders`
143
143
 
package/index.d.ts CHANGED
@@ -1112,6 +1112,7 @@ export declare abstract class BaseTexture {
1112
1112
  */
1113
1113
  getInternalTexture(): Texture2D | null;
1114
1114
  abstract whenReadyAsync(): Promise<void>;
1115
+ readPixels(faceIndex?: number, level?: number, buffer?: ArrayBufferView | null, _flushRenderer?: boolean, _noDataConversion?: boolean, x?: number, y?: number, width?: number, height?: number): Promise<ArrayBufferView> | null;
1115
1116
  dispose(): void;
1116
1117
  }
1117
1118
 
@@ -1505,6 +1506,7 @@ export declare class Color4 {
1505
1506
  clone(): Color4;
1506
1507
  equals(other: Color4): boolean;
1507
1508
  asArray(): [number, number, number, number];
1509
+ toHexString(returnAsColor3?: boolean): string;
1508
1510
  static FromArray(array: ArrayLike<number>, offset?: number): Color4;
1509
1511
  static FromInts(r: number, g: number, b: number, a: number): Color4;
1510
1512
  }
@@ -3707,7 +3709,13 @@ export declare class IncrementValueAction extends Action {
3707
3709
  /** Babylon.js `InitializeCSG2Async()` — load the Manifold runtime before any `CSG2` use. */
3708
3710
  export declare function InitializeCSG2Async(): Promise<void>;
3709
3711
 
3710
- /** Babylon.js `InstallHtmlInCanvasPolyfill` — the HTML-in-canvas polyfill is unsupported by the compat layer. */
3712
+ /**
3713
+ * Babylon.js `InstallHtmlInCanvasPolyfill`.
3714
+ *
3715
+ * The installed polyfill would redirect Lite to an incompatible positional
3716
+ * upload API, so exposing the installer without changing Lite's hot path would
3717
+ * break otherwise-working HTML textures.
3718
+ */
3711
3719
  export declare function InstallHtmlInCanvasPolyfill(): never;
3712
3720
 
3713
3721
  /** Babylon.js `InstancedMesh` — hardware instances are not modelled; use thin instances. */
@@ -3785,7 +3793,13 @@ export declare interface ISceneLoaderProgressEvent {
3785
3793
  /** Babylon.js internal polyfill-state query. Compat never installs the unsupported polyfill. */
3786
3794
  export declare function _IsHtmlInCanvasPolyfillInstalled(): boolean;
3787
3795
 
3788
- /** Babylon.js `IsHtmlInCanvasSupportedNatively` — the HTML-in-canvas feature is unsupported by the compat layer. */
3796
+ /**
3797
+ * Babylon.js `IsHtmlInCanvasSupportedNatively`.
3798
+ *
3799
+ * The legacy polyfill uses a positional upload signature that Lite's existing
3800
+ * HTML texture module cannot consume without adding feature branches to a
3801
+ * module already included by HTML-texture users.
3802
+ */
3789
3803
  export declare function IsHtmlInCanvasSupportedNatively(): never;
3790
3804
 
3791
3805
  /** Babylon.js `IsHtmlInCanvasUploadSupported` — kept in lockstep with the unavailable upload helper. */
@@ -5085,7 +5099,8 @@ export declare class PBRMetallicRoughnessMaterial extends PBRMaterial {
5085
5099
  export declare class PBRSheenConfiguration {
5086
5100
  private readonly _props;
5087
5101
  private readonly _markDirty;
5088
- constructor(_props: SheenProps, _markDirty: () => void);
5102
+ private readonly _watchTexture;
5103
+ constructor(_props: SheenProps, _markDirty: () => void, _watchTexture: (texture: BaseTexture | null) => void);
5089
5104
  get isEnabled(): boolean;
5090
5105
  set isEnabled(value: boolean);
5091
5106
  get intensity(): number;
@@ -5098,9 +5113,9 @@ export declare class PBRSheenConfiguration {
5098
5113
  get texture(): BaseTexture | null;
5099
5114
  set texture(value: BaseTexture | null);
5100
5115
  private _texture;
5116
+ private _textureAssigned;
5101
5117
  /** Enumerate the sheen texture slot for `Material.getActiveTextures`. */
5102
- getActiveTextures(): BaseTexture[];
5103
- }
5118
+ getActiveTextures(): BaseTexture[];
5104
5119
 
5105
5120
  /**
5106
5121
  * Babylon.js `PBRSpecularGlossinessMaterial` — the spec/gloss workflow is
@@ -5632,6 +5647,27 @@ export declare class PostProcess {
5632
5647
  constructor();
5633
5648
  }
5634
5649
 
5650
+ /** Babylon.js post-process pipeline shape consumed by the manager. */
5651
+ export declare interface PostProcessRenderPipeline {
5635
5652
  readonly isSupported: boolean;
5636
5653
  dispose(): void;
5654
+ }
5655
+
5656
+ /** Babylon.js-compatible post-process pipeline registry for native Lite-backed pipelines. */
5657
+ export declare class PostProcessRenderPipelineManager {
5658
+ private readonly _renderPipelines;
5659
+ private readonly _onNewPipelineAddedObservable;
5660
+ private readonly _onPipelineRemovedObservable;
5661
+ get onNewPipelineAddedObservable(): Observable<PostProcessRenderPipeline>;
5662
+ get onPipelineRemovedObservable(): Observable<PostProcessRenderPipeline>;
5663
+ get supportedPipelines(): PostProcessRenderPipeline[];
5664
+ addPipeline(renderPipeline: PostProcessRenderPipeline): void;
5665
+ removePipeline(renderPipelineName: string): void;
5666
+ attachCamerasToRenderPipeline(renderPipelineName: string, cameras: Camera[] | Camera, unique?: boolean): void;
5667
+ detachCamerasFromRenderPipeline(renderPipelineName: string, cameras: Camera[] | Camera): void;
5668
+ enableEffectInPipeline(renderPipelineName: string, renderEffectName: string, cameras: Camera[] | Camera): void;
5669
+ disableEffectInPipeline(renderPipelineName: string, renderEffectName: string, cameras: Camera[] | Camera): void;
5670
+ update(): void;
5637
5671
  dispose(): void;
5672
+ }
5673
+
5638
5674
  /**
5639
5675
  * Babylon.js-compatible power easing class.
5640
5676
  */
@@ -5750,6 +5786,11 @@ export declare class QuinticEase extends EasingFunction {
5750
5786
  */
5751
5787
  export declare function RandomGUID(): string;
5752
5788
 
5789
+ declare type Ratio = number | {
5790
+ ssaoRatio?: number;
5791
+ blurRatio?: number;
5792
+ };
5793
+
5753
5794
  /**
5754
5795
  * Babylon.js `RawTexture` — a texture created from raw pixel bytes. Backed by
5755
5796
  * Babylon Lite's `createTexture2DFromPixels`; the GPU handle is available
@@ -6118,11 +6159,13 @@ export declare class Scene extends AbstractScene {
6118
6159
  /** Babylon.js fog-mode c
6119
6160
  private readonly _retiredParticleSystems;
6120
6161
  private _disposed;
6121
6162
  private _ambientColor;
6122
6163
  private _environmentIntensity;
6123
- private _imageProcessingConfiguration;
6124
6164
  /** Babylon.js `scene.uniqueId` — a process-unique numeric id. */
6165
+ private _imageProcessingConfiguration;
6166
+ private _postProcessRenderPipelineManager;
6125
6167
  /** Babylon.js `scene.uniqueId` — a process-unique numeric id. */
6126
6168
  readonly uniqueId: number;
6127
6169
  constructor(engine: WebGPUEngine);
6128
6170
  private _attachPointerEvents;
6129
6171
  private _detachPointerEvents;
6130
6172
  getEngine(): WebGPUEngine;
6173
+ get postProcessRenderPipelineManager(): PostProcessRenderPipelineManager;
6131
6174
  /** Babylon.js `scene.getClassName()`. */
6132
6175
  getClassName(): string;
6133
6176
  /** Babylon.js `scene.getUniqueId()` — the process-unique scene id. */
@@ -6801,8 +6844,77 @@ export declare class SpriteRenderer {
6801
6844
  */
6802
6845
  render(sprites: readonly ThinSpriteLike[], _deltaTime?: number, _view?: unknown, _projection?: unknown): void;
6803
6846
 
6847
+ /** Babylon.js-shaped adapter over Babylon Lite's native scene SSAO pipeline. */
6804
6848
  export declare class SSAO2RenderingPipeline {
6805
- constructor();
6849
+ private static _uniqueIdSource;
6850
+ readonly SSAOOriginalSceneColorEffect = "SSAOOriginalSceneColorEffect";
6851
+ readonly SSAORenderEffect = "SSAORenderEffect";
6852
+ readonly SSAOBlurHRenderEffect = "SSAOBlurHRenderEffect";
6853
+ readonly SSAOBlurVRenderEffect = "SSAOBlurVRenderEffect";
6854
+ readonly SSAOCombineRenderEffect = "SSAOCombineRenderEffect";
6855
+ readonly isSupported: boolean;
6856
+ readonly uniqueId: number;
6806
6857
  private readonly _scene;
6858
+ private readonly _ratio;
6859
+ private readonly _forceGeometryBuffer;
6860
+ private readonly _textureType;
6861
+ private readonly _resolutionScale;
6862
+ private _native;
6863
+ private _camera;
6864
+ private _disposed;
6865
+ private _radius;
6866
+ private _totalStrength;
6867
+ private _base;
6868
+ private _maxZ;
6869
+ private _minZAspect;
6870
+ private _epsilon;
6871
+ private _samples;
6872
+ private _expensiveBlur;
6873
+ private _bypassBlur;
6874
+ private _bilateralSamples;
6875
+ private _bilateralSoften;
6876
+ private _bilateralTolerance;
6877
+ private _useViewportInCombineStage;
6878
+ private _textureSamples;
6879
+ private readonly _warned;
6880
+ readonly cameras: Camera[];
6881
+ constructor(name: string, scene: Scene, ratio: Ratio, cameras?: Camera[], forceGeometryBuffer?: boolean | object, textureType?: number);
6882
+ get radius(): number;
6883
+ set radius(value: number);
6884
+ get totalStrength(): number;
6885
+ set totalStrength(value: number);
6886
+ get base(): number;
6887
+ set base(value: number);
6888
+ get maxZ(): number;
6889
+ set maxZ(value: number);
6890
+ get minZAspect(): number;
6891
+ set minZAspect(value: number);
6892
+ get epsilon(): number;
6893
+ set epsilon(value: number);
6894
+ get samples(): number;
6895
+ set samples(value: number);
6896
+ get expensiveBlur(): boolean;
6897
+ get bypassBlur(): boolean;
6898
+ set bypassBlur(value: boolean);
6899
+ get bilateralSamples(): number;
6900
+ set bilateralSamples(value: number);
6901
+ get bilateralSoften(): number;
6902
+ set bilateralSoften(value: number);
6903
+ get bilateralTolerance(): number;
6904
+ set bilateralTolerance(value: number);
6905
+ get useViewportInCombineStage(): boolean;
6906
+ set useViewportInCombineStage(value: boolean);
6907
+ set expensiveBlur(value: boolean);
6908
+ get textureSamples(): number;
6909
+ set textureSamples(value: number);
6910
+ getClassName(): string;
6911
+ get name(): string;
6912
+ get engine(): AbstractEngine;
6913
+ get scene(): Scene;
6914
+ static get IsSupported(): boolean;
6915
+ static Parse(source: Record<string, unknown>, scene: Scene): SSAO2RenderingPipeline;
6916
+ isReady(): boolean;
6917
+ serialize(): Record<string, unknown>;
6807
6918
  dispose(_disableGeometryBufferRenderer?: boolean): void;
6919
+ private _warnUnsupported;
6808
6920
  }
6809
6921
 
6810
6922
  export declare class StandardMaterial extends PushMaterial {
6811
6923
  /** Diffuse colour as the app set it. Kept apart from `_lite.diffuseColor`, which is forced to white
@@ -6985,6 +7097,12 @@ export declare class StringDictionary<T> {
6985
7097
  forEach(callback: (key: string, value: T) => void): void;
6986
7098
  }
6987
7099
 
7100
+ /** Babylon.js `SubMesh`; pass-specific indirect drawing requires Lite renderer integration. */
7101
+ export declare class SubMesh {
7102
+ constructor(_materialIndex: number, _verticesStart: number, _verticesCount: number, _indexStart: number, _indexCount: number, _mesh: AbstractMesh, _renderingMesh?: Mesh, _createBoundingBox?: boolean, _addToMesh?: boolean);
7103
+ setIndirectDrawBuffer(_buffer: unknown | null, _byteOffset: number, _renderPassId: number): void;
7104
+ }
7105
+
6988
7106
  export declare class SurfaceMagnetismBehavior {
6989
7107
  constructor();
6990
7108
  }
@@ -7067,9 +7185,9 @@ export declare class Texture extends BaseTexture {
7067
7185
  hasAlpha: boolean;
7068
7186
  coordinatesIndex: number;
7069
7187
  /** Babylon.js sampling mode passed at construction (`NEAREST_SAMPLINGMODE` = 1, etc.). */
7070
- readonly samplingMode: number;
7071
7188
  constructor(url: string, sceneOrEngine: Scene | {
7189
+ samplingMode: number;
7072
7190
  constructor(url: string, sceneOrEngine: Scene | {
7073
7191
  _lite: EngineContext;
7074
- }, noMipmapOrOptions?: unknown, invertY?: boolean, _samplingMode?: number, onLoad?: (() => void) | null);
7075
7192
  private readonly _noMipmap;
7193
+ }, noMipmapOrOptions?: unknown, invertY?: boolean, _samplingMode?: number, onLoad?: (() => void) | null);
7076
7194
  private _noMipmap;
7077
7195
  getClassName(): string;
7078
7196
  /**
7079
7197
  * Babylon.js `texture.clone()` — a new `Texture` over the same source URL.
@@ -7077,6 +7195,12 @@ export declare class Texture extends BaseTexture {
7077
7195
  * handle (tracked against the same scene so it is ready at build).
7078
7196
  */
7079
7197
  clone(): Texture;
7198
+ /**
7199
+ * Babylon.js `Texture.replaceImage` — reuse another ready URL texture's Lite
7200
+ * handle without reloading it. Wrapper UV state remains local; loading state
7201
+ * follows the source so later clones resolve the same image.
7202
+ */
7203
+ replaceImage(source: Texture): boolean;
7080
7204
  whenReadyAsync(): Promise<void>;
7081
7205
  /** Babylon.js `Texture.onLoadObservable`, allocated only when code subscribes. */
7082
7206
  get onLoadObservable(): Observable<Texture>;
@@ -7326,7 +7450,7 @@ export declare class UniformBuffer {
7326
7450
  private _setInteger;
7327
7451
  }
7328
7452
 
7329
- /** Babylon.js `UninstallHtmlInCanvasPolyfill` — the HTML-in-canvas polyfill is unsupported by the compat layer. */
7453
+ /** Babylon.js `UninstallHtmlInCanvasPolyfill`; paired with the structurally blocked installer. */
7330
7454
  export declare function UninstallHtmlInCanvasPolyfill(): never;
7331
7455
 
7332
7456
  /** Babylon.js `UniversalCamera` — touch-friendly free camera. */