@babylonjs/lite-compat 1.22.0-preview → 1.24.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/index.d.ts CHANGED
@@ -1525,6 +1525,8 @@ export declare class Curve3 {
1525
1525
  static CreateQuadraticBezier(v0: Vector3, v1: Vector3, v2: Vector3, nbPoints: number): Curve3;
1526
1526
  /** Cubic Bézier from `v0` → `v3` with controls `v1`, `v2`, sampled `nbPoints` times. */
1527
1527
  static CreateCubicBezier(v0: Vector3, v1: Vector3, v2: Vector3, v3: Vector3, nbPoints: number): Curve3;
1528
+ static CreateHermiteSpline(p1: Vector3, t1: Vector3, p2: Vector3, t2: Vector3, nSeg: number): Curve3;
1529
+ static CreateCatmullRomSpline(points: readonly Vector3[], nbPoints: number, closed?: boolean): Curve3;
1528
1530
  }
1529
1531
 
1530
1532
  /** A task whose work is provided as a plain async function (useful for custom assets and tests). */
@@ -1754,6 +1756,10 @@ export declare const Frustum: {
1754
1756
  GetPlanesToRef(transform: Matrix, planes: Plane[]): void;
1755
1757
  };
1756
1758
 
1759
+ export declare class FSR1RenderingPipeline {
1760
+ constructor();
1761
+ }
1762
+
1757
1763
  export declare class FxaaPostProcess {
1758
1764
  constructor();
1759
1765
  }
@@ -1853,6 +1859,18 @@ export declare function GetElementPixelFromUv(): never;
1853
1859
 
1854
1860
  export declare function GetPointsCount(..._args: unknown[]): never;
1855
1861
 
1862
+ /**
1863
+ * Babylon.js `GetSupportedSimultaneousLights(scene, maxSimultaneousLights)`.
1864
+ *
1865
+ * Returns the number of simultaneous lights the engine can actually render, which
1866
+ * may be lower than the requested maximum. Engines that declare one uniform buffer
1867
+ * per light in the vertex shader (WebGPU) are bounded by
1868
+ * `maxUniformBuffersPerShaderStage`; past that limit every pipeline creation is
1869
+ * rejected by the validator and nothing renders. Engines that do not report the
1870
+ * limit leave the requested count untouched.
1871
+ */
1872
+ export declare function GetSupportedSimultaneousLights(scene: Scene, maxSimultaneousLights: number): number;
1873
+
1856
1874
  /** Shared base for compat gizmos (Babylon.js `Gizmo`). */
1857
1875
  declare abstract class GizmoBase {
1858
1876
  protected constructor(layer: UtilityLayerRenderer);
1859
1877
  abstract get attachedMesh(): AbstractMesh | null;
@@ -4676,6 +4694,14 @@ declare interface TextureLike {
4676
4694
  export declare class ThinEngine extends AbstractEngine {
4677
4695
  }
4678
4696
 
4697
+ export declare class ThinFSR1SharpenPostProcess {
4698
+ constructor();
4699
+ }
4700
+
4701
+ export declare class ThinFSR1UpscalePostProcess {
4702
+ constructor();
4703
+ }
4704
+
4679
4705
  /**
4680
4706
  * Babylon.js `ThinSprite` — a lightweight pixel-space sprite drawn by a
4681
4707
  * {@link SpriteRenderer}. Position is in screen pixels (origin bottom-left, +Y
package/index.js CHANGED
@@ -3,7 +3,7 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
4
  import { V as Vector3, u as unsupported, L as LiteCompatError, N as Node, M as Matrix, C as Color3, S as StandardMaterial, a as Color4, b as Mesh, T as TransformNode, l as liteBackedVector3, Q as Quaternion } from "./meshes-CidWpEh8.js";
5
5
  import { A, B, c, d, e, f, g, h, i, j, k, m, n, o, p, q, G, I, r, s, t, P, v, w, x, y, z, D, E, F, H, J, K, O, R } from "./meshes-CidWpEh8.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, setAnimationAdditive, playAnimation, pauseAnimation, goToFrame, stopAnimation, createSceneContext, updateAnimationManager, setFog, setClipPlane, loadHdrEnvironment, loadDdsEnvironment, loadEnvironment, createDefaultCamera, addToScene, createHemisphericLight, createAnimationManager, enableAnimationBlending, addAnimationGroup, disposeScene, createDirectionalLight, createPointLight, createSpotLight, createClusteredLightContainer, createClusteredPointLight, removeFromScene, addClusteredLightContainer, markClusteredLightContainerDirty, 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, startParticleSystem, animateParticleSystem, stopParticleSystem, createParticleBillboard, syncParticleBillboard, parseNodeParticleSetFromSnippet, registerNodeParticleSet } from "@babylonjs/lite";
6
+ import { sampleHermiteSpline, sampleCatmullRomSpline, 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, setAnimationAdditive, playAnimation, pauseAnimation, goToFrame, stopAnimation, createSceneContext, updateAnimationManager, setFog, setClipPlane, loadHdrEnvironment, loadDdsEnvironment, loadEnvironment, createDefaultCamera, addToScene, createHemisphericLight, createAnimationManager, enableAnimationBlending, addAnimationGroup, disposeScene, createDirectionalLight, createPointLight, createSpotLight, createClusteredLightContainer, createClusteredPointLight, removeFromScene, addClusteredLightContainer, markClusteredLightContainerDirty, 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, startParticleSystem, animateParticleSystem, stopParticleSystem, createParticleBillboard, syncParticleBillboard, parseNodeParticleSetFromSnippet, registerNodeParticleSet } from "@babylonjs/lite";
7
7
  const Epsilon = 1e-3;
8
8
  const ToRadians = Math.PI / 180;
9
9
  const ToDegrees = 180 / Math.PI;
@@ -284,6 +284,12 @@ class Curve3 {
284
284
  }
285
285
  return new Curve3(points);
286
286
  }
287
+ static CreateHermiteSpline(p1, t1, p2, t2, nSeg) {
288
+ return new Curve3(sampleHermiteSpline(p1, t1, p2, t2, nSeg).map(({ x: x2, y: y2, z: z2 }) => new Vector3(x2, y2, z2)));
289
+ }
290
+ static CreateCatmullRomSpline(points, nbPoints, closed = false) {
291
+ return new Curve3(sampleCatmullRomSpline(points, nbPoints, closed).map(({ x: x2, y: y2, z: z2 }) => new Vector3(x2, y2, z2)));
292
+ }
287
293
  }
288
294
  class Path3D {
289
295
  constructor(points) {
@@ -673,7 +679,7 @@ class AbstractEngine {
673
679
  * WebGPU baseline. A headless `NullEngine` has no device, so all flags are off.
674
680
  */
675
681
  getCaps() {
676
- var _a;
682
+ var _a, _b;
677
683
  const device = (_a = this._lite) == null ? void 0 : _a._device;
678
684
  const has = (name) => {
679
685
  var _a2;
@@ -694,6 +700,12 @@ class AbstractEngine {
694
700
  textureHalfFloat: true,
695
701
  textureFloatLinearFiltering: true,
696
702
  maxTextureSize: 8192,
703
+ // Maximum uniform buffers bindable to a single shader stage. BJS reports this
704
+ // only for engines that enforce it as a hard limit (WebGPU); Babylon Lite is
705
+ // WebGPU-only, so it forwards the device's reported limit, and leaves it
706
+ // undefined for a device-less NullEngine — matching BJS's "left undefined
707
+ // elsewhere" contract.
708
+ maxUniformBuffersPerShaderStage: (_b = device == null ? void 0 : device.limits) == null ? void 0 : _b.maxUniformBuffersPerShaderStage,
697
709
  instancedArrays: true,
698
710
  uintIndices: true
699
711
  };
@@ -5788,6 +5800,15 @@ class GridMaterial {
5788
5800
  dispose() {
5789
5801
  }
5790
5802
  }
5803
+ const NON_LIGHT_VERTEX_UNIFORM_BUFFER_COUNT = 4;
5804
+ function GetSupportedSimultaneousLights(scene, maxSimultaneousLights) {
5805
+ const maxUniformBuffersPerShaderStage = scene.getEngine().getCaps().maxUniformBuffersPerShaderStage;
5806
+ if (maxUniformBuffersPerShaderStage == null) {
5807
+ return maxSimultaneousLights;
5808
+ }
5809
+ const supported = Math.max(maxUniformBuffersPerShaderStage - NON_LIGHT_VERTEX_UNIFORM_BUFFER_COUNT, 0);
5810
+ return Math.min(maxSimultaneousLights, supported);
5811
+ }
5791
5812
  const EASINGMODE_EASEIN = 0;
5792
5813
  const EASINGMODE_EASEOUT = 1;
5793
5814
  const EASINGMODE_EASEINOUT = 2;
@@ -7692,6 +7713,21 @@ class SSAO2RenderingPipeline {
7692
7713
  unsupported("SSAO2RenderingPipeline", "SSAO is not implemented in Babylon Lite.");
7693
7714
  }
7694
7715
  }
7716
+ class FSR1RenderingPipeline {
7717
+ constructor() {
7718
+ unsupported("FSR1RenderingPipeline", "FSR 1 upscaling is not implemented in Babylon Lite; it has no PostProcessRenderPipeline subsystem.");
7719
+ }
7720
+ }
7721
+ class ThinFSR1UpscalePostProcess {
7722
+ constructor() {
7723
+ unsupported("ThinFSR1UpscalePostProcess", "FSR 1 (EASU) upscaling is not implemented in Babylon Lite.");
7724
+ }
7725
+ }
7726
+ class ThinFSR1SharpenPostProcess {
7727
+ constructor() {
7728
+ unsupported("ThinFSR1SharpenPostProcess", "FSR 1 (RCAS) sharpening is not implemented in Babylon Lite.");
7729
+ }
7730
+ }
7695
7731
  class ParticleHelper {
7696
7732
  constructor() {
7697
7733
  unsupported(
@@ -8225,6 +8261,7 @@ export {
8225
8261
  ExecuteCodeAction,
8226
8262
  ExponentialEase,
8227
8263
  FBXFileLoader,
8264
+ FSR1RenderingPipeline,
8228
8265
  FactorGradient,
8229
8266
  FadeInOutBehavior,
8230
8267
  FlyCamera,
@@ -8245,6 +8282,7 @@ export {
8245
8282
  GeospatialClippingBehavior,
8246
8283
  GetElementPixelFromUv,
8247
8284
  GetPointsCount,
8285
+ GetSupportedSimultaneousLights,
8248
8286
  GizmoManager,
8249
8287
  GlowLayer,
8250
8288
  GreasedLineBaseMesh,
@@ -8394,6 +8432,8 @@ export {
8394
8432
  TargetCamera,
8395
8433
  Texture,
8396
8434
  ThinEngine,
8435
+ ThinFSR1SharpenPostProcess,
8436
+ ThinFSR1UpscalePostProcess,
8397
8437
  ThinSprite,
8398
8438
  ToDegrees,
8399
8439
  ToRadians,