@babylonjs/lite-compat 1.31.0-preview → 1.31.1-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.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { A as PBRSpecularGlossinessMaterial, B as transformCoordinates, C as Material, D as PBRMaterial, E as PBRIridescenceConfiguration, F as Observable, G as liteBackedColor3, H as Quaternion, I as BoundingBox, J as Vector4, K as Vector2, L as BoundingInfo, M as StandardMaterial, N as attachMaterialToScene, O as PBRMetallicRoughnessMaterial, P as Node, R as BoundingSphere, S as registerMeshAtStart, T as PBRClearCoatConfiguration, U as Color3, V as transformNormal, W as Color4, X as LiteCompatError, Y as liteBackedVector3, Z as unsupported, _ as Mesh, a as CreateDisc, b as VertexBuffer, c as CreateLines, d as CreateTiledBox, f as CreateTiledPlane, g as LinesMesh, h as InstancedMesh, i as CreateDashedLines, j as PushMaterial, k as PBRSheenConfiguration, l as CreatePlane, m as GroundMesh, n as CreateBox, o as CreateGround, p as CreateTorus, q as Vector3, r as CreateCylinder, s as CreateLineSystem, t as AbstractMesh, u as CreateSphere, v as MeshBuilder, w as PBRAnisotropicConfiguration, x as VertexData, y as TransformNode, z as Matrix } from "./meshes-Fu955h5M.js";
2
- import { CharacterSupportedState as CharacterSupportedState$1, MaxTintMagnitude, MinTemperatureKelvin, PhysicsConstraintAxis as PhysicsConstraintAxis$1, PhysicsConstraintType as PhysicsConstraintType$1, PhysicsMotionType as PhysicsMotionType$1, PhysicsPrestepType as PhysicsPrestepType$1, PhysicsShapeType as PhysicsShapeType$1, VERSION, addAnimationGroup, addBillboardSpriteIndex, addClusteredLightContainer, addFacingBillboardSystem, addPolarToRef, addSphericalToRef, addSprite2DIndex, addToScene, animateParticleSystem, applyPhysicsBodyForce, applyPhysicsBodyImpulse, attachAxisDragGizmoToNode, attachAxisScaleGizmoToNode, attachBoundingBoxGizmoToNode, attachCameraGizmoToCamera, attachControl, attachFreeControl, attachGeospatialControls, attachLightGizmoToLight, attachPlaneDragGizmoToNode, attachPlaneRotationGizmoToNode, attachPositionGizmoToNode, attachRotationGizmoToNode, attachScaleGizmoToNode, bakeCurrentTransformIntoVertices, billboardBlendAdditive, billboardBlendAlpha, calculatePhysicsCharacterMovementToRef, clearBoneOverride, createAnimationManager, createArcRotateCamera, createAudioBusAsync, createAudioEngineAsync, createAxisDragGizmo, createAxisScaleGizmo, createBankedFreeCamera, createBoundingBoxGizmo, createCameraGizmo, createClusteredLightContainer, createClusteredPointLight, createCsg2FromMesh, createCsgFromMesh, createCsmDirectionalShadowGenerator, createDefaultCamera, createDefaultMeshBlendRadiusDefinitions, createDirectionalLight, createDynamicTexture, createEngine, createEsmDirectionalShadowGenerator, createFacingBillboardSystem, createFreeCamera, createGeospatialCamera, createGpuPicker, createGridMaterial, createHavokWorld, createHemisphericLight, createHtmlTexture, createKhrInteractivityRuntimeValueSnapshot, createLightGizmo, createMeshFromCsg, createMeshesFromCsg2, createMicrophoneSoundSourceAsync, createMorphTargets, createNullEngine, createParticleBillboard, createPcfDirectionalShadowGenerator, createPcfSpotlightShadowGenerator, createPhysicsAggregate, createPhysicsBody, createPhysicsCharacterController, createPhysicsConstraint, createPhysicsShape, createPickingRay, createPlaneDragGizmo, createPlaneRotationGizmo, createPointLight, createPositionGizmo, createRotationGizmo, createScaleGizmo, createSceneContext, createSoundAsync, createSoundBufferAsync, createSoundSourceAsync, createSpotLight, createSprite2DLayer, createSpriteRenderer, createStreamingSoundAsync, createTexture2DArray, createTexture2DArrayFromKtx2, createTexture2DArrayFromPixels, createTexture2DArrayFromUrls, createTexture2DFromPixels, createTexture3DFromPixels, createTransformNode, createUtilityLayer, csg2Add, csg2Intersect, csg2Subtract, csgIntersect, csgSubtract, csgUnion, disableOrthographicCamera, disposeAudioBus, disposeAudioEngine, disposeAxisDragGizmo, disposeAxisScaleGizmo, disposeBoundingBoxGizmo, disposeCameraGizmo, disposeCsg2, disposeEngine, disposeHtmlTexture, disposeLightGizmo, disposePhysics, disposePicker, disposePlaneDragGizmo, disposePlaneRotationGizmo, disposePositionGizmo, disposeRotationGizmo, disposeScaleGizmo, disposeScene, disposeSound, disposeSoundSource, disposeStreamingSound, disposeUtilityLayer, dividePolarToRef, divideSphericalToRef, enableAnalyzer, enableAnimationBlending, enableArcRotateKeyboardControls, enableBoneControlForSkinnedAssets, enableHavokThinInstancePhysicsSync, enableMirroredMeshes, enableOrthographicCamera, enableSpatial, enableStereo, getBoneByName, getByteFrequencyData, getByteTimeDomainData, getCameraPosition, getFloatFrequencyData, getFloatTimeDomainData, getMasterVolume, getPhysicsBodyAngularVelocity, getPhysicsBodyLinearVelocity, getProjectionMatrix, getVariantNames, getViewMatrix, getWhiteBalanceMatrix, goToFrame, hasDefaultInteractivityFlowInput, initializeCsg2Async, invertMat4, loadBabylon, loadBasisTexture2D, loadDdsEnvironment, loadEnvironment, loadGltf, loadHdrEnvironment, loadImageToArrayLayer, loadKtxTexture2D, loadSOG, loadSPZ, loadSplat, loadSpriteAtlas, loadTexture2D, markClusteredLightContainerDirty, multiplyMat4, multiplyPolarToRef, multiplySphericalToRef, normalizeInteractivityEventDataConfiguration, normalizeKhrInteractivityRuntimeValue, onBeforeRender, onPhysicsAfterStep, packMeshBlendingTag, parseNodeMaterialFromSnippet, parseNodeParticleSetFromSnippet, pauseAnimation, pauseSound, pauseStreamingSound, physicsRaycast, pickAsync, pickMeshesWithRay, playAnimation, playSound, playStreamingSound, polarFromVec2ToRef, polarToVec2ToRef, preloadStreamingInstanceAsync, preloadStreamingInstancesAsync, registerNodeParticleSet, registerScene, registerSceneWithShadowSupport, registerSpriteRenderer, registerUtilityLayer, releasePhysicsConstraint, releasePhysicsShape, removeFromScene, removePhysicsBody, requestHtmlTextureUpdate, resetVariant, resizeEngine, resolveCameraViewport, resumeSound, resumeStreamingSound, sampleCatmullRomSpline, sampleHermiteSpline, scalePolarToRef, scaleSphericalToRef, selectVariant, setAnimationAdditive, setBonePosition, setBoneRotationQuaternion, setBoneScaling, setBusVolume, setClipPlane, setEngineSize, setFog, setGeospatialOrientation, setMasterVolume, setMorphTargetWeights, setPhysicsBodyAngularVelocity, setPhysicsBodyLinearVelocity, setPhysicsBodyMassProperties, setPhysicsBodyMotionType, setPhysicsBodyPrestepType, setPhysicsBodyShape, setPhysicsGravity, setPhysicsShapeFilterCollideMask, setPhysicsShapeFilterMembershipMask, setPhysicsShapeIsTrigger, setPhysicsShapeMaterial, setPhysicsTimestep, setPositionGizmoLocalCoordinates, setRotationGizmoLocalCoordinates, setScaleGizmoLocalCoordinates, setShadowTaskCasterMeshes, setSoundSourceVolume, setSoundVolume, setSpatialListener, setSpatialListenerPosition, setSpatialOrientation, setSpatialPosition, setStereoPan, setStreamingSoundVolume, sphericalFromVec3ToRef, sphericalToVec3ToRef, spriteBlendAdditive, spriteBlendAlpha, spriteBlendPremultiplied, startEngine, startParticleSystem, stepScene, stopAnimation, stopEngine, stopParticleSystem, stopSound, stopStreamingSound, subtractPolarToRef, subtractSphericalToRef, syncParticleBillboard, temperatureTintToXyz, unlockAudioEngineAsync, unpackMeshBlendingTag, updateAnimationManager, updateBillboardSpriteIndex, updateDynamicTexture, updateHtmlTexture, updateSpatialAudio, updateSprite2DIndex, updateTexture2DArrayFromPixels, updateTexture2DFromPixels, uploadImageToArrayLayer, whenHtmlTextureReady } from "@babylonjs/lite";
2
+ import { CharacterSupportedState as CharacterSupportedState$1, MaxTintMagnitude, MinTemperatureKelvin, PhysicsConstraintAxis as PhysicsConstraintAxis$1, PhysicsConstraintType as PhysicsConstraintType$1, PhysicsMotionType as PhysicsMotionType$1, PhysicsPrestepType as PhysicsPrestepType$1, PhysicsShapeType as PhysicsShapeType$1, VERSION, addAnimationGroup, addBillboardSpriteIndex, addClusteredLightContainer, addComputeDispatch, addFacingBillboardSystem, addPolarToRef, addSphericalToRef, addSprite2DIndex, addToScene, animateParticleSystem, applyPhysicsBodyForce, applyPhysicsBodyImpulse, attachAxisDragGizmoToNode, attachAxisScaleGizmoToNode, attachBoundingBoxGizmoToNode, attachCameraGizmoToCamera, attachControl, attachFreeControl, attachGeospatialControls, attachLightGizmoToLight, attachPlaneDragGizmoToNode, attachPlaneRotationGizmoToNode, attachPositionGizmoToNode, attachRotationGizmoToNode, attachScaleGizmoToNode, backEase, bakeCurrentTransformIntoVertices, bezierCurveEase, billboardBlendAdditive, billboardBlendAlpha, bounceEase, calculatePhysicsCharacterMovementToRef, circleEase, clearAnimationManager, clearBoneOverride, clearStorageBuffer, computeStorageBufferBinding, computeUniformBufferBinding, createAnimationManager, createArcRotateCamera, createAudioBusAsync, createAudioEngineAsync, createAxisDragGizmo, createAxisScaleGizmo, createBankedFreeCamera, createBoundingBoxGizmo, createCameraGizmo, createClusteredLightContainer, createClusteredPointLight, createComputeBindingSet, createComputeDispatch, createComputeIndirectDispatch, createComputeShader, createComputeTask, createCsg2FromMesh, createCsgFromMesh, createCsmDirectionalShadowGenerator, createDefaultCamera, createDefaultMeshBlendRadiusDefinitions, createDirectionalLight, createDynamicTexture, createEngine, createEsmDirectionalShadowGenerator, createFacingBillboardSystem, createFreeCamera, createGeospatialCamera, createGpuPicker, createGridMaterial, createHavokWorld, createHemisphericLight, createHtmlTexture, createKhrInteractivityRuntimeValueSnapshot, createLightGizmo, createMeshFromCsg, createMeshesFromCsg2, createMicrophoneSoundSourceAsync, createMorphTargets, createNullEngine, createParticleBillboard, createPcfDirectionalShadowGenerator, createPcfSpotlightShadowGenerator, createPhysicsAggregate, createPhysicsBody, createPhysicsCharacterController, createPhysicsConstraint, createPhysicsShape, createPickingRay, createPlaneDragGizmo, createPlaneRotationGizmo, createPointLight, createPositionGizmo, createPropertyAnimationClip, createPropertyAnimationGroup, createRotationGizmo, createScaleGizmo, createSceneContext, createSoundAsync, createSoundBufferAsync, createSoundSourceAsync, createSpotLight, createSprite2DLayer, createSpriteRenderer, createStorageBuffer, createStreamingSoundAsync, createTexture2DArray, createTexture2DArrayFromKtx2, createTexture2DArrayFromPixels, createTexture2DArrayFromUrls, createTexture2DFromPixels, createTexture3DFromPixels, createTransformNode, createUniformBuffer, createUtilityLayer, csg2Add, csg2Intersect, csg2Subtract, csgIntersect, csgSubtract, csgUnion, cubicEase, disableOrthographicCamera, disposeAudioBus, disposeAudioEngine, disposeAxisDragGizmo, disposeAxisScaleGizmo, disposeBoundingBoxGizmo, disposeCameraGizmo, disposeComputeBindingSet, disposeComputeShader, disposeCsg2, disposeEngine, disposeHtmlTexture, disposeLightGizmo, disposePhysics, disposePicker, disposePlaneDragGizmo, disposePlaneRotationGizmo, disposePositionGizmo, disposeRotationGizmo, disposeScaleGizmo, disposeScene, disposeSound, disposeSoundSource, disposeStorageBuffer, disposeStreamingSound, disposeUniformBuffer, disposeUtilityLayer, dividePolarToRef, divideSphericalToRef, elasticEase, enableAnalyzer, enableAnimationBlending, enableArcRotateKeyboardControls, enableBoneControlForSkinnedAssets, enableHavokThinInstancePhysicsSync, enableMirroredMeshes, enableOrthographicCamera, enableSpatial, enableStereo, exponentialEase, getBoneByName, getByteFrequencyData, getByteTimeDomainData, getCameraPosition, getFloatFrequencyData, getFloatTimeDomainData, getMasterVolume, getPhysicsBodyAngularVelocity, getPhysicsBodyLinearVelocity, getProjectionMatrix, getVariantNames, getViewMatrix, getWhiteBalanceMatrix, goToFrame, hasDefaultInteractivityFlowInput, initializeCsg2Async, invertMat4, loadBabylon, loadBasisTexture2D, loadDdsEnvironment, loadEnvironment, loadGltf, loadHdrEnvironment, loadImageToArrayLayer, loadKtxTexture2D, loadSOG, loadSPZ, loadSplat, loadSpriteAtlas, loadTexture2D, markClusteredLightContainerDirty, multiplyMat4, multiplyPolarToRef, multiplySphericalToRef, normalizeInteractivityEventDataConfiguration, normalizeKhrInteractivityRuntimeValue, onBeforeRender, onPhysicsAfterStep, packMeshBlendingTag, parseNodeMaterialFromSnippet, parseNodeParticleSetFromSnippet, pauseAnimation, pauseSound, pauseStreamingSound, physicsRaycast, pickAsync, pickMeshesWithRay, playAnimation, playSound, playStreamingSound, polarFromVec2ToRef, polarToVec2ToRef, powerEase, preloadStreamingInstanceAsync, preloadStreamingInstancesAsync, quadraticEase, quarticEase, quinticEase, readStorageBufferAfterFrame, registerNodeParticleSet, registerScene, registerSceneWithShadowSupport, registerSpriteRenderer, registerUtilityLayer, releasePhysicsConstraint, releasePhysicsShape, removeAnimationGroup, removeFromScene, removePhysicsBody, requestHtmlTextureUpdate, resetVariant, resizeEngine, resolveCameraViewport, resumeSound, resumeStreamingSound, sampleCatmullRomSpline, sampleHermiteSpline, scalePolarToRef, scaleSphericalToRef, selectVariant, setAnimationAdditive, setBonePosition, setBoneRotationQuaternion, setBoneScaling, setBusVolume, setClipPlane, setEngineSize, setFog, setGeospatialOrientation, setMasterVolume, setMorphTargetWeights, setPhysicsBodyAngularVelocity, setPhysicsBodyLinearVelocity, setPhysicsBodyMassProperties, setPhysicsBodyMotionType, setPhysicsBodyPrestepType, setPhysicsBodyShape, setPhysicsGravity, setPhysicsShapeFilterCollideMask, setPhysicsShapeFilterMembershipMask, setPhysicsShapeIsTrigger, setPhysicsShapeMaterial, setPhysicsTimestep, setPositionGizmoLocalCoordinates, setRotationGizmoLocalCoordinates, setScaleGizmoLocalCoordinates, setShadowTaskCasterMeshes, setSoundSourceVolume, setSoundVolume, setSpatialListener, setSpatialListenerPosition, setSpatialOrientation, setSpatialPosition, setStereoPan, setStreamingSoundVolume, sineEase, sphericalFromVec3ToRef, sphericalToVec3ToRef, spriteBlendAdditive, spriteBlendAlpha, spriteBlendPremultiplied, startEngine, startParticleSystem, stepScene, stopAnimation, stopEngine, stopParticleSystem, stopSound, stopStreamingSound, submitComputeTasks, subtractPolarToRef, subtractSphericalToRef, syncParticleBillboard, temperatureTintToXyz, unlockAudioEngineAsync, unpackMeshBlendingTag, updateAnimationManager, updateBillboardSpriteIndex, updateDynamicTexture, updateHtmlTexture, updateSpatialAudio, updateSprite2DIndex, updateStorageBufferRange, updateTexture2DArrayFromPixels, updateTexture2DFromPixels, updateUniformBuffer, uploadImageToArrayLayer, whenHtmlTextureReady } from "@babylonjs/lite";
3
3
  //#region \0rolldown/runtime.js
4
4
  var __defProp = Object.defineProperty;
5
5
  var __exportAll = (all, no_symbols) => {
@@ -1127,6 +1127,13 @@ var AbstractEngine = class {
1127
1127
  return unsupported("AbstractEngine.setAlphaToCoverage", "Lite's alpha-to-coverage API is target-scoped; mapping BJS's engine-wide state requires a pipeline-owner lifecycle policy.");
1128
1128
  }
1129
1129
  /**
1130
+ * Babylon.js `engine.isOcclusionQueryVisible(query)` — Lite does not expose
1131
+ * occlusion-query allocation, render-pass encoding, or asynchronous result state.
1132
+ */
1133
+ isOcclusionQueryVisible(_query) {
1134
+ return unsupported("AbstractEngine.isOcclusionQueryVisible", "Lite has no occlusion-query subsystem; supporting this requires query allocation, render-pass encoding, and asynchronous result-lifetime policy.");
1135
+ }
1136
+ /**
1130
1137
  * Babylon.js `engine.updateTextureArrayLayerFromImageSource(texture, source, layer, invertY, premultiplyAlpha)`
1131
1138
  * — the engine extension that uploads a decoded image source into one layer of a 2D array
1132
1139
  * texture. Forwards to Babylon Lite's `uploadImageToArrayLayer`.
@@ -1256,6 +1263,605 @@ var NullEngine = class extends WebGPUEngine {
1256
1263
  }
1257
1264
  };
1258
1265
  //#endregion
1266
+ //#region src/compute/compute-shader.ts
1267
+ var nextComputeShaderId = 1;
1268
+ function sourceFrom(shaderPath) {
1269
+ if (typeof shaderPath === "object" && shaderPath.computeSource !== void 0) return shaderPath.computeSource;
1270
+ return unsupported("ComputeShader.constructor", "Lite's public compute factory accepts complete WGSL source. Babylon.js ShaderStore names, external .compute.fx paths, and DOM script-element lookup have no public Lite resolver.");
1271
+ }
1272
+ /** Babylon.js ComputeShader adapted to Lite's public buffer-backed compute graph. */
1273
+ var ComputeShader = class {
1274
+ _engine;
1275
+ _shaderPath;
1276
+ static Parse = ComputeShaderParse;
1277
+ uniqueId = nextComputeShaderId++;
1278
+ name;
1279
+ fastMode = false;
1280
+ onCompiled = null;
1281
+ onError = null;
1282
+ gpuTimeInFrame = void 0;
1283
+ triggerContextRebuild = false;
1284
+ _source;
1285
+ _bindings = /* @__PURE__ */ new Map();
1286
+ _shader = null;
1287
+ _bindingSet = null;
1288
+ _bindingsDirty = false;
1289
+ _shaderDirty = false;
1290
+ _compiled = false;
1291
+ constructor(name, _engine, _shaderPath, options = {}) {
1292
+ this._engine = _engine;
1293
+ this._shaderPath = _shaderPath;
1294
+ this.name = name;
1295
+ this._options = {
1296
+ bindingsMapping: {},
1297
+ defines: [],
1298
+ entryPoint: "main",
1299
+ ...options
1300
+ };
1301
+ if (this._options.defines?.length) unsupported("ComputeShader.constructor(options.defines)", "Lite's public compute factory accepts final WGSL and intentionally exposes no Babylon.js shader preprocessor for #define expansion.");
1302
+ const source = sourceFrom(this._shaderPath);
1303
+ this._source = this._options.processFinalCode?.(source) ?? source;
1304
+ }
1305
+ _options;
1306
+ get options() {
1307
+ return this._options;
1308
+ }
1309
+ get shaderPath() {
1310
+ return this._shaderPath;
1311
+ }
1312
+ getClassName() {
1313
+ return "ComputeShader";
1314
+ }
1315
+ setTexture(_name, _texture, _bindSampler = true) {
1316
+ return unsupported("ComputeShader.setTexture", "Lite validates an existing Texture2D for compute through the asynchronous createComputeTextureResource API, which cannot preserve Babylon.js's synchronous setter and dispatch contract.");
1317
+ }
1318
+ setInternalTexture(_name, _texture) {
1319
+ return unsupported("ComputeShader.setInternalTexture", "Lite intentionally does not expose raw GPU texture handles, and its public compute texture adapter is asynchronous.");
1320
+ }
1321
+ setStorageTexture(_name, _texture) {
1322
+ return unsupported("ComputeShader.setStorageTexture", "A Babylon.js BaseTexture does not carry the storage usage, format, and access metadata required by Lite's distinct ComputeStorageTexture public resource.");
1323
+ }
1324
+ setExternalTexture(_name, _texture) {
1325
+ return unsupported("ComputeShader.setExternalTexture", "Lite's public compute binding API has no external-texture binding declaration or resource.");
1326
+ }
1327
+ setVideoTexture(_name, _texture) {
1328
+ return false;
1329
+ }
1330
+ setUniformBuffer(name, buffer) {
1331
+ const resource = "_getLiteBuffer" in buffer ? buffer._getLiteBuffer() : buffer;
1332
+ const current = this._bindings.get(name);
1333
+ if (current?.kind === "uniform" && current.resource === resource) return;
1334
+ this._bindingsDirty = true;
1335
+ this._shaderDirty ||= this._shader !== null && (current === void 0 || current.kind !== "uniform");
1336
+ this._bindings.set(name, {
1337
+ kind: "uniform",
1338
+ resource
1339
+ });
1340
+ }
1341
+ setStorageBuffer(name, buffer) {
1342
+ const resource = "_getLiteBuffer" in buffer ? buffer._getLiteBuffer() : buffer;
1343
+ const current = this._bindings.get(name);
1344
+ if (current?.kind === "storage" && current.resource === resource) return;
1345
+ this._bindingsDirty = true;
1346
+ this._shaderDirty ||= this._shader !== null && (current === void 0 || current.kind !== "storage");
1347
+ this._bindings.set(name, {
1348
+ kind: "storage",
1349
+ resource
1350
+ });
1351
+ }
1352
+ setTextureSampler(_name, _sampler) {
1353
+ return unsupported("ComputeShader.setTextureSampler", "Babylon.js TextureSampler does not expose a Lite ComputeSampler, and Lite intentionally does not accept raw GPUSampler handles.");
1354
+ }
1355
+ isReady() {
1356
+ if (!this._engine._lite) return false;
1357
+ for (const name of this._bindings.keys()) if (!this._options.bindingsMapping[name]) throw new Error(`ComputeShader ('${this.name}'): No binding mapping has been provided for the property '${name}'`);
1358
+ if (this._bindingsDirty) {
1359
+ this._invalidateBindings(this._shaderDirty);
1360
+ this._bindingsDirty = false;
1361
+ this._shaderDirty = false;
1362
+ }
1363
+ this._createGraph();
1364
+ return true;
1365
+ }
1366
+ dispatch(x, y = 1, z = 1) {
1367
+ const checkContext = !this.fastMode || this.triggerContextRebuild || !this._shader || !this._bindingSet;
1368
+ if (this.triggerContextRebuild) this._bindingsDirty = true;
1369
+ if (checkContext && !this.isReady()) return false;
1370
+ const graph = this._createGraph();
1371
+ const dispatch = createComputeDispatch(graph.shader, graph.bindings, { size: {
1372
+ x,
1373
+ y,
1374
+ z
1375
+ } });
1376
+ this._submit(graph, dispatch);
1377
+ return true;
1378
+ }
1379
+ dispatchIndirect(buffer, offset = 0) {
1380
+ const checkContext = !this.fastMode || this.triggerContextRebuild || !this._shader || !this._bindingSet;
1381
+ if (this.triggerContextRebuild) this._bindingsDirty = true;
1382
+ if (checkContext && !this.isReady()) return false;
1383
+ const resource = "_getLiteBuffer" in buffer ? buffer._getLiteBuffer() : buffer;
1384
+ const graph = this._createGraph();
1385
+ const dispatch = createComputeIndirectDispatch(graph.shader, graph.bindings, {
1386
+ buffer: resource,
1387
+ byteOffset: offset
1388
+ });
1389
+ this._submit(graph, dispatch);
1390
+ return true;
1391
+ }
1392
+ async dispatchWhenReady(x, y = 1, z = 1, delay = 10) {
1393
+ while (!this.dispatch(x, y, z)) await new Promise((resolve) => setTimeout(resolve, delay));
1394
+ }
1395
+ serialize() {
1396
+ return {
1397
+ name: this.name,
1398
+ fastMode: this.fastMode,
1399
+ options: this._options,
1400
+ shaderPath: this._shaderPath,
1401
+ bindings: {},
1402
+ textures: {}
1403
+ };
1404
+ }
1405
+ _createGraph() {
1406
+ const shader = this._createShader();
1407
+ let compiledNow = false;
1408
+ if (!this._compiled) {
1409
+ this._compiled = true;
1410
+ compiledNow = true;
1411
+ this.onCompiled?.(shader);
1412
+ }
1413
+ if (compiledNow && this._bindingsDirty) {
1414
+ const recreateShader = this._shaderDirty;
1415
+ this._invalidateBindings(recreateShader);
1416
+ this._bindingsDirty = false;
1417
+ this._shaderDirty = false;
1418
+ const finalShader = recreateShader ? this._createShader() : shader;
1419
+ this._compiled = true;
1420
+ return {
1421
+ shader: finalShader,
1422
+ bindings: this._createBindingSet(finalShader)
1423
+ };
1424
+ }
1425
+ return {
1426
+ shader,
1427
+ bindings: this._createBindingSet(shader)
1428
+ };
1429
+ }
1430
+ _createShader() {
1431
+ const declarations = [];
1432
+ for (const [name, binding] of this._bindings) {
1433
+ const location = this._options.bindingsMapping[name];
1434
+ if (!location) throw new Error(`ComputeShader ('${this.name}'): No binding mapping has been provided for the property '${name}'`);
1435
+ declarations.push(binding.kind === "uniform" ? computeUniformBufferBinding(name, location) : computeStorageBufferBinding(name, {
1436
+ ...location,
1437
+ access: this._options.useExplicitComputePipelineLayout === true ? "read-write" : "read"
1438
+ }));
1439
+ }
1440
+ return this._shader ??= createComputeShader(this._engine._lite, {
1441
+ name: this.name,
1442
+ computeSource: this._source,
1443
+ entryPoint: this._options.entryPoint,
1444
+ bindings: declarations,
1445
+ automaticLayout: this._options.useExplicitComputePipelineLayout !== true
1446
+ });
1447
+ }
1448
+ _createBindingSet(shader) {
1449
+ if (!this._bindingSet) {
1450
+ const resources = {};
1451
+ for (const [name, binding] of this._bindings) resources[name] = binding.resource;
1452
+ this._bindingSet = createComputeBindingSet(shader, resources);
1453
+ }
1454
+ return this._bindingSet;
1455
+ }
1456
+ _submit(graph, dispatch) {
1457
+ const task = createComputeTask(this._engine._lite, this.name);
1458
+ addComputeDispatch(task, dispatch);
1459
+ task.record();
1460
+ try {
1461
+ submitComputeTasks([task]);
1462
+ } catch (error) {
1463
+ if (error instanceof Error && error.message === "submitComputeTasks cannot run while a frame is being recorded.") return unsupported("ComputeShader.dispatch", "Lite's public immediate compute submission cannot run while its frame encoder is active, and it exposes no engine-level hook equivalent to Babylon.js's in-frame compute dispatch.");
1464
+ this.onError?.(graph.shader, error instanceof Error ? error.message : String(error));
1465
+ throw error;
1466
+ } finally {
1467
+ task.dispose();
1468
+ this.triggerContextRebuild = false;
1469
+ }
1470
+ }
1471
+ _invalidateBindings(recreateShader = false) {
1472
+ if (this._bindingSet) {
1473
+ disposeComputeBindingSet(this._bindingSet);
1474
+ this._bindingSet = null;
1475
+ }
1476
+ if (recreateShader && this._shader) {
1477
+ disposeComputeShader(this._shader);
1478
+ this._shader = null;
1479
+ this._compiled = false;
1480
+ }
1481
+ }
1482
+ };
1483
+ function ComputeShaderParse(source, scene, _rootUrl) {
1484
+ if (source.textures && Object.keys(source.textures).length > 0) return unsupported("ComputeShader.Parse", "Serialized Babylon.js textures require its texture parser, while Lite's public compute texture adapter is asynchronous and has no serialization registry.");
1485
+ const computeShader = new ComputeShader(String(source.name ?? ""), scene.getEngine(), source.shaderPath, source.options ?? {});
1486
+ computeShader.fastMode = source.fastMode === true;
1487
+ return computeShader;
1488
+ }
1489
+ function RegisterComputeShader() {}
1490
+ //#endregion
1491
+ //#region src/buffers/storage-buffer.ts
1492
+ function asBytes(data, byteLength) {
1493
+ let bytes;
1494
+ if (Array.isArray(data)) bytes = new Uint8Array(new Float32Array(data).buffer);
1495
+ else if (ArrayBuffer.isView(data)) bytes = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
1496
+ else bytes = new Uint8Array(data);
1497
+ if (byteLength === void 0) return bytes;
1498
+ if (!Number.isSafeInteger(byteLength) || byteLength < 0 || byteLength > bytes.byteLength) throw new RangeError(`StorageBuffer byteLength must be between 0 and ${bytes.byteLength}; received ${byteLength}.`);
1499
+ return bytes.subarray(0, byteLength);
1500
+ }
1501
+ /** Babylon.js-shaped wrapper over Lite's public opaque storage allocation. */
1502
+ var StorageBuffer = class {
1503
+ _engine;
1504
+ /** @internal */
1505
+ _lite;
1506
+ _copyReadable;
1507
+ _copyWritable;
1508
+ constructor(_engine, size, creationFlags = 3, label) {
1509
+ this._engine = _engine;
1510
+ if ((creationFlags & 4) !== 0) unsupported("StorageBuffer.constructor", "Babylon.js can combine storage and uniform usage on one DataBuffer, while Babylon Lite intentionally exposes distinct opaque StorageBuffer and UniformBuffer allocations.");
1511
+ this._copyReadable = (creationFlags & 1) !== 0;
1512
+ this._copyWritable = (creationFlags & 2) !== 0;
1513
+ this._lite = createStorageBuffer(_engine._lite, size, {
1514
+ label,
1515
+ writable: true,
1516
+ vertex: (creationFlags & 8) !== 0,
1517
+ index: (creationFlags & 16) !== 0,
1518
+ indirect: (creationFlags & 64) !== 0
1519
+ });
1520
+ }
1521
+ /** @internal Lite owns device-loss resource rebuilding. */
1522
+ _rebuild() {}
1523
+ getBuffer() {
1524
+ return this._lite;
1525
+ }
1526
+ clear(byteOffset = 0, byteLength = this._requireBuffer().byteLength - byteOffset) {
1527
+ this._assertCopyWritable("clear");
1528
+ const buffer = this._requireBuffer();
1529
+ if (!Number.isSafeInteger(byteOffset) || byteOffset < 0 || !Number.isSafeInteger(byteLength) || byteLength < 0 || byteOffset + byteLength > buffer.byteLength) throw new RangeError(`StorageBuffer.clear range [${byteOffset}, ${byteOffset + byteLength}) exceeds the ${buffer.byteLength}-byte buffer.`);
1530
+ clearStorageBuffer(this._engine._lite, buffer, byteOffset, byteLength);
1531
+ }
1532
+ update(data, byteOffset = 0, byteLength) {
1533
+ if (!this._lite) return;
1534
+ this._assertCopyWritable("update");
1535
+ updateStorageBufferRange(this._engine._lite, this._lite, asBytes(data, byteLength), byteOffset);
1536
+ }
1537
+ async read(offset = 0, size = this._requireBuffer().byteLength - offset, buffer, noDelay = false) {
1538
+ if (!this._copyReadable) throw new Error("StorageBuffer.read requires Constants.BUFFER_CREATIONFLAG_READ.");
1539
+ const result = await readStorageBufferAfterFrame(this._requireBuffer(), offset, size, noDelay);
1540
+ const bytes = new Uint8Array(result);
1541
+ if (!buffer) return bytes;
1542
+ if (buffer.byteLength < bytes.byteLength) throw new RangeError(`StorageBuffer.read target has ${buffer.byteLength} bytes but ${bytes.byteLength} bytes were requested.`);
1543
+ new Uint8Array(buffer.buffer, buffer.byteOffset, bytes.byteLength).set(bytes);
1544
+ return buffer;
1545
+ }
1546
+ dispose() {
1547
+ if (this._lite) {
1548
+ disposeStorageBuffer(this._lite);
1549
+ this._lite = null;
1550
+ }
1551
+ }
1552
+ /** @internal */
1553
+ _getLiteBuffer() {
1554
+ return this._requireBuffer();
1555
+ }
1556
+ _requireBuffer() {
1557
+ if (!this._lite) throw new Error("StorageBuffer has been disposed.");
1558
+ return this._lite;
1559
+ }
1560
+ _assertCopyWritable(operation) {
1561
+ if (!this._copyWritable) throw new Error(`StorageBuffer.${operation} requires Constants.BUFFER_CREATIONFLAG_WRITE.`);
1562
+ }
1563
+ };
1564
+ //#endregion
1565
+ //#region src/materials/uniform-buffer.ts
1566
+ /** Minimum Babylon.js UniformBuffer surface needed to author compute bindings. */
1567
+ var UniformBuffer = class {
1568
+ _engine;
1569
+ _data;
1570
+ _dynamic;
1571
+ _uniformLocations = /* @__PURE__ */ new Map();
1572
+ _uniformSizes = /* @__PURE__ */ new Map();
1573
+ _uniformArraySizes = /* @__PURE__ */ new Map();
1574
+ _uniformNames = [];
1575
+ _uniformLocationPointer = 0;
1576
+ _bufferData = null;
1577
+ _buffer = null;
1578
+ _needSync = false;
1579
+ _name;
1580
+ constructor(_engine, data = [], dynamic = false, name = "no-name", forceNoUniformBuffer = false, _trackUBOsInFrame) {
1581
+ this._engine = _engine;
1582
+ if (forceNoUniformBuffer) unsupported("UniformBuffer.constructor", "A forceNoUniformBuffer instance falls back to Effect setters in Babylon.js and therefore has no GPU uniform allocation that Lite compute bindings can consume.");
1583
+ this._data = data;
1584
+ this._dynamic = dynamic;
1585
+ this._name = name;
1586
+ }
1587
+ updateMatrix3x3 = (name, matrix) => {
1588
+ const aligned = /* @__PURE__ */ new Float32Array(12);
1589
+ for (let column = 0; column < 3; column++) aligned.set(matrix.subarray(column * 3, column * 3 + 3), column * 4);
1590
+ this.updateUniform(name, aligned, 12);
1591
+ };
1592
+ updateMatrix2x2 = (name, matrix) => {
1593
+ const aligned = /* @__PURE__ */ new Float32Array(8);
1594
+ for (let column = 0; column < 2; column++) aligned.set(matrix.subarray(column * 2, column * 2 + 2), column * 4);
1595
+ this.updateUniform(name, aligned, 8);
1596
+ };
1597
+ updateFloat = (name, x, _suffix) => this.updateUniform(name, [x], 1);
1598
+ updateFloat2 = (name, x, y, _suffix) => this.updateUniform(name, [x, y], 2);
1599
+ updateFloat3 = (name, x, y, z, _suffix) => this.updateUniform(name, [
1600
+ x,
1601
+ y,
1602
+ z
1603
+ ], 3);
1604
+ updateFloat4 = (name, x, y, z, w, _suffix) => this.updateUniform(name, [
1605
+ x,
1606
+ y,
1607
+ z,
1608
+ w
1609
+ ], 4);
1610
+ updateFloatArray = (name, array, _suffix) => this.updateUniformArray(name, array, array.length);
1611
+ updateArray = (name, array) => this.updateUniformArray(name, array, array.length);
1612
+ updateIntArray = (name, array) => this._updateIntegerUniformArray(name, array, false);
1613
+ updateUIntArray = (name, array) => this._updateIntegerUniformArray(name, array, true);
1614
+ updateMatrix = (name, matrix) => this.updateUniform(name, Array.from(matrix.asArray()), 16);
1615
+ updateMatrices = (name, matrices) => this.updateUniform(name, matrices, matrices.length);
1616
+ updateVector3 = (name, vector) => this.updateFloat3(name, vector.x, vector.y, vector.z);
1617
+ updateVector4 = (name, vector) => this.updateFloat4(name, vector.x, vector.y, vector.z, vector.w);
1618
+ updateColor3 = (name, color, suffix) => this.updateFloat3(name, color.r, color.g, color.b, suffix);
1619
+ updateColor4 = (name, color, alpha, suffix) => this.updateFloat4(name, color.r, color.g, color.b, alpha, suffix);
1620
+ updateDirectColor4 = (name, color, suffix) => this.updateFloat4(name, color.r, color.g, color.b, color.a, suffix);
1621
+ updateInt = (name, x, _suffix) => this._updateIntegerUniform(name, [x], false);
1622
+ updateInt2 = (name, x, y, _suffix) => this._updateIntegerUniform(name, [x, y], false);
1623
+ updateInt3 = (name, x, y, z, _suffix) => this._updateIntegerUniform(name, [
1624
+ x,
1625
+ y,
1626
+ z
1627
+ ], false);
1628
+ updateInt4 = (name, x, y, z, w, _suffix) => this._updateIntegerUniform(name, [
1629
+ x,
1630
+ y,
1631
+ z,
1632
+ w
1633
+ ], false);
1634
+ updateUInt = (name, x, _suffix) => this._updateIntegerUniform(name, [x], true);
1635
+ updateUInt2 = (name, x, y, _suffix) => this._updateIntegerUniform(name, [x, y], true);
1636
+ updateUInt3 = (name, x, y, z, _suffix) => this._updateIntegerUniform(name, [
1637
+ x,
1638
+ y,
1639
+ z
1640
+ ], true);
1641
+ updateUInt4 = (name, x, y, z, w, _suffix) => this._updateIntegerUniform(name, [
1642
+ x,
1643
+ y,
1644
+ z,
1645
+ w
1646
+ ], true);
1647
+ get useUbo() {
1648
+ return true;
1649
+ }
1650
+ get isSync() {
1651
+ return !this._needSync;
1652
+ }
1653
+ isDynamic() {
1654
+ return this._dynamic;
1655
+ }
1656
+ getData() {
1657
+ return this._bufferData ?? new Float32Array(this._data);
1658
+ }
1659
+ getBuffer() {
1660
+ return this._buffer;
1661
+ }
1662
+ getUniformNames() {
1663
+ return this._uniformNames.slice();
1664
+ }
1665
+ addUniform(name, sizeOrData, arraySize = 0) {
1666
+ if (this._uniformLocations.has(name)) return;
1667
+ if (this._buffer) throw new Error(`Cannot add uniform "${name}" after the UniformBuffer has been created.`);
1668
+ this._uniformNames.push(name);
1669
+ let size;
1670
+ let data;
1671
+ if (arraySize > 0) {
1672
+ if (typeof sizeOrData !== "number") throw new TypeError(`addUniform cannot use inline array data for UBO array "${name}".`);
1673
+ this._align(4);
1674
+ this._uniformArraySizes.set(name, {
1675
+ strideSize: sizeOrData,
1676
+ arraySize
1677
+ });
1678
+ size = sizeOrData === 16 ? sizeOrData * arraySize : 4 * arraySize;
1679
+ data = new Array(size).fill(0);
1680
+ } else {
1681
+ data = typeof sizeOrData === "number" ? new Array(sizeOrData).fill(0) : sizeOrData.slice();
1682
+ size = data.length;
1683
+ this._align(size);
1684
+ }
1685
+ this._uniformLocations.set(name, this._uniformLocationPointer);
1686
+ this._uniformSizes.set(name, size);
1687
+ this._uniformLocationPointer += size;
1688
+ this._data.push(...data);
1689
+ this._needSync = true;
1690
+ }
1691
+ addMatrix(name, matrix) {
1692
+ this.addUniform(name, Array.from(matrix.asArray()));
1693
+ }
1694
+ addFloat2(name, x, y) {
1695
+ this.addUniform(name, [x, y]);
1696
+ }
1697
+ addFloat3(name, x, y, z) {
1698
+ this.addUniform(name, [
1699
+ x,
1700
+ y,
1701
+ z
1702
+ ]);
1703
+ }
1704
+ addColor3(name, color) {
1705
+ this.addUniform(name, [
1706
+ color.r,
1707
+ color.g,
1708
+ color.b
1709
+ ]);
1710
+ }
1711
+ addColor4(name, color, alpha) {
1712
+ this.addUniform(name, [
1713
+ color.r,
1714
+ color.g,
1715
+ color.b,
1716
+ alpha
1717
+ ]);
1718
+ }
1719
+ addVector3(name, vector) {
1720
+ this.addUniform(name, [
1721
+ vector.x,
1722
+ vector.y,
1723
+ vector.z
1724
+ ]);
1725
+ }
1726
+ addMatrix3x3(name) {
1727
+ this.addUniform(name, 12);
1728
+ }
1729
+ addMatrix2x2(name) {
1730
+ this.addUniform(name, 8);
1731
+ }
1732
+ create() {
1733
+ if (this._buffer) return;
1734
+ this._align(4);
1735
+ this._bufferData = new Float32Array(this._data);
1736
+ this._buffer = createUniformBuffer(this._engine._lite, this._bufferData, { label: `${this._name}_UniformList:${this._uniformNames.slice(0, 10).join(",")}` });
1737
+ this._needSync = true;
1738
+ }
1739
+ /** @internal */
1740
+ _getLiteBuffer() {
1741
+ this.create();
1742
+ return this._buffer;
1743
+ }
1744
+ get name() {
1745
+ return this._name;
1746
+ }
1747
+ set name(value) {
1748
+ this._name = value;
1749
+ }
1750
+ get currentEffect() {
1751
+ return null;
1752
+ }
1753
+ update() {
1754
+ this.create();
1755
+ if (this._dynamic || this._needSync) {
1756
+ updateUniformBuffer(this._engine._lite, this._buffer, this._bufferData);
1757
+ this._needSync = false;
1758
+ }
1759
+ }
1760
+ updateUniform(uniformName, data, size) {
1761
+ let location = this._uniformLocations.get(uniformName);
1762
+ if (location === void 0) {
1763
+ this.addUniform(uniformName, size);
1764
+ location = this._uniformLocations.get(uniformName);
1765
+ }
1766
+ this.create();
1767
+ if (size > (this._uniformSizes.get(uniformName) ?? 0)) throw new RangeError(`Uniform "${uniformName}" has room for ${this._uniformSizes.get(uniformName)} floats, not ${size}.`);
1768
+ for (let i = 0; i < size; i++) {
1769
+ const value = Math.fround(data[i]);
1770
+ if (this._bufferData[location + i] !== value) {
1771
+ this._bufferData[location + i] = value;
1772
+ this._needSync = true;
1773
+ }
1774
+ }
1775
+ }
1776
+ updateUniformArray(uniformName, data, size) {
1777
+ const location = this._uniformLocations.get(uniformName);
1778
+ const layout = this._uniformArraySizes.get(uniformName);
1779
+ if (location === void 0 || !layout) throw new Error(`Uniform array "${uniformName}" must be declared with addUniform before it can be updated.`);
1780
+ this.create();
1781
+ if (size > layout.strideSize * layout.arraySize) throw new RangeError(`Uniform array "${uniformName}" accepts at most ${layout.strideSize * layout.arraySize} values, not ${size}.`);
1782
+ for (let i = 0; i < size; i++) {
1783
+ const destination = location + Math.floor(i / layout.strideSize) * 4 + i % layout.strideSize;
1784
+ const value = Math.fround(data[i]);
1785
+ if (this._bufferData[destination] !== value) {
1786
+ this._bufferData[destination] = value;
1787
+ this._needSync = true;
1788
+ }
1789
+ }
1790
+ }
1791
+ setTexture(_name, _texture) {
1792
+ return unsupported("UniformBuffer.setTexture", "Lite compute uniform allocations contain bytes only and do not own Effect sampler bindings.");
1793
+ }
1794
+ setTextureArray(_name, _textures) {
1795
+ return unsupported("UniformBuffer.setTextureArray", "Lite compute uniform allocations contain bytes only and do not own Effect sampler bindings.");
1796
+ }
1797
+ bindTexture(_name, _texture) {
1798
+ return unsupported("UniformBuffer.bindTexture", "Lite compute uniform allocations contain bytes only and do not own Effect sampler bindings.");
1799
+ }
1800
+ updateUniformDirectly(uniformName, data) {
1801
+ const size = this._uniformSizes.get(uniformName);
1802
+ if (size === void 0) throw new Error(`Uniform "${uniformName}" has not been declared.`);
1803
+ this.updateUniform(uniformName, data, Math.min(size, data.length));
1804
+ this.update();
1805
+ }
1806
+ bindToEffect(_effect, _name) {
1807
+ return unsupported("UniformBuffer.bindToEffect", "The compute-only compat UniformBuffer forwards to Lite's opaque compute allocation; Lite has no Babylon.js Effect binding surface.");
1808
+ }
1809
+ bindUniformBuffer() {
1810
+ return unsupported("UniformBuffer.bindUniformBuffer", "The compute-only compat UniformBuffer is bound through ComputeShader.setUniformBuffer.");
1811
+ }
1812
+ unbindEffect() {}
1813
+ setDataBuffer(dataBuffer) {
1814
+ return this._buffer === dataBuffer;
1815
+ }
1816
+ has(name) {
1817
+ return this._uniformLocations.has(name);
1818
+ }
1819
+ dispose() {
1820
+ if (this._buffer) {
1821
+ disposeUniformBuffer(this._buffer);
1822
+ this._buffer = null;
1823
+ }
1824
+ }
1825
+ _align(size) {
1826
+ const alignment = size <= 2 ? size : 4;
1827
+ if (alignment > 0 && this._uniformLocationPointer % alignment !== 0) {
1828
+ const padding = alignment - this._uniformLocationPointer % alignment;
1829
+ this._data.push(...new Array(padding).fill(0));
1830
+ this._uniformLocationPointer += padding;
1831
+ }
1832
+ }
1833
+ _updateIntegerUniform(uniformName, data, unsigned) {
1834
+ let location = this._uniformLocations.get(uniformName);
1835
+ if (location === void 0) {
1836
+ this.addUniform(uniformName, data.length);
1837
+ location = this._uniformLocations.get(uniformName);
1838
+ }
1839
+ this.create();
1840
+ if (data.length > (this._uniformSizes.get(uniformName) ?? 0)) throw new RangeError(`Uniform "${uniformName}" has room for ${this._uniformSizes.get(uniformName)} values, not ${data.length}.`);
1841
+ const view = unsigned ? new Uint32Array(this._bufferData.buffer) : new Int32Array(this._bufferData.buffer);
1842
+ for (let i = 0; i < data.length; i++) this._setInteger(view, location + i, data[i], unsigned);
1843
+ }
1844
+ _updateIntegerUniformArray(uniformName, data, unsigned) {
1845
+ const location = this._uniformLocations.get(uniformName);
1846
+ const layout = this._uniformArraySizes.get(uniformName);
1847
+ if (location === void 0 || !layout) throw new Error(`Uniform array "${uniformName}" must be declared with addUniform before it can be updated.`);
1848
+ this.create();
1849
+ if (data.length > layout.strideSize * layout.arraySize) throw new RangeError(`Uniform array "${uniformName}" accepts at most ${layout.strideSize * layout.arraySize} values, not ${data.length}.`);
1850
+ const view = unsigned ? new Uint32Array(this._bufferData.buffer) : new Int32Array(this._bufferData.buffer);
1851
+ for (let i = 0; i < data.length; i++) {
1852
+ const destination = location + Math.floor(i / layout.strideSize) * 4 + i % layout.strideSize;
1853
+ this._setInteger(view, destination, data[i], unsigned);
1854
+ }
1855
+ }
1856
+ _setInteger(view, index, input, unsigned) {
1857
+ const value = unsigned ? input >>> 0 : input | 0;
1858
+ if (view[index] !== value) {
1859
+ view[index] = value;
1860
+ this._needSync = true;
1861
+ }
1862
+ }
1863
+ };
1864
+ //#endregion
1259
1865
  //#region src/scene/abstract-scene.ts
1260
1866
  var AbstractScene = class {
1261
1867
  /**
@@ -2931,10 +3537,10 @@ var AnaglyphArcRotateCamera = class {
2931
3537
  * Babylon.js-compatible `Animation` keyframe model + `AnimationGroup`.
2932
3538
  *
2933
3539
  * `Animation` is a pure-JS keyframe container with CPU evaluation (`evaluate`),
2934
- * the Babylon.js data-type / loop-mode constants, and `setKeys`/`getKeys`. This
2935
- * is fully testable without a GPU. `AnimationGroup` provides the structural
2936
- * grouping/playback-state surface; frame-accurate playback is driven through the
2937
- * native Babylon Lite animation manager when wired to a scene (not modelled here).
3540
+ * the Babylon.js data-type / loop-mode constants, and `setKeys`/`getKeys`. Common
3541
+ * direct-animation tracks are compiled onto Babylon Lite property groups; the CPU
3542
+ * evaluator remains as an explicit fallback for shapes Lite cannot yet preserve.
3543
+ * `AnimationGroup` provides the structural grouping/playback-state surface.
2938
3544
  */
2939
3545
  /**
2940
3546
  * Babylon.js `AnimationKeyInterpolation` — how the segment starting at a key is
@@ -2969,10 +3575,13 @@ var Animation = class Animation {
2969
3575
  static ANIMATIONTYPE_QUATERNION = AnimationTypes.ANIMATIONTYPE_QUATERNION;
2970
3576
  static ANIMATIONTYPE_MATRIX = AnimationTypes.ANIMATIONTYPE_MATRIX;
2971
3577
  static ANIMATIONTYPE_COLOR3 = AnimationTypes.ANIMATIONTYPE_COLOR3;
3578
+ static ANIMATIONTYPE_VECTOR2 = AnimationTypes.ANIMATIONTYPE_VECTOR2;
3579
+ static ANIMATIONTYPE_COLOR4 = AnimationTypes.ANIMATIONTYPE_COLOR4;
2972
3580
  static ANIMATIONLOOPMODE_RELATIVE = AnimationLoopModes.ANIMATIONLOOPMODE_RELATIVE;
2973
3581
  static ANIMATIONLOOPMODE_CYCLE = AnimationLoopModes.ANIMATIONLOOPMODE_CYCLE;
2974
3582
  static ANIMATIONLOOPMODE_CONSTANT = AnimationLoopModes.ANIMATIONLOOPMODE_CONSTANT;
2975
3583
  _keys = [];
3584
+ _easingFunction = null;
2976
3585
  constructor(name, targetProperty, framePerSecond, dataType = AnimationTypes.ANIMATIONTYPE_FLOAT, loopMode = AnimationLoopModes.ANIMATIONLOOPMODE_CYCLE) {
2977
3586
  this.name = name;
2978
3587
  this.targetProperty = targetProperty;
@@ -2989,7 +3598,21 @@ var Animation = class Animation {
2989
3598
  getHighestFrame() {
2990
3599
  return this._keys.length > 0 ? this._keys[this._keys.length - 1].frame : 0;
2991
3600
  }
2992
- /** Linearly evaluate the animated value at `frame` (clamped to the key range). */
3601
+ /**
3602
+ * Assigns the easing function used to transform each non-STEP segment's normalized progress.
3603
+ * @param easingFunction - A Babylon.js-shaped easing object, or `null` to restore linear progress.
3604
+ */
3605
+ setEasingFunction(easingFunction) {
3606
+ this._easingFunction = easingFunction;
3607
+ }
3608
+ /**
3609
+ * Gets the easing function currently assigned to this animation.
3610
+ * @returns The assigned easing object, or `null` when interpolation uses linear progress.
3611
+ */
3612
+ getEasingFunction() {
3613
+ return this._easingFunction;
3614
+ }
3615
+ /** Evaluate the animated value at `frame`, clamped to the key range. */
2993
3616
  evaluate(frame) {
2994
3617
  const keys = this._keys;
2995
3618
  if (keys.length === 0) return 0;
@@ -3000,8 +3623,8 @@ var Animation = class Animation {
3000
3623
  const b = keys[i + 1];
3001
3624
  if (frame >= a.frame && frame < b.frame) {
3002
3625
  if (a.interpolation === AnimationKeyInterpolation.STEP) return a.value;
3003
- const t = (frame - a.frame) / (b.frame - a.frame);
3004
- return lerpValue(a.value, b.value, t);
3626
+ const gradient = (frame - a.frame) / (b.frame - a.frame);
3627
+ return interpolateValue(a.value, b.value, this._easingFunction?.ease(gradient) ?? gradient, this.dataType);
3005
3628
  }
3006
3629
  }
3007
3630
  return keys[keys.length - 1].value;
@@ -3019,23 +3642,78 @@ var Animation = class Animation {
3019
3642
  return anim;
3020
3643
  }
3021
3644
  };
3022
- function lerpValue(a, b, t) {
3645
+ function interpolateValue(a, b, t, dataType) {
3023
3646
  if (typeof a === "number" && typeof b === "number") return a + (b - a) * t;
3024
- const av = a;
3025
- const bv = b;
3026
- return av.map((value, i) => value + ((bv[i] ?? value) - value) * t);
3647
+ if (typeof a === "number" || typeof b === "number") return a;
3648
+ const stride = supportedStride(dataType) || animationComponents(a).length;
3649
+ const av = readAnimationComponents(a, stride);
3650
+ const bv = readAnimationComponents(b, stride);
3651
+ if (!av || !bv) return a;
3652
+ return cloneAnimationValue(a, dataType === AnimationTypes.ANIMATIONTYPE_QUATERNION ? slerpQuaternion(av, bv, t) : av.map((value, i) => value + (bv[i] - value) * t));
3653
+ }
3654
+ function readAnimationComponents(value, stride) {
3655
+ if (typeof value === "number") return stride === 1 && Number.isFinite(value) ? [value] : void 0;
3656
+ const components = Array.isArray(value) ? value : value.asArray();
3657
+ return components.length === stride && components.every(Number.isFinite) ? components.slice() : void 0;
3658
+ }
3659
+ function animationComponents(value) {
3660
+ return typeof value === "number" ? [value] : Array.isArray(value) ? value : value.asArray();
3661
+ }
3662
+ function cloneAnimationValue(template, components) {
3663
+ if (Array.isArray(template)) return components;
3664
+ const clone = template.clone();
3665
+ const writable = clone;
3666
+ writable.x = components[0];
3667
+ writable.y = components[1];
3668
+ if (components.length > 2) writable.z = components[2];
3669
+ if (components.length > 3) writable.w = components[3];
3670
+ return clone;
3671
+ }
3672
+ function slerpQuaternion(a, b, gradient) {
3673
+ let bx = b[0];
3674
+ let by = b[1];
3675
+ let bz = b[2];
3676
+ let bw = b[3];
3677
+ let dot = a[0] * bx + a[1] * by + a[2] * bz + a[3] * bw;
3678
+ if (dot < 0) {
3679
+ bx = -bx;
3680
+ by = -by;
3681
+ bz = -bz;
3682
+ bw = -bw;
3683
+ dot = -dot;
3684
+ }
3685
+ if (dot > .999999) return [
3686
+ (1 - gradient) * a[0] + gradient * bx,
3687
+ (1 - gradient) * a[1] + gradient * by,
3688
+ (1 - gradient) * a[2] + gradient * bz,
3689
+ (1 - gradient) * a[3] + gradient * bw
3690
+ ];
3691
+ const angle = Math.acos(Math.min(dot, 1));
3692
+ const sine = Math.sin(angle);
3693
+ const startWeight = Math.sin((1 - gradient) * angle) / sine;
3694
+ const endWeight = Math.sin(gradient * angle) / sine;
3695
+ return [
3696
+ startWeight * a[0] + endWeight * bx,
3697
+ startWeight * a[1] + endWeight * by,
3698
+ startWeight * a[2] + endWeight * bz,
3699
+ startWeight * a[3] + endWeight * bw
3700
+ ];
3027
3701
  }
3028
3702
  function scaleValue(value, scale) {
3029
- return typeof value === "number" ? value * scale : value.map((v) => v * scale);
3703
+ if (typeof value === "number") return value * scale;
3704
+ return animationComponents(value).map((component) => component * scale);
3030
3705
  }
3031
3706
  function addValue(acc, value) {
3032
3707
  if (typeof acc === "number" && typeof value === "number") return acc + value;
3033
- const a = acc;
3034
- const v = value;
3035
- return a.map((x, i) => x + (v[i] ?? 0));
3708
+ const a = animationComponents(acc);
3709
+ const v = animationComponents(value);
3710
+ return a.map((component, i) => component + (v[i] ?? 0));
3711
+ }
3712
+ function subtractValue(value, base) {
3713
+ return addValue(value, scaleValue(base, -1));
3036
3714
  }
3037
3715
  function zeroLike(value) {
3038
- return typeof value === "number" ? 0 : value.map(() => 0);
3716
+ return typeof value === "number" ? 0 : animationComponents(value).map(() => 0);
3039
3717
  }
3040
3718
  /**
3041
3719
  * @internal Pre-animation baseline of each blended property, captured the first
@@ -3053,7 +3731,7 @@ function readPath(target, path) {
3053
3731
  obj = next;
3054
3732
  }
3055
3733
  const leaf = obj[parts[parts.length - 1]];
3056
- return typeof leaf === "number" ? leaf : 0;
3734
+ return isAnimationValue(leaf) ? leaf : 0;
3057
3735
  }
3058
3736
  function captureOriginal(target, path) {
3059
3737
  let perTarget = structuralOriginals.get(target);
@@ -3061,7 +3739,11 @@ function captureOriginal(target, path) {
3061
3739
  perTarget = /* @__PURE__ */ new Map();
3062
3740
  structuralOriginals.set(target, perTarget);
3063
3741
  }
3064
- if (!perTarget.has(path)) perTarget.set(path, readPath(target, path));
3742
+ if (!perTarget.has(path)) perTarget.set(path, snapshotValue(readPath(target, path)));
3743
+ }
3744
+ function snapshotValue(value) {
3745
+ if (typeof value === "number") return value;
3746
+ return cloneAnimationValue(value, animationComponents(value));
3065
3747
  }
3066
3748
  /** @internal Assign an animated value to `target` following a dotted property path (e.g. `"position.x"`). */
3067
3749
  function applyAnimatedValue(target, path, value) {
@@ -3073,75 +3755,371 @@ function applyAnimatedValue(target, path, value) {
3073
3755
  obj = next;
3074
3756
  }
3075
3757
  const leaf = parts[parts.length - 1];
3076
- if (Array.isArray(value)) {
3758
+ if (typeof value !== "number") {
3759
+ const components = animationComponents(value);
3077
3760
  const slot = obj[leaf];
3078
- if (slot && typeof slot.set === "function") slot.set(...value);
3761
+ if (slot && typeof slot.set === "function") slot.set(...components);
3079
3762
  else obj[leaf] = value;
3080
3763
  } else obj[leaf] = value;
3081
3764
  }
3765
+ function isAnimationValue(value) {
3766
+ return typeof value === "number" || Array.isArray(value) || isAnimationVectorValue(value);
3767
+ }
3768
+ function isAnimationVectorValue(value) {
3769
+ return (typeof value === "object" || typeof value === "function") && value !== null && typeof value.x === "number" && typeof value.y === "number" && typeof value.clone === "function" && typeof value.asArray === "function";
3770
+ }
3082
3771
  /**
3083
- * Babylon.js `Animatable` — a running animation on a target, driven per-frame on
3084
- * the CPU by evaluating each `Animation`'s keyframes and writing the result onto
3085
- * the target's (dotted) property path.
3772
+ * Babylon.js `Animatable` facade. Supported direct-animation tracks delegate to a
3773
+ * native Lite property group; unsupported tracks retain the compat CPU evaluator.
3086
3774
  */
3087
- var Animatable = class {
3775
+ var Animatable = class Animatable {
3088
3776
  _target;
3089
3777
  _animations;
3090
3778
  _from;
3091
3779
  _to;
3092
3780
  _loop;
3093
3781
  masterFrame = 0;
3094
- speedRatio;
3782
+ /** @internal Lite group backing a natively-delegated property animation. */
3783
+ _lite;
3784
+ /** @internal Reason all or part of this animatable retained the compat CPU evaluator. */
3785
+ _nativeFallbackReason;
3786
+ _speedRatio;
3095
3787
  _paused = false;
3096
3788
  _stopped = false;
3097
- constructor(_target, _animations, _from, _to, _loop, speedRatio) {
3789
+ _nativeManager;
3790
+ _fallbackAnimations;
3791
+ _fallbackFrames = /* @__PURE__ */ new Map();
3792
+ _fallbackElapsedFrames = /* @__PURE__ */ new Map();
3793
+ _fallbackRepeatCounts = /* @__PURE__ */ new Map();
3794
+ _completedFallbackAnimations = /* @__PURE__ */ new Set();
3795
+ constructor(_target, _animations, _from, _to, _loop, speedRatio, nativeState) {
3098
3796
  this._target = _target;
3099
3797
  this._animations = _animations;
3100
3798
  this._from = _from;
3101
3799
  this._to = _to;
3102
3800
  this._loop = _loop;
3103
- this.speedRatio = speedRatio;
3801
+ this._speedRatio = speedRatio;
3802
+ this._nativeManager = nativeState?.manager;
3803
+ this._lite = nativeState?.group;
3804
+ this._fallbackAnimations = nativeState?.fallbackAnimations ?? _animations;
3805
+ this._nativeFallbackReason = nativeState?.fallbackReason;
3104
3806
  this.masterFrame = _from;
3105
- this._apply();
3807
+ for (const animation of this._fallbackAnimations) this._resetFallbackAnimation(animation, _from);
3808
+ if (this._lite) {
3809
+ goToFrame(this._lite, _from);
3810
+ playAnimation(this._lite);
3811
+ }
3812
+ this._applyFallback();
3813
+ }
3814
+ /** @internal Create one facade over the native-supported and explicit fallback subsets. */
3815
+ static _create(getManager, target, animations, from, to, loop, speedRatio, blockedNativeBindings = []) {
3816
+ const partition = partitionAnimations(target, animations, from, to, speedRatio, blockedNativeBindings);
3817
+ const nativeManager = partition.nativeAnimations.length > 0 ? getManager() : void 0;
3818
+ const nativeGroup = nativeManager ? createNativeAnimationGroup(nativeManager, target, partition.nativeAnimations, from, to, loop, speedRatio) : void 0;
3819
+ return new Animatable(target, animations.slice(), from, to, loop, speedRatio, {
3820
+ manager: nativeManager,
3821
+ group: nativeGroup,
3822
+ fallbackAnimations: partition.fallbackAnimations,
3823
+ fallbackReason: partition.fallbackReasons.length > 0 ? partition.fallbackReasons.join("; ") : void 0
3824
+ });
3825
+ }
3826
+ /** @internal Return why any track cannot preserve its semantics on Lite, or undefined when all are supported. */
3827
+ static _getNativeFallbackReason(target, animations, from, to, speedRatio) {
3828
+ const reasons = partitionAnimations(target, animations, from, to, speedRatio, []).fallbackReasons;
3829
+ return reasons.length > 0 ? reasons.join("; ") : void 0;
3830
+ }
3831
+ /** @internal Return fallback bindings that must keep later overlapping writes on the same evaluator, including stopped animatables that may restart. */
3832
+ _getBlockingFallbackBindings() {
3833
+ return this._fallbackAnimations.map((animation) => resolveAnimationBinding(this._target, animation.targetProperty)).filter(isAnimationBinding);
3834
+ }
3835
+ get speedRatio() {
3836
+ return this._speedRatio;
3837
+ }
3838
+ set speedRatio(value) {
3839
+ if (this._lite && (!Number.isFinite(value) || value < 0)) throw new Error("Native compat property animations require a finite non-negative speedRatio");
3840
+ this._speedRatio = value;
3841
+ if (this._lite) this._lite.speedRatio = value;
3106
3842
  }
3107
3843
  /** @internal Advance the animation by `deltaMs`, called once per scene frame. */
3108
3844
  _tick(deltaMs) {
3109
3845
  if (this._paused || this._stopped) return;
3110
- const fps = this._animations[0]?.framePerSecond ?? 60;
3111
- this.masterFrame += deltaMs / 1e3 * fps * this.speedRatio;
3112
- if (this.masterFrame > this._to) {
3113
- if (this._loop) {
3114
- const span = this._to - this._from || 1;
3115
- this.masterFrame = this._from + (this.masterFrame - this._from) % span;
3116
- } else {
3117
- this.masterFrame = this._to;
3846
+ if (this._lite) {
3847
+ this.masterFrame = this._lite.currentTime * (this._animations[0]?.framePerSecond ?? 60);
3848
+ const fallbackRunning = this._advanceFallback(deltaMs);
3849
+ this._applyFallback();
3850
+ if (!this._loop && this._lite._stopped && !fallbackRunning) {
3851
+ this._detachLite();
3118
3852
  this._stopped = true;
3119
3853
  }
3854
+ return;
3120
3855
  }
3121
- this._apply();
3856
+ const anyFallbackRunning = this._advanceFallback(deltaMs);
3857
+ this.masterFrame = this._fallbackFrames.get(this._animations[0]) ?? this._from;
3858
+ this._applyFallback();
3859
+ if (!this._loop && !anyFallbackRunning) this._stopped = true;
3122
3860
  }
3123
3861
  goToFrame(frame) {
3124
- this.masterFrame = frame;
3125
- this._apply();
3862
+ this._completedFallbackAnimations.clear();
3863
+ for (const animation of this._fallbackAnimations) this._resetFallbackAnimation(animation, frame);
3864
+ if (this._lite) {
3865
+ goToFrame(this._lite, frame);
3866
+ this.masterFrame = this._lite.currentTime * (this._lite.frameRate ?? 60);
3867
+ if (!this._paused && !this._stopped) playAnimation(this._lite);
3868
+ } else this.masterFrame = clampAnimationFrame(this._animations[0], frame);
3869
+ this._applyFallback();
3126
3870
  }
3127
3871
  pause() {
3128
3872
  this._paused = true;
3873
+ if (this._lite) {
3874
+ pauseAnimation(this._lite);
3875
+ this._detachLite();
3876
+ }
3129
3877
  }
3130
3878
  restart() {
3879
+ const restartFromBeginning = this._stopped;
3131
3880
  this._paused = false;
3132
3881
  this._stopped = false;
3133
- this.masterFrame = this._from;
3882
+ if (restartFromBeginning) {
3883
+ this.masterFrame = this._from;
3884
+ this._completedFallbackAnimations.clear();
3885
+ for (const animation of this._fallbackAnimations) this._resetFallbackAnimation(animation, this._from);
3886
+ }
3887
+ if (this._lite) {
3888
+ if (restartFromBeginning) goToFrame(this._lite, this._from);
3889
+ this._attachLite();
3890
+ playAnimation(this._lite);
3891
+ }
3892
+ if (restartFromBeginning) this._applyFallback();
3134
3893
  }
3135
3894
  stop() {
3895
+ this._paused = false;
3136
3896
  this._stopped = true;
3897
+ if (this._lite) {
3898
+ stopAnimation(this._lite);
3899
+ this._detachLite();
3900
+ }
3137
3901
  }
3138
3902
  get animationStarted() {
3139
- return !this._stopped;
3903
+ return !this._paused && !this._stopped;
3140
3904
  }
3141
- _apply() {
3142
- for (const anim of this._animations) applyAnimatedValue(this._target, anim.targetProperty, anim.evaluate(this.masterFrame));
3905
+ _applyFallback() {
3906
+ for (const anim of this._fallbackAnimations) {
3907
+ const frame = this._fallbackFrames.get(anim) ?? this.masterFrame;
3908
+ let value = anim.evaluate(frame);
3909
+ if (this._loop) {
3910
+ const repeatCount = this._fallbackRepeatCounts.get(anim) ?? 0;
3911
+ const [, to] = animationPlaybackRange(anim, this._from, this._to);
3912
+ if (anim.loopMode === AnimationLoopModes.ANIMATIONLOOPMODE_CONSTANT && repeatCount > 0) value = anim.evaluate(to);
3913
+ else if (anim.loopMode === AnimationLoopModes.ANIMATIONLOOPMODE_RELATIVE && repeatCount > 0) {
3914
+ const [from] = animationPlaybackRange(anim, this._from, this._to);
3915
+ value = addValue(value, scaleValue(subtractValue(anim.evaluate(to), anim.evaluate(from)), repeatCount));
3916
+ }
3917
+ }
3918
+ applyAnimatedValue(this._target, anim.targetProperty, value);
3919
+ }
3920
+ }
3921
+ _advanceFallback(deltaMs) {
3922
+ let anyRunning = false;
3923
+ for (const animation of this._fallbackAnimations) {
3924
+ if (this._completedFallbackAnimations.has(animation)) continue;
3925
+ const [from, to] = animationPlaybackRange(animation, this._from, this._to);
3926
+ const frameRange = to - from;
3927
+ let elapsedFrames = (this._fallbackElapsedFrames.get(animation) ?? 0) + deltaMs / 1e3 * animation.framePerSecond * this._speedRatio;
3928
+ const reachedEnd = frameRange >= 0 ? elapsedFrames >= frameRange : elapsedFrames <= frameRange;
3929
+ let repeatCount = 0;
3930
+ let frame;
3931
+ if (this._loop) {
3932
+ repeatCount = frameRange === 0 ? 0 : Math.max(0, Math.trunc(elapsedFrames / frameRange));
3933
+ frame = frameRange === 0 ? to : from + elapsedFrames % frameRange;
3934
+ anyRunning = true;
3935
+ } else if (reachedEnd) {
3936
+ elapsedFrames = frameRange;
3937
+ frame = to;
3938
+ this._completedFallbackAnimations.add(animation);
3939
+ } else {
3940
+ frame = from + elapsedFrames;
3941
+ anyRunning = true;
3942
+ }
3943
+ this._fallbackElapsedFrames.set(animation, elapsedFrames);
3944
+ this._fallbackRepeatCounts.set(animation, repeatCount);
3945
+ this._fallbackFrames.set(animation, frame);
3946
+ }
3947
+ return anyRunning;
3948
+ }
3949
+ _resetFallbackAnimation(animation, frame) {
3950
+ const [from] = animationPlaybackRange(animation, this._from, this._to);
3951
+ const clampedFrame = clampAnimationFrame(animation, frame);
3952
+ this._fallbackFrames.set(animation, clampedFrame);
3953
+ this._fallbackElapsedFrames.set(animation, clampedFrame - from);
3954
+ this._fallbackRepeatCounts.set(animation, 0);
3955
+ }
3956
+ _attachLite() {
3957
+ if (this._nativeManager && this._lite) addAnimationGroup(this._nativeManager, this._lite);
3958
+ }
3959
+ _detachLite() {
3960
+ if (this._nativeManager && this._lite) removeAnimationGroup(this._nativeManager, this._lite);
3143
3961
  }
3144
3962
  };
3963
+ function partitionAnimations(target, animations, from, to, speedRatio, blockedNativeBindings) {
3964
+ const globalReason = getGlobalNativeFallbackReason(animations, from, to, speedRatio);
3965
+ if (globalReason) return {
3966
+ nativeAnimations: [],
3967
+ fallbackAnimations: animations.slice(),
3968
+ fallbackReasons: [globalReason]
3969
+ };
3970
+ const reasons = /* @__PURE__ */ new Map();
3971
+ for (const animation of animations) {
3972
+ const reason = getTrackNativeFallbackReason(target, animation, from, to);
3973
+ if (reason) reasons.set(animation, reason);
3974
+ }
3975
+ let changed = true;
3976
+ while (changed) {
3977
+ changed = false;
3978
+ const fallbackPaths = animations.filter((animation) => reasons.has(animation)).map((animation) => animation.targetProperty);
3979
+ const fallbackBindings = [...blockedNativeBindings, ...animations.filter((animation) => reasons.has(animation)).map((animation) => resolveAnimationBinding(target, animation.targetProperty)).filter(isAnimationBinding)];
3980
+ for (const animation of animations) {
3981
+ const binding = resolveAnimationBinding(target, animation.targetProperty);
3982
+ if (!reasons.has(animation) && (fallbackPaths.some((path) => pathsOverlap(path, animation.targetProperty)) || binding !== void 0 && fallbackBindings.some((fallbackBinding) => bindingsOverlap(binding, fallbackBinding)))) {
3983
+ reasons.set(animation, `native property animation path "${animation.targetProperty}" overlaps a compat fallback path`);
3984
+ changed = true;
3985
+ }
3986
+ }
3987
+ }
3988
+ return {
3989
+ nativeAnimations: animations.filter((animation) => !reasons.has(animation)),
3990
+ fallbackAnimations: animations.filter((animation) => reasons.has(animation)),
3991
+ fallbackReasons: [...new Set(reasons.values())]
3992
+ };
3993
+ }
3994
+ function getGlobalNativeFallbackReason(animations, from, to, speedRatio) {
3995
+ if (animations.length === 0) return "native property animation requires at least one Animation";
3996
+ if (!Number.isFinite(from) || !Number.isFinite(to) || !(to > from)) return "native property animation requires a finite forward play range";
3997
+ if (!Number.isFinite(speedRatio) || speedRatio < 0) return "native property animation does not delegate reverse or non-finite speed ratios";
3998
+ const frameRate = animations[0].framePerSecond;
3999
+ if (!(frameRate > 0) || !Number.isFinite(frameRate)) return "native property animation requires a finite positive frame rate";
4000
+ if (animations.some((animation) => animation.framePerSecond !== frameRate)) return "native property animation requires one shared frame rate";
4001
+ }
4002
+ function getTrackNativeFallbackReason(target, animation, from, to) {
4003
+ if (animation.loopMode !== AnimationLoopModes.ANIMATIONLOOPMODE_CYCLE) return `native property animation track "${animation.targetProperty}" requires cycle loop mode`;
4004
+ const stride = supportedStride(animation.dataType);
4005
+ if (stride === 0) return `native property animation track "${animation.targetProperty}" has an unsupported data type`;
4006
+ const keys = animation.getKeys();
4007
+ if (keys.length === 0) return `native property animation track "${animation.targetProperty}" requires at least one key`;
4008
+ let previousFrame = -Infinity;
4009
+ for (const key of keys) {
4010
+ if (!Number.isFinite(key.frame) || key.frame < 0 || key.frame <= previousFrame || !isSupportedKeyValue(key.value, stride)) return `native property animation track "${animation.targetProperty}" has an unsupported key frame or value`;
4011
+ previousFrame = key.frame;
4012
+ }
4013
+ if (from < keys[0].frame || to > keys[keys.length - 1].frame) return `native property animation track "${animation.targetProperty}" does not cover the requested play range`;
4014
+ if (!uniformInterpolation(keys)) return `native property animation track "${animation.targetProperty}" mixes STEP and LINEAR segments`;
4015
+ if (!supportsNativeBinding(target, animation.targetProperty, stride)) return `native property animation path "${animation.targetProperty}" is not writable by the native binding`;
4016
+ }
4017
+ function createNativeAnimationGroup(manager, target, animations, from, to, loop, speedRatio) {
4018
+ const tracks = animations.map((animation) => {
4019
+ const stride = supportedStride(animation.dataType);
4020
+ return {
4021
+ path: animation.targetProperty,
4022
+ frameRate: animation.framePerSecond,
4023
+ interpolation: trackInterpolation(animation.getKeys()),
4024
+ quaternion: animation.dataType === AnimationTypes.ANIMATIONTYPE_QUATERNION,
4025
+ easing: (gradient) => animation.getEasingFunction()?.ease(gradient) ?? gradient,
4026
+ keys: animation.getKeys().map((key) => ({
4027
+ frame: key.frame,
4028
+ value: toNativeKeyValue(key.value, stride)
4029
+ }))
4030
+ };
4031
+ });
4032
+ const clip = createPropertyAnimationClip(animations[0].name, tracks, { frameRate: animations[0].framePerSecond });
4033
+ return createPropertyAnimationGroup(manager, target, clip, {
4034
+ fromFrame: from,
4035
+ toFrame: to,
4036
+ loop,
4037
+ speedRatio
4038
+ });
4039
+ }
4040
+ function supportedStride(dataType) {
4041
+ switch (dataType) {
4042
+ case AnimationTypes.ANIMATIONTYPE_FLOAT: return 1;
4043
+ case AnimationTypes.ANIMATIONTYPE_VECTOR2: return 2;
4044
+ case AnimationTypes.ANIMATIONTYPE_VECTOR3: return 3;
4045
+ case AnimationTypes.ANIMATIONTYPE_QUATERNION: return 4;
4046
+ default: return 0;
4047
+ }
4048
+ }
4049
+ function isSupportedKeyValue(value, stride) {
4050
+ return readAnimationComponents(value, stride) !== void 0;
4051
+ }
4052
+ function toNativeKeyValue(value, stride) {
4053
+ if (typeof value === "number") return value;
4054
+ return readAnimationComponents(value, stride);
4055
+ }
4056
+ function pathsOverlap(a, b) {
4057
+ return a === b || a.startsWith(`${b}.`) || b.startsWith(`${a}.`);
4058
+ }
4059
+ function resolveAnimationBinding(target, path) {
4060
+ const parts = path.split(".");
4061
+ if (parts.length === 0 || parts.some((part) => part.length === 0) || typeof target !== "object" && typeof target !== "function" || target === null) return;
4062
+ const root = target;
4063
+ let owner = target;
4064
+ for (let i = 0; i < parts.length - 1; i++) {
4065
+ if (typeof owner !== "object" && typeof owner !== "function" || owner === null) return;
4066
+ owner = owner[parts[i]];
4067
+ }
4068
+ return (typeof owner === "object" || typeof owner === "function") && owner !== null ? {
4069
+ root,
4070
+ path,
4071
+ target: owner,
4072
+ property: parts[parts.length - 1]
4073
+ } : void 0;
4074
+ }
4075
+ function bindingsOverlap(a, b) {
4076
+ return a.root === b.root && pathsOverlap(a.path, b.path) || a.target === b.target && a.property === b.property;
4077
+ }
4078
+ function isAnimationBinding(binding) {
4079
+ return binding !== void 0;
4080
+ }
4081
+ function clampAnimationFrame(animation, frame) {
4082
+ const keys = animation?.getKeys();
4083
+ if (!keys || keys.length === 0) return frame;
4084
+ return Math.min(Math.max(frame, keys[0].frame), keys[keys.length - 1].frame);
4085
+ }
4086
+ function animationPlaybackRange(animation, from, to) {
4087
+ const keys = animation.getKeys();
4088
+ if (keys.length === 0) return [from, to];
4089
+ const min = keys[0].frame;
4090
+ const max = keys[keys.length - 1].frame;
4091
+ return [from < min || from > max ? min : from, to < min || to > max ? max : to];
4092
+ }
4093
+ function uniformInterpolation(keys) {
4094
+ let mode;
4095
+ for (let i = 0; i < keys.length - 1; i++) {
4096
+ const keyMode = keys[i].interpolation === AnimationKeyInterpolation.STEP ? AnimationKeyInterpolation.STEP : AnimationKeyInterpolation.NONE;
4097
+ mode ??= keyMode;
4098
+ if (mode !== keyMode) return false;
4099
+ }
4100
+ return true;
4101
+ }
4102
+ function trackInterpolation(keys) {
4103
+ return keys.length > 1 && keys[0].interpolation === AnimationKeyInterpolation.STEP ? "step" : "linear";
4104
+ }
4105
+ function supportsNativeBinding(target, path, stride) {
4106
+ const parts = path.split(".");
4107
+ if (parts.length === 0 || parts.some((part) => part.length === 0)) return false;
4108
+ let owner = target;
4109
+ for (let i = 0; i < parts.length - 1; i++) {
4110
+ if (typeof owner !== "object" && typeof owner !== "function" || owner === null) return false;
4111
+ const record = owner;
4112
+ const part = parts[i];
4113
+ if (!(part in record)) return false;
4114
+ owner = record[part];
4115
+ }
4116
+ if (typeof owner !== "object" && typeof owner !== "function" || owner === null) return false;
4117
+ const record = owner;
4118
+ const property = parts[parts.length - 1];
4119
+ if (!(property in record)) return false;
4120
+ const value = record[property];
4121
+ return stride === 1 ? typeof value === "number" : (typeof value === "object" || typeof value === "function") && value !== null && typeof value.set === "function";
4122
+ }
3145
4123
  /**
3146
4124
  * Babylon.js `AnimationGroup` — a named collection of targeted animations with
3147
4125
  * playback state. This is the **single** `AnimationGroup` type, matching Babylon.js;
@@ -3529,7 +4507,15 @@ var Constants = {
3529
4507
  TEXTURE_BILINEAR_SAMPLINGMODE: 2,
3530
4508
  TEXTURE_TRILINEAR_SAMPLINGMODE: 3,
3531
4509
  TEXTUREFORMAT_RGBA: 5,
3532
- TEXTURETYPE_UNSIGNED_BYTE: 0
4510
+ TEXTURETYPE_UNSIGNED_BYTE: 0,
4511
+ BUFFER_CREATIONFLAG_READ: 1,
4512
+ BUFFER_CREATIONFLAG_WRITE: 2,
4513
+ BUFFER_CREATIONFLAG_READWRITE: 3,
4514
+ BUFFER_CREATIONFLAG_UNIFORM: 4,
4515
+ BUFFER_CREATIONFLAG_VERTEX: 8,
4516
+ BUFFER_CREATIONFLAG_INDEX: 16,
4517
+ BUFFER_CREATIONFLAG_STORAGE: 32,
4518
+ BUFFER_CREATIONFLAG_INDIRECT: 64
3533
4519
  };
3534
4520
  //#endregion
3535
4521
  //#region src/events/pointer-events.ts
@@ -3617,8 +4603,8 @@ var Scene = class Scene extends AbstractScene {
3617
4603
  * Babylon.js `scene.animationGroups` / `scene.animatables`. Loaded glTF /
3618
4604
  * `.babylon` animation clips live on the Lite scene; `animationGroups` returns
3619
4605
  * BJS-shaped `AnimationGroup`s over them (so scenes can `goToFrame`/`pause`/`stop`
3620
- * to freeze a model at a deterministic frame). `animatables` surfaces the running
3621
- * CPU `Animatable`s started via `beginDirectAnimation`.
4606
+ * to freeze a model at a deterministic frame). `animatables` surfaces the
4607
+ * native-backed and fallback `Animatable`s started through the scene.
3622
4608
  */
3623
4609
  get animationGroups() {
3624
4610
  return (this._lite.animationGroups ?? []).map((g) => {
@@ -3665,6 +4651,8 @@ var Scene = class Scene extends AbstractScene {
3665
4651
  _materialPluginsRequested = false;
3666
4652
  _pendingMaterialPluginReconciliations = /* @__PURE__ */ new Set();
3667
4653
  _runningAnimatables = [];
4654
+ /** @internal Lite manager that owns supported compat property animations. */
4655
+ _propertyAnimationManager = null;
3668
4656
  _animationGroupCache = /* @__PURE__ */ new WeakMap();
3669
4657
  /** @internal Structural `AnimationGroup`s stepped + weight-blended each frame. */
3670
4658
  _structuralGroups = [];
@@ -3745,6 +4733,7 @@ var Scene = class Scene extends AbstractScene {
3745
4733
  this._engine._lastDeltaMs = deltaMs;
3746
4734
  this.onBeforeAnimationsObservable.notifyObservers(this);
3747
4735
  if (this._blendManager) updateAnimationManager(this._blendManager, deltaMs);
4736
+ if (this._propertyAnimationManager) updateAnimationManager(this._propertyAnimationManager, deltaMs);
3748
4737
  for (const a of this._runningAnimatables) a._tick(deltaMs);
3749
4738
  if (this._structuralGroups.length > 0) {
3750
4739
  for (const g of this._structuralGroups) g._advanceStructural(deltaMs);
@@ -4377,11 +5366,18 @@ var Scene = class Scene extends AbstractScene {
4377
5366
  }
4378
5367
  /**
4379
5368
  * Babylon.js `scene.beginDirectAnimation(target, animations, from, to, loop, speedRatio?)`.
4380
- * Drives the given `Animation`s on the CPU each frame, writing onto the target's
4381
- * (dotted) property path. Returns an `Animatable` with `goToFrame`/`pause`/`stop`.
5369
+ * Delegates supported tracks to Babylon Lite property animation and retains
5370
+ * explicit compat evaluation only for unsupported tracks. Returns one facade
5371
+ * coordinating both subsets.
4382
5372
  */
4383
5373
  beginDirectAnimation(target, animations, from, to, loop = false, speedRatio = 1) {
4384
- const animatable = new Animatable(target, animations, from, to, loop, speedRatio);
5374
+ if (speedRatio < 0) {
5375
+ [from, to] = [to, from];
5376
+ speedRatio = -speedRatio;
5377
+ }
5378
+ if (from > to) speedRatio = -speedRatio;
5379
+ const blockedNativeBindings = this._runningAnimatables.flatMap((animatable) => animatable._getBlockingFallbackBindings());
5380
+ const animatable = Animatable._create(() => this._propertyAnimationManager ??= createAnimationManager(), target, animations, from, to, loop, speedRatio, blockedNativeBindings);
4385
5381
  this._runningAnimatables.push(animatable);
4386
5382
  return animatable;
4387
5383
  }
@@ -4430,6 +5426,9 @@ var Scene = class Scene extends AbstractScene {
4430
5426
  this.onDisposeObservable.notifyObservers(this);
4431
5427
  this.onPointerObservable.clear();
4432
5428
  this._beforeRenderFlushCallbacks.clear();
5429
+ if (this._propertyAnimationManager) clearAnimationManager(this._propertyAnimationManager);
5430
+ if (this._blendManager) clearAnimationManager(this._blendManager);
5431
+ this._runningAnimatables.length = 0;
4433
5432
  disposeScene(this._lite);
4434
5433
  }
4435
5434
  };
@@ -7494,6 +8493,10 @@ var SpriteManager = class {
7494
8493
  addFacingBillboardSystem(scene._lite, system);
7495
8494
  });
7496
8495
  }
8496
+ /** Babylon.js `SpriteManager.isReady()` — an empty manager is ready without renderer preparation. */
8497
+ isReady() {
8498
+ return this._sprites.length === 0 || this._lite !== void 0;
8499
+ }
7497
8500
  /** @internal Map the Babylon.js `Constants.ALPHA_*` blend mode to a Lite billboard blend. */
7498
8501
  _mapBlendMode() {
7499
8502
  if (this.blendMode === ALPHA_ONEONE || this.blendMode === ALPHA_ADD) return billboardBlendAdditive;
@@ -7702,6 +8705,10 @@ var SpriteRenderer = class {
7702
8705
  });
7703
8706
  });
7704
8707
  }
8708
+ /** Babylon.js `SpriteRenderer.isReady()` — the next render can build once its atlas is loaded. */
8709
+ isReady() {
8710
+ return this._atlas !== void 0;
8711
+ }
7705
8712
  /** @internal Map the Babylon.js blend mode to a Lite sprite blend descriptor. */
7706
8713
  _blend() {
7707
8714
  if (this.blendMode === ALPHA_PREMULTIPLIED) return spriteBlendPremultiplied;
@@ -8218,10 +9225,10 @@ function GetSupportedSimultaneousLights(scene, maxSimultaneousLights) {
8218
9225
  //#endregion
8219
9226
  //#region src/animations/easing.ts
8220
9227
  /**
8221
- * Babylon.js-compatible easing functions (pure, no Babylon Lite dependency).
9228
+ * Babylon.js-compatible easing functions over Babylon Lite's functional curves.
8222
9229
  *
8223
- * These mirror Babylon.js's `EasingFunction` hierarchy and easing modes for use
8224
- * with property animations. They are fully unit-testable.
9230
+ * These retain Babylon.js's class hierarchy and easing modes for porting while
9231
+ * delegating curve math to tree-shakable native Lite functions.
8225
9232
  */
8226
9233
  var EASINGMODE_EASEIN = 0;
8227
9234
  var EASINGMODE_EASEOUT = 1;
@@ -8247,33 +9254,32 @@ var EasingFunction = class {
8247
9254
  };
8248
9255
  var CircleEase = class extends EasingFunction {
8249
9256
  easeInCore(gradient) {
8250
- const g = Math.max(0, Math.min(1, gradient));
8251
- return 1 - Math.sqrt(1 - g * g);
9257
+ return circleEase(gradient);
8252
9258
  }
8253
9259
  };
8254
9260
  var QuadraticEase = class extends EasingFunction {
8255
9261
  easeInCore(gradient) {
8256
- return gradient * gradient;
9262
+ return quadraticEase(gradient);
8257
9263
  }
8258
9264
  };
8259
9265
  var CubicEase = class extends EasingFunction {
8260
9266
  easeInCore(gradient) {
8261
- return gradient * gradient * gradient;
9267
+ return cubicEase(gradient);
8262
9268
  }
8263
9269
  };
8264
9270
  var QuarticEase = class extends EasingFunction {
8265
9271
  easeInCore(gradient) {
8266
- return gradient * gradient * gradient * gradient;
9272
+ return quarticEase(gradient);
8267
9273
  }
8268
9274
  };
8269
9275
  var QuinticEase = class extends EasingFunction {
8270
9276
  easeInCore(gradient) {
8271
- return gradient * gradient * gradient * gradient * gradient;
9277
+ return quinticEase(gradient);
8272
9278
  }
8273
9279
  };
8274
9280
  var SineEase = class extends EasingFunction {
8275
9281
  easeInCore(gradient) {
8276
- return 1 - Math.sin(Math.PI / 2 * (1 - gradient));
9282
+ return sineEase(gradient);
8277
9283
  }
8278
9284
  };
8279
9285
  var ExponentialEase = class extends EasingFunction {
@@ -8283,8 +9289,7 @@ var ExponentialEase = class extends EasingFunction {
8283
9289
  this.exponent = exponent;
8284
9290
  }
8285
9291
  easeInCore(gradient) {
8286
- if (this.exponent <= 0) return gradient;
8287
- return (Math.exp(this.exponent * gradient) - 1) / (Math.exp(this.exponent) - 1);
9292
+ return exponentialEase(gradient, this.exponent);
8288
9293
  }
8289
9294
  };
8290
9295
  var BackEase = class extends EasingFunction {
@@ -8294,8 +9299,7 @@ var BackEase = class extends EasingFunction {
8294
9299
  this.amplitude = amplitude;
8295
9300
  }
8296
9301
  easeInCore(gradient) {
8297
- const num = Math.max(0, this.amplitude);
8298
- return Math.pow(gradient, 3) - gradient * num * Math.sin(Math.PI * gradient);
9302
+ return backEase(gradient, this.amplitude);
8299
9303
  }
8300
9304
  };
8301
9305
  var ElasticEase = class extends EasingFunction {
@@ -8307,9 +9311,7 @@ var ElasticEase = class extends EasingFunction {
8307
9311
  this.springiness = springiness;
8308
9312
  }
8309
9313
  easeInCore(gradient) {
8310
- const num2 = Math.max(0, this.oscillations);
8311
- const num3 = Math.max(0, this.springiness);
8312
- return (num3 === 0 ? gradient : (Math.exp(num3 * gradient) - 1) / (Math.exp(num3) - 1)) * Math.sin((2 * Math.PI * num2 + Math.PI / 2) * gradient);
9314
+ return elasticEase(gradient, this.oscillations, this.springiness);
8313
9315
  }
8314
9316
  };
8315
9317
  var BounceEase = class extends EasingFunction {
@@ -8321,21 +9323,39 @@ var BounceEase = class extends EasingFunction {
8321
9323
  this.bounciness = bounciness;
8322
9324
  }
8323
9325
  easeInCore(gradient) {
8324
- const num = Math.max(0, this.bounces);
8325
- let bounciness = this.bounciness;
8326
- if (bounciness <= 1) bounciness = 1.001;
8327
- const num2 = Math.pow(bounciness, num);
8328
- const num3 = 1 - bounciness;
8329
- const num4 = (1 - num2) / num3 + num2 * .5;
8330
- const num5 = gradient * num4;
8331
- const num6 = Math.log(-num5 * (1 - bounciness) + 1) / Math.log(bounciness);
8332
- const num7 = Math.floor(num6);
8333
- const num8 = num7 + 1;
8334
- const num9 = (1 - Math.pow(bounciness, num7)) / (num3 * num4);
8335
- const num11 = (num9 + (1 - Math.pow(bounciness, num8)) / (num3 * num4)) * .5;
8336
- const num12 = gradient - num11;
8337
- const num13 = num11 - num9;
8338
- return -Math.pow(1 / bounciness, num - num7) / (num13 * num13) * (num12 - num13) * (num12 + num13);
9326
+ return bounceEase(gradient, this.bounces, this.bounciness);
9327
+ }
9328
+ };
9329
+ /**
9330
+ * Babylon.js-compatible power easing class.
9331
+ */
9332
+ var PowerEase = class extends EasingFunction {
9333
+ power;
9334
+ constructor(power = 2) {
9335
+ super();
9336
+ this.power = power;
9337
+ }
9338
+ easeInCore(gradient) {
9339
+ return powerEase(gradient, this.power);
9340
+ }
9341
+ };
9342
+ /**
9343
+ * Babylon.js-compatible cubic Bezier easing class.
9344
+ */
9345
+ var BezierCurveEase = class extends EasingFunction {
9346
+ x1;
9347
+ y1;
9348
+ x2;
9349
+ y2;
9350
+ constructor(x1 = 0, y1 = 0, x2 = 1, y2 = 1) {
9351
+ super();
9352
+ this.x1 = x1;
9353
+ this.y1 = y1;
9354
+ this.x2 = x2;
9355
+ this.y2 = y2;
9356
+ }
9357
+ easeInCore(gradient) {
9358
+ return bezierCurveEase(gradient, this.x1, this.y1, this.x2, this.y2);
8339
9359
  }
8340
9360
  };
8341
9361
  //#endregion
@@ -11314,6 +12334,6 @@ var NodeParticleSystemSet = class NodeParticleSystemSet {
11314
12334
  }
11315
12335
  };
11316
12336
  //#endregion
11317
- export { AbstractAssetTask, AbstractAudioAnalyzer, AbstractAudioBus, AbstractAudioNode, AbstractAudioOutNode, AbstractEngine, AbstractMesh, AbstractNamedAudioNode, AbstractScene, AbstractSound, AbstractSoundSource, AbstractSpatialAudio, AbstractSpatialAudioListener, AbstractStereoAudio, Action, ActionManager, ActionManagerTriggers, AddGaussianSplattingStreamPart, AddGaussianSplattingStreamPartAsync, AmmoJSPlugin, AnaglyphArcRotateCamera, Angle, Animatable, Animation, AnimationGroup, AnimationKeyInterpolation, AnimationLoopModes, AnimationTypes, AppendSceneAsync, ArcRotateCamera, AssetContainer, AssetsManager, AttachToBoxBehavior, AudioBus, AudioEngine, AudioEngineV2, AudioParameterRampShape, AutoRotationBehavior, Axis, AxisDragGizmo, AxisScaleGizmo, BVHFileLoader, BackEase, BackgroundMaterial, BallAndSocketConstraint, BaseSixDofDragBehavior, BaseTexture, BlackAndWhitePostProcess, BloomEffect, BlurPostProcess, Bone, BounceEase, BouncingBehavior, BoundingBox, BoundingBoxGizmo, BoundingBoxRenderer, BoundingInfo, BoundingSphere, CSG, CSG2, Camera, CameraGizmo, CannonJSPlugin, CascadedShadowGenerator, CastingResult, CharacterSupportedState, ChromaticAberrationPostProcess, CircleEase, ClusteredLightContainer, Color3, Color4, ColorGradient, CompleteGreasedLineColorTable, CompleteGreasedLineWidthTable, ComputeOverlayCssTransform, Condition, Constants, CreateAudioBusAsync, CreateAudioEngineAsync, CreateBox, CreateCylinder, CreateDashedLines, CreateDefaultMeshBlendRadiusDefinitions, CreateDisc, CreateGreasedLine, CreateGreasedLineMaterial, CreateGround, CreateLineSystem, CreateLines, CreateMainAudioBusAsync, CreateMicrophoneSoundSourceAsync, CreatePlane, CreateSoundAsync, CreateSoundBufferAsync, CreateSoundSourceAsync, CreateSphere, CreateStreamingSoundAsync, CreateTexture2DArrayFromImageUrlsAsync, CreateTexture2DArrayFromKTX2Async, CreateTiledBox, CreateTiledPlane, CreateTorus, CubeTexture, CubicEase, Curve3, CustomAssetTask, DefaultRenderingPipeline, DepthOfFieldEffect, DepthRenderer, DeviceOrientationCamera, DirectionalLight, DistanceConstraint, DitheredTileFadeMaterialPlugin, DynamicTexture, EASINGMODE_EASEIN, EASINGMODE_EASEINOUT, EASINGMODE_EASEOUT, EasingFunction, EdgesRenderer, EffectLayer, ElasticEase, Engine, Epsilon, ExecuteCodeAction, ExponentialEase, FBXConstraintBehavior, FBXConstraintSolver, FBXFileLoader, FBXFileLoaderMetadata, FSR1RenderingPipeline, FactorGradient, FadeInOutBehavior, FlowGraphValidationSeverity, FluidRenderer, FluidRendererSceneComponent, FluidRenderingObject, FluidRenderingObjectCustomParticles, FluidRenderingObjectParticleSystem, FluidRenderingTargetRenderer, FlyCamera, FollowBehavior, FollowCamera, FrameGraphMeshBlendingTask, FramingBehavior, FreeCamera, Frustum, FxaaPostProcess, gltf1_exports as GLTF1, gltf2_exports as GLTF2, GPUParticleSystem, GPUPicker, GUID, GamepadCamera, GaussianSplattingMesh, GaussianSplattingStream, GeometryBufferRenderer, GeospatialCamera, GeospatialClippingBehavior, GetElementPixelFromUv, GetPointsCount, GetSupportedSimultaneousLights, GetWhiteBalanceMatrix, GizmoManager, GlowLayer, GreasedLineBaseMesh, GreasedLineMaterialDefaults, GreasedLineMesh, GreasedLineMeshColorDistribution, GreasedLineMeshWidthDistribution, GreasedLinePluginMaterial, GreasedLineRibbonAutoDirectionMode, GreasedLineRibbonFacesMode, GreasedLineRibbonMesh, GreasedLineRibbonPointsMode, GreasedLineSimpleMaterial, GreasedLineTools, GridMaterial, GroundMesh, HDRCubeTexture, HandConstraintBehavior, HavokPlugin, HemisphericLight, HighlightLayer, HingeConstraint, HtmlInteractionManager, HtmlRaycastInteractionManager, HtmlTexture, ImageProcessingConfiguration, ImportMeshAsync, IncrementValueAction, InitializeCSG2Async, InstallHtmlInCanvasPolyfill, InstancedMesh, InterpolatingBehavior, IsHtmlInCanvasSupportedNatively, IsHtmlInCanvasUploadSupported, KHR_materials_variants, LastCreatedAudioEngine, Layer, Light, LightGizmo, LinesMesh, LiteCompatError, LoadAssetContainerAsync, LoadImageToTexture2DArrayLayerAsync, LockConstraint, Logger, MainAudioBus, Material, MaterialGreasedLineDefines, MaterialPluginBase, MaterialPluginManager, Matrix, MaxTintMagnitude, Mesh, MeshBlendDebugMode, MeshBlendDepthType, MeshBlendQuality, MeshBlendingPostProcess, MeshBlendingRadiusClass, MeshBuilder, MeshoptCompression, MinTemperatureKelvin, MirrorTexture, MorphTarget, MorphTargetManager, MultiMaterial, MultiPointerScaleBehavior, Node, NodeMaterial, NodeParticleSystemSet, NodeRenderGraphMeshBlendingPostProcessBlock, NullEngine, OBJFileLoader, Observable, OnAudioEngineV2CreatedObservable, OpenPBRMaterial, OpenPBRMaterialDefines, OpenPBRMaterialLoadingAdapter, OutlineRenderer, PBRAnisotropicConfiguration, PBRClearCoatConfiguration, PBRIridescenceConfiguration, PBRMaterial, PBRMetallicRoughnessMaterial, PBRSheenConfiguration, PBRSpecularGlossinessMaterial, PackMeshBlendingTag, ParticleHelper, ParticleSystem, ParticleSystemSet, Path3D, PerformanceMonitor, Physics6DoFConstraint, Physics6DoFLimit, PhysicsAggregate, PhysicsBody, PhysicsCharacterController, PhysicsConstraint, PhysicsConstraintAxis, PhysicsConstraintType, PhysicsEngine, PhysicsMotionType, PhysicsPrestepType, PhysicsRaycastResult, PhysicsShape, PhysicsShapeType, PickingInfo, Plane, PlaneDragGizmo, PlaneRotationGizmo, PointLight, PointerDragBehavior, PointerEventTypes, PointerInfo, PointsCloudSystem, Polar, PositionGizmo, PostProcess, PrecisionDate, PredicateCondition, PrismaticConstraint, PushMaterial, QuadraticEase, QuarticEase, Quaternion, QuinticEase, RandomGUID, RawTexture, RawTexture2DArray, RawTexture3D, Ray, RecastJSPlugin, RectAreaLight, ReflectionProbe, RegisterAbstractEngineTextureLoaders, RegisterEnginesExtensionsEngineTexture2DArrayImageSource, RegisterEnginesWebGPUExtensionsEngineTexture2DArrayImageSource, RegisterFluidRenderer, RegisterGreasedLinePluginMaterial, RegisterImageProcessingConfiguration, RegisterMeshBlendingPostProcessBlock, RegisterOpenpbrMaterial, RegisterUSDFileLoader, RenderTargetTexture, RotationGizmo, SSAO2RenderingPipeline, STLFileLoader, Scalar, ScaleGizmo, Scene, SceneLoader, SceneOptimizer, ScenePerformancePriority, SceneSerializer, SetValueAction, ShaderLanguage, ShaderMaterial, ShadowGenerator, SineEase, SixDofDragBehavior, Size, Skeleton, SliderConstraint, SmartArray, SolidParticleSystem, Sound, SoundSource, SoundState, Space, SpatialAudioAttachmentType, Spherical, SpotLight, SpringConstraint, Sprite, SpriteManager, SpriteMap, SpritePackedManager, SpriteRenderer, StandardMaterial, StaticSound, StaticSoundBuffer, StreamingSound, StringDictionary, SurfaceMagnetismBehavior, Tags, TargetCamera, TemperatureTintToXyz, Texture, ThinEngine, ThinFSR1SharpenPostProcess, ThinFSR1UpscalePostProcess, ThinMeshBlendingPostProcess, ThinSprite, ToDegrees, ToRadians, Tools, TouchCamera, TransformNode, USDFileLoader, UninstallHtmlInCanvasPolyfill, UniversalCamera, UnpackMeshBlendingTag, UploadHtmlElementToTexture, UploadImageToTexture2DArrayLayer, UtilityLayerRenderer, ValidateFlowGraph, ValidateFlowGraphWithBlockList, ValueCondition, ValueConditionOperators, Vector2, Vector3, Vector4, VertexBuffer, VertexData, Viewport, VirtualJoystick, WebGPUEngine, WebXRCamera, WeightedSound, registerBuiltInLoaders, transformCoordinates, transformNormal, unsupported };
12337
+ export { AbstractAssetTask, AbstractAudioAnalyzer, AbstractAudioBus, AbstractAudioNode, AbstractAudioOutNode, AbstractEngine, AbstractMesh, AbstractNamedAudioNode, AbstractScene, AbstractSound, AbstractSoundSource, AbstractSpatialAudio, AbstractSpatialAudioListener, AbstractStereoAudio, Action, ActionManager, ActionManagerTriggers, AddGaussianSplattingStreamPart, AddGaussianSplattingStreamPartAsync, AmmoJSPlugin, AnaglyphArcRotateCamera, Angle, Animatable, Animation, AnimationGroup, AnimationKeyInterpolation, AnimationLoopModes, AnimationTypes, AppendSceneAsync, ArcRotateCamera, AssetContainer, AssetsManager, AttachToBoxBehavior, AudioBus, AudioEngine, AudioEngineV2, AudioParameterRampShape, AutoRotationBehavior, Axis, AxisDragGizmo, AxisScaleGizmo, BVHFileLoader, BackEase, BackgroundMaterial, BallAndSocketConstraint, BaseSixDofDragBehavior, BaseTexture, BezierCurveEase, BlackAndWhitePostProcess, BloomEffect, BlurPostProcess, Bone, BounceEase, BouncingBehavior, BoundingBox, BoundingBoxGizmo, BoundingBoxRenderer, BoundingInfo, BoundingSphere, CSG, CSG2, Camera, CameraGizmo, CannonJSPlugin, CascadedShadowGenerator, CastingResult, CharacterSupportedState, ChromaticAberrationPostProcess, CircleEase, ClusteredLightContainer, Color3, Color4, ColorGradient, CompleteGreasedLineColorTable, CompleteGreasedLineWidthTable, ComputeOverlayCssTransform, ComputeShader, ComputeShaderParse, Condition, Constants, CreateAudioBusAsync, CreateAudioEngineAsync, CreateBox, CreateCylinder, CreateDashedLines, CreateDefaultMeshBlendRadiusDefinitions, CreateDisc, CreateGreasedLine, CreateGreasedLineMaterial, CreateGround, CreateLineSystem, CreateLines, CreateMainAudioBusAsync, CreateMicrophoneSoundSourceAsync, CreatePlane, CreateSoundAsync, CreateSoundBufferAsync, CreateSoundSourceAsync, CreateSphere, CreateStreamingSoundAsync, CreateTexture2DArrayFromImageUrlsAsync, CreateTexture2DArrayFromKTX2Async, CreateTiledBox, CreateTiledPlane, CreateTorus, CubeTexture, CubicEase, Curve3, CustomAssetTask, DefaultRenderingPipeline, DepthOfFieldEffect, DepthRenderer, DeviceOrientationCamera, DirectionalLight, DistanceConstraint, DitheredTileFadeMaterialPlugin, DynamicTexture, EASINGMODE_EASEIN, EASINGMODE_EASEINOUT, EASINGMODE_EASEOUT, EasingFunction, EdgesRenderer, EffectLayer, ElasticEase, Engine, Epsilon, ExecuteCodeAction, ExponentialEase, FBXConstraintBehavior, FBXConstraintSolver, FBXFileLoader, FBXFileLoaderMetadata, FSR1RenderingPipeline, FactorGradient, FadeInOutBehavior, FlowGraphValidationSeverity, FluidRenderer, FluidRendererSceneComponent, FluidRenderingObject, FluidRenderingObjectCustomParticles, FluidRenderingObjectParticleSystem, FluidRenderingTargetRenderer, FlyCamera, FollowBehavior, FollowCamera, FrameGraphMeshBlendingTask, FramingBehavior, FreeCamera, Frustum, FxaaPostProcess, gltf1_exports as GLTF1, gltf2_exports as GLTF2, GPUParticleSystem, GPUPicker, GUID, GamepadCamera, GaussianSplattingMesh, GaussianSplattingStream, GeometryBufferRenderer, GeospatialCamera, GeospatialClippingBehavior, GetElementPixelFromUv, GetPointsCount, GetSupportedSimultaneousLights, GetWhiteBalanceMatrix, GizmoManager, GlowLayer, GreasedLineBaseMesh, GreasedLineMaterialDefaults, GreasedLineMesh, GreasedLineMeshColorDistribution, GreasedLineMeshWidthDistribution, GreasedLinePluginMaterial, GreasedLineRibbonAutoDirectionMode, GreasedLineRibbonFacesMode, GreasedLineRibbonMesh, GreasedLineRibbonPointsMode, GreasedLineSimpleMaterial, GreasedLineTools, GridMaterial, GroundMesh, HDRCubeTexture, HandConstraintBehavior, HavokPlugin, HemisphericLight, HighlightLayer, HingeConstraint, HtmlInteractionManager, HtmlRaycastInteractionManager, HtmlTexture, ImageProcessingConfiguration, ImportMeshAsync, IncrementValueAction, InitializeCSG2Async, InstallHtmlInCanvasPolyfill, InstancedMesh, InterpolatingBehavior, IsHtmlInCanvasSupportedNatively, IsHtmlInCanvasUploadSupported, KHR_materials_variants, LastCreatedAudioEngine, Layer, Light, LightGizmo, LinesMesh, LiteCompatError, LoadAssetContainerAsync, LoadImageToTexture2DArrayLayerAsync, LockConstraint, Logger, MainAudioBus, Material, MaterialGreasedLineDefines, MaterialPluginBase, MaterialPluginManager, Matrix, MaxTintMagnitude, Mesh, MeshBlendDebugMode, MeshBlendDepthType, MeshBlendQuality, MeshBlendingPostProcess, MeshBlendingRadiusClass, MeshBuilder, MeshoptCompression, MinTemperatureKelvin, MirrorTexture, MorphTarget, MorphTargetManager, MultiMaterial, MultiPointerScaleBehavior, Node, NodeMaterial, NodeParticleSystemSet, NodeRenderGraphMeshBlendingPostProcessBlock, NullEngine, OBJFileLoader, Observable, OnAudioEngineV2CreatedObservable, OpenPBRMaterial, OpenPBRMaterialDefines, OpenPBRMaterialLoadingAdapter, OutlineRenderer, PBRAnisotropicConfiguration, PBRClearCoatConfiguration, PBRIridescenceConfiguration, PBRMaterial, PBRMetallicRoughnessMaterial, PBRSheenConfiguration, PBRSpecularGlossinessMaterial, PackMeshBlendingTag, ParticleHelper, ParticleSystem, ParticleSystemSet, Path3D, PerformanceMonitor, Physics6DoFConstraint, Physics6DoFLimit, PhysicsAggregate, PhysicsBody, PhysicsCharacterController, PhysicsConstraint, PhysicsConstraintAxis, PhysicsConstraintType, PhysicsEngine, PhysicsMotionType, PhysicsPrestepType, PhysicsRaycastResult, PhysicsShape, PhysicsShapeType, PickingInfo, Plane, PlaneDragGizmo, PlaneRotationGizmo, PointLight, PointerDragBehavior, PointerEventTypes, PointerInfo, PointsCloudSystem, Polar, PositionGizmo, PostProcess, PowerEase, PrecisionDate, PredicateCondition, PrismaticConstraint, PushMaterial, QuadraticEase, QuarticEase, Quaternion, QuinticEase, RandomGUID, RawTexture, RawTexture2DArray, RawTexture3D, Ray, RecastJSPlugin, RectAreaLight, ReflectionProbe, RegisterAbstractEngineTextureLoaders, RegisterComputeShader, RegisterEnginesExtensionsEngineTexture2DArrayImageSource, RegisterEnginesWebGPUExtensionsEngineTexture2DArrayImageSource, RegisterFluidRenderer, RegisterGreasedLinePluginMaterial, RegisterImageProcessingConfiguration, RegisterMeshBlendingPostProcessBlock, RegisterOpenpbrMaterial, RegisterUSDFileLoader, RenderTargetTexture, RotationGizmo, SSAO2RenderingPipeline, STLFileLoader, Scalar, ScaleGizmo, Scene, SceneLoader, SceneOptimizer, ScenePerformancePriority, SceneSerializer, SetValueAction, ShaderLanguage, ShaderMaterial, ShadowGenerator, SineEase, SixDofDragBehavior, Size, Skeleton, SliderConstraint, SmartArray, SolidParticleSystem, Sound, SoundSource, SoundState, Space, SpatialAudioAttachmentType, Spherical, SpotLight, SpringConstraint, Sprite, SpriteManager, SpriteMap, SpritePackedManager, SpriteRenderer, StandardMaterial, StaticSound, StaticSoundBuffer, StorageBuffer, StreamingSound, StringDictionary, SurfaceMagnetismBehavior, Tags, TargetCamera, TemperatureTintToXyz, Texture, ThinEngine, ThinFSR1SharpenPostProcess, ThinFSR1UpscalePostProcess, ThinMeshBlendingPostProcess, ThinSprite, ToDegrees, ToRadians, Tools, TouchCamera, TransformNode, USDFileLoader, UniformBuffer, UninstallHtmlInCanvasPolyfill, UniversalCamera, UnpackMeshBlendingTag, UploadHtmlElementToTexture, UploadImageToTexture2DArrayLayer, UtilityLayerRenderer, ValidateFlowGraph, ValidateFlowGraphWithBlockList, ValueCondition, ValueConditionOperators, Vector2, Vector3, Vector4, VertexBuffer, VertexData, Viewport, VirtualJoystick, WebGPUEngine, WebXRCamera, WeightedSound, registerBuiltInLoaders, transformCoordinates, transformNormal, unsupported };
11318
12338
 
11319
12339
  //# sourceMappingURL=index.js.map