@babylonjs/lite-compat 1.30.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/README.md +33 -31
- package/index.d.ts +758 -36
- package/index.js +1908 -155
- package/index.js.map +1 -1
- package/{meshes-DJ46g22_.js → meshes-Fu955h5M.js} +155 -24
- package/meshes-Fu955h5M.js.map +1 -0
- package/navigation.d.ts +199 -18
- package/navigation.js +3 -10
- package/navigation.js.map +1 -1
- package/package.json +4 -4
- package/meshes-DJ46g22_.js.map +0 -1
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { CharacterSupportedState as CharacterSupportedState$1, 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, createDirectionalLight, createDynamicTexture, createEngine, createEsmDirectionalShadowGenerator, createFacingBillboardSystem, createFreeCamera, createGeospatialCamera, createGpuPicker, createGridMaterial, createHavokWorld, createHemisphericLight, createHtmlTexture, 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, goToFrame, initializeCsg2Async, invertMat4, loadBabylon, loadBasisTexture2D, loadDdsEnvironment, loadEnvironment, loadGltf, loadHdrEnvironment, loadImageToArrayLayer, loadKtxTexture2D, loadSOG, loadSPZ, loadSplat, loadSpriteAtlas, loadTexture2D, markClusteredLightContainerDirty, multiplyMat4, multiplyPolarToRef, multiplySphericalToRef, onBeforeRender, onPhysicsAfterStep, 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, unlockAudioEngineAsync, updateAnimationManager, updateBillboardSpriteIndex, updateDynamicTexture, updateHtmlTexture, updateSpatialAudio, updateSprite2DIndex, updateTexture2DArrayFromPixels, updateTexture2DFromPixels, uploadImageToArrayLayer, whenHtmlTextureReady } from "@babylonjs/lite";
|
|
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, 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) => {
|
|
@@ -578,6 +578,15 @@ var Path3D = class {
|
|
|
578
578
|
}
|
|
579
579
|
};
|
|
580
580
|
//#endregion
|
|
581
|
+
//#region src/math/color-temperature.ts
|
|
582
|
+
function TemperatureTintToXyz(temperatureKelvin, tint) {
|
|
583
|
+
const [x, y, z] = temperatureTintToXyz(temperatureKelvin, tint);
|
|
584
|
+
return new Vector3(x, y, z);
|
|
585
|
+
}
|
|
586
|
+
function GetWhiteBalanceMatrix(temperatureKelvin, tint) {
|
|
587
|
+
return getWhiteBalanceMatrix(temperatureKelvin, tint);
|
|
588
|
+
}
|
|
589
|
+
//#endregion
|
|
581
590
|
//#region src/culling/picking-info.ts
|
|
582
591
|
/** Babylon.js-compatible result of a scene pick. */
|
|
583
592
|
var PickingInfo = class PickingInfo {
|
|
@@ -874,6 +883,10 @@ var AbstractEngine = class {
|
|
|
874
883
|
_initialized = false;
|
|
875
884
|
_startupComplete = false;
|
|
876
885
|
_startPromise = null;
|
|
886
|
+
/** @internal Whether scene registration and the first engine start have completed. */
|
|
887
|
+
get _hasStarted() {
|
|
888
|
+
return this._startupComplete;
|
|
889
|
+
}
|
|
877
890
|
/** @internal Active `requestAnimationFrame` id for the scene-less loop, if any. */
|
|
878
891
|
_rafId = null;
|
|
879
892
|
/**
|
|
@@ -1114,6 +1127,13 @@ var AbstractEngine = class {
|
|
|
1114
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.");
|
|
1115
1128
|
}
|
|
1116
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
|
+
/**
|
|
1117
1137
|
* Babylon.js `engine.updateTextureArrayLayerFromImageSource(texture, source, layer, invertY, premultiplyAlpha)`
|
|
1118
1138
|
* — the engine extension that uploads a decoded image source into one layer of a 2D array
|
|
1119
1139
|
* texture. Forwards to Babylon Lite's `uploadImageToArrayLayer`.
|
|
@@ -1146,12 +1166,16 @@ var AbstractEngine = class {
|
|
|
1146
1166
|
scene._flushPendingAdds();
|
|
1147
1167
|
scene._buildMorphTargets();
|
|
1148
1168
|
scene._buildClusteredContainers();
|
|
1169
|
+
await scene._enableMaterialPlugins();
|
|
1149
1170
|
await scene._loadPendingEnvironment();
|
|
1150
1171
|
await enableMirroredMeshes(scene._lite);
|
|
1151
1172
|
if (scene._hasShadows()) await registerSceneWithShadowSupport(scene._lite);
|
|
1152
1173
|
else await registerScene(scene._lite);
|
|
1153
1174
|
}
|
|
1154
1175
|
await startEngine(this._lite);
|
|
1176
|
+
do
|
|
1177
|
+
await Promise.all(this._scenes.map((scene) => scene._reconcilePendingMaterialPlugins()));
|
|
1178
|
+
while (this._scenes.some((scene) => scene._hasPendingMaterialPluginReconciliations));
|
|
1155
1179
|
this._startupComplete = true;
|
|
1156
1180
|
if (this._lateWork.length > 0) {
|
|
1157
1181
|
await Promise.all(this._lateWork.map(runLateWork));
|
|
@@ -1239,6 +1263,605 @@ var NullEngine = class extends WebGPUEngine {
|
|
|
1239
1263
|
}
|
|
1240
1264
|
};
|
|
1241
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
|
|
1242
1865
|
//#region src/scene/abstract-scene.ts
|
|
1243
1866
|
var AbstractScene = class {
|
|
1244
1867
|
/**
|
|
@@ -2914,10 +3537,10 @@ var AnaglyphArcRotateCamera = class {
|
|
|
2914
3537
|
* Babylon.js-compatible `Animation` keyframe model + `AnimationGroup`.
|
|
2915
3538
|
*
|
|
2916
3539
|
* `Animation` is a pure-JS keyframe container with CPU evaluation (`evaluate`),
|
|
2917
|
-
* the Babylon.js data-type / loop-mode constants, and `setKeys`/`getKeys`.
|
|
2918
|
-
*
|
|
2919
|
-
*
|
|
2920
|
-
*
|
|
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.
|
|
2921
3544
|
*/
|
|
2922
3545
|
/**
|
|
2923
3546
|
* Babylon.js `AnimationKeyInterpolation` — how the segment starting at a key is
|
|
@@ -2952,10 +3575,13 @@ var Animation = class Animation {
|
|
|
2952
3575
|
static ANIMATIONTYPE_QUATERNION = AnimationTypes.ANIMATIONTYPE_QUATERNION;
|
|
2953
3576
|
static ANIMATIONTYPE_MATRIX = AnimationTypes.ANIMATIONTYPE_MATRIX;
|
|
2954
3577
|
static ANIMATIONTYPE_COLOR3 = AnimationTypes.ANIMATIONTYPE_COLOR3;
|
|
3578
|
+
static ANIMATIONTYPE_VECTOR2 = AnimationTypes.ANIMATIONTYPE_VECTOR2;
|
|
3579
|
+
static ANIMATIONTYPE_COLOR4 = AnimationTypes.ANIMATIONTYPE_COLOR4;
|
|
2955
3580
|
static ANIMATIONLOOPMODE_RELATIVE = AnimationLoopModes.ANIMATIONLOOPMODE_RELATIVE;
|
|
2956
3581
|
static ANIMATIONLOOPMODE_CYCLE = AnimationLoopModes.ANIMATIONLOOPMODE_CYCLE;
|
|
2957
3582
|
static ANIMATIONLOOPMODE_CONSTANT = AnimationLoopModes.ANIMATIONLOOPMODE_CONSTANT;
|
|
2958
3583
|
_keys = [];
|
|
3584
|
+
_easingFunction = null;
|
|
2959
3585
|
constructor(name, targetProperty, framePerSecond, dataType = AnimationTypes.ANIMATIONTYPE_FLOAT, loopMode = AnimationLoopModes.ANIMATIONLOOPMODE_CYCLE) {
|
|
2960
3586
|
this.name = name;
|
|
2961
3587
|
this.targetProperty = targetProperty;
|
|
@@ -2972,7 +3598,21 @@ var Animation = class Animation {
|
|
|
2972
3598
|
getHighestFrame() {
|
|
2973
3599
|
return this._keys.length > 0 ? this._keys[this._keys.length - 1].frame : 0;
|
|
2974
3600
|
}
|
|
2975
|
-
/**
|
|
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. */
|
|
2976
3616
|
evaluate(frame) {
|
|
2977
3617
|
const keys = this._keys;
|
|
2978
3618
|
if (keys.length === 0) return 0;
|
|
@@ -2983,8 +3623,8 @@ var Animation = class Animation {
|
|
|
2983
3623
|
const b = keys[i + 1];
|
|
2984
3624
|
if (frame >= a.frame && frame < b.frame) {
|
|
2985
3625
|
if (a.interpolation === AnimationKeyInterpolation.STEP) return a.value;
|
|
2986
|
-
const
|
|
2987
|
-
return
|
|
3626
|
+
const gradient = (frame - a.frame) / (b.frame - a.frame);
|
|
3627
|
+
return interpolateValue(a.value, b.value, this._easingFunction?.ease(gradient) ?? gradient, this.dataType);
|
|
2988
3628
|
}
|
|
2989
3629
|
}
|
|
2990
3630
|
return keys[keys.length - 1].value;
|
|
@@ -3002,23 +3642,78 @@ var Animation = class Animation {
|
|
|
3002
3642
|
return anim;
|
|
3003
3643
|
}
|
|
3004
3644
|
};
|
|
3005
|
-
function
|
|
3645
|
+
function interpolateValue(a, b, t, dataType) {
|
|
3006
3646
|
if (typeof a === "number" && typeof b === "number") return a + (b - a) * t;
|
|
3007
|
-
|
|
3008
|
-
const
|
|
3009
|
-
|
|
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
|
+
];
|
|
3010
3701
|
}
|
|
3011
3702
|
function scaleValue(value, scale) {
|
|
3012
|
-
|
|
3703
|
+
if (typeof value === "number") return value * scale;
|
|
3704
|
+
return animationComponents(value).map((component) => component * scale);
|
|
3013
3705
|
}
|
|
3014
3706
|
function addValue(acc, value) {
|
|
3015
3707
|
if (typeof acc === "number" && typeof value === "number") return acc + value;
|
|
3016
|
-
const a = acc;
|
|
3017
|
-
const v = value;
|
|
3018
|
-
return a.map((
|
|
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));
|
|
3019
3714
|
}
|
|
3020
3715
|
function zeroLike(value) {
|
|
3021
|
-
return typeof value === "number" ? 0 : value.map(() => 0);
|
|
3716
|
+
return typeof value === "number" ? 0 : animationComponents(value).map(() => 0);
|
|
3022
3717
|
}
|
|
3023
3718
|
/**
|
|
3024
3719
|
* @internal Pre-animation baseline of each blended property, captured the first
|
|
@@ -3036,7 +3731,7 @@ function readPath(target, path) {
|
|
|
3036
3731
|
obj = next;
|
|
3037
3732
|
}
|
|
3038
3733
|
const leaf = obj[parts[parts.length - 1]];
|
|
3039
|
-
return
|
|
3734
|
+
return isAnimationValue(leaf) ? leaf : 0;
|
|
3040
3735
|
}
|
|
3041
3736
|
function captureOriginal(target, path) {
|
|
3042
3737
|
let perTarget = structuralOriginals.get(target);
|
|
@@ -3044,7 +3739,11 @@ function captureOriginal(target, path) {
|
|
|
3044
3739
|
perTarget = /* @__PURE__ */ new Map();
|
|
3045
3740
|
structuralOriginals.set(target, perTarget);
|
|
3046
3741
|
}
|
|
3047
|
-
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));
|
|
3048
3747
|
}
|
|
3049
3748
|
/** @internal Assign an animated value to `target` following a dotted property path (e.g. `"position.x"`). */
|
|
3050
3749
|
function applyAnimatedValue(target, path, value) {
|
|
@@ -3056,75 +3755,371 @@ function applyAnimatedValue(target, path, value) {
|
|
|
3056
3755
|
obj = next;
|
|
3057
3756
|
}
|
|
3058
3757
|
const leaf = parts[parts.length - 1];
|
|
3059
|
-
if (
|
|
3758
|
+
if (typeof value !== "number") {
|
|
3759
|
+
const components = animationComponents(value);
|
|
3060
3760
|
const slot = obj[leaf];
|
|
3061
|
-
if (slot && typeof slot.set === "function") slot.set(...
|
|
3761
|
+
if (slot && typeof slot.set === "function") slot.set(...components);
|
|
3062
3762
|
else obj[leaf] = value;
|
|
3063
3763
|
} else obj[leaf] = value;
|
|
3064
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
|
+
}
|
|
3065
3771
|
/**
|
|
3066
|
-
* Babylon.js `Animatable`
|
|
3067
|
-
*
|
|
3068
|
-
* 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.
|
|
3069
3774
|
*/
|
|
3070
|
-
var Animatable = class {
|
|
3775
|
+
var Animatable = class Animatable {
|
|
3071
3776
|
_target;
|
|
3072
3777
|
_animations;
|
|
3073
3778
|
_from;
|
|
3074
3779
|
_to;
|
|
3075
3780
|
_loop;
|
|
3076
3781
|
masterFrame = 0;
|
|
3077
|
-
|
|
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;
|
|
3078
3787
|
_paused = false;
|
|
3079
3788
|
_stopped = false;
|
|
3080
|
-
|
|
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) {
|
|
3081
3796
|
this._target = _target;
|
|
3082
3797
|
this._animations = _animations;
|
|
3083
3798
|
this._from = _from;
|
|
3084
3799
|
this._to = _to;
|
|
3085
3800
|
this._loop = _loop;
|
|
3086
|
-
this.
|
|
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;
|
|
3087
3806
|
this.masterFrame = _from;
|
|
3088
|
-
this.
|
|
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;
|
|
3089
3842
|
}
|
|
3090
3843
|
/** @internal Advance the animation by `deltaMs`, called once per scene frame. */
|
|
3091
3844
|
_tick(deltaMs) {
|
|
3092
3845
|
if (this._paused || this._stopped) return;
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
this.
|
|
3099
|
-
} else {
|
|
3100
|
-
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();
|
|
3101
3852
|
this._stopped = true;
|
|
3102
3853
|
}
|
|
3854
|
+
return;
|
|
3103
3855
|
}
|
|
3104
|
-
this.
|
|
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;
|
|
3105
3860
|
}
|
|
3106
3861
|
goToFrame(frame) {
|
|
3107
|
-
this.
|
|
3108
|
-
this.
|
|
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();
|
|
3109
3870
|
}
|
|
3110
3871
|
pause() {
|
|
3111
3872
|
this._paused = true;
|
|
3873
|
+
if (this._lite) {
|
|
3874
|
+
pauseAnimation(this._lite);
|
|
3875
|
+
this._detachLite();
|
|
3876
|
+
}
|
|
3112
3877
|
}
|
|
3113
3878
|
restart() {
|
|
3879
|
+
const restartFromBeginning = this._stopped;
|
|
3114
3880
|
this._paused = false;
|
|
3115
3881
|
this._stopped = false;
|
|
3116
|
-
|
|
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();
|
|
3117
3893
|
}
|
|
3118
3894
|
stop() {
|
|
3895
|
+
this._paused = false;
|
|
3119
3896
|
this._stopped = true;
|
|
3897
|
+
if (this._lite) {
|
|
3898
|
+
stopAnimation(this._lite);
|
|
3899
|
+
this._detachLite();
|
|
3900
|
+
}
|
|
3120
3901
|
}
|
|
3121
3902
|
get animationStarted() {
|
|
3122
|
-
return !this._stopped;
|
|
3903
|
+
return !this._paused && !this._stopped;
|
|
3123
3904
|
}
|
|
3124
|
-
|
|
3125
|
-
for (const anim of this.
|
|
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);
|
|
3126
3961
|
}
|
|
3127
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
|
+
}
|
|
3128
4123
|
/**
|
|
3129
4124
|
* Babylon.js `AnimationGroup` — a named collection of targeted animations with
|
|
3130
4125
|
* playback state. This is the **single** `AnimationGroup` type, matching Babylon.js;
|
|
@@ -3457,22 +4452,22 @@ var ImageProcessingConfiguration = class {
|
|
|
3457
4452
|
return false;
|
|
3458
4453
|
}
|
|
3459
4454
|
set whiteBalanceEnabled(value) {
|
|
3460
|
-
if (value) unsupported("ImageProcessingConfiguration.whiteBalanceEnabled", WHITE_BALANCE_UNSUPPORTED
|
|
4455
|
+
if (value) unsupported("ImageProcessingConfiguration.whiteBalanceEnabled", WHITE_BALANCE_UNSUPPORTED);
|
|
3461
4456
|
}
|
|
3462
4457
|
get temperature() {
|
|
3463
4458
|
return 6500;
|
|
3464
4459
|
}
|
|
3465
4460
|
set temperature(value) {
|
|
3466
|
-
if (value !== 6500) unsupported("ImageProcessingConfiguration.temperature", WHITE_BALANCE_UNSUPPORTED
|
|
4461
|
+
if (value !== 6500) unsupported("ImageProcessingConfiguration.temperature", WHITE_BALANCE_UNSUPPORTED);
|
|
3467
4462
|
}
|
|
3468
4463
|
get tint() {
|
|
3469
4464
|
return 0;
|
|
3470
4465
|
}
|
|
3471
4466
|
set tint(value) {
|
|
3472
|
-
if (value !== 0) unsupported("ImageProcessingConfiguration.tint", WHITE_BALANCE_UNSUPPORTED
|
|
4467
|
+
if (value !== 0) unsupported("ImageProcessingConfiguration.tint", WHITE_BALANCE_UNSUPPORTED);
|
|
3473
4468
|
}
|
|
3474
4469
|
};
|
|
3475
|
-
var WHITE_BALANCE_UNSUPPORTED
|
|
4470
|
+
var WHITE_BALANCE_UNSUPPORTED = "White balance requires color-temperature math, a shader uniform, material/post-process defines, and pipeline invalidation that Babylon Lite does not expose; adding it needs a cross-cutting Lite subsystem design.";
|
|
3476
4471
|
/** Babylon.js pure-module registration hook. */
|
|
3477
4472
|
function RegisterImageProcessingConfiguration() {
|
|
3478
4473
|
return unsupported("RegisterImageProcessingConfiguration", "Babylon Lite has no Babylon.js SerializationHelper parser registry to install ImageProcessingConfiguration into.");
|
|
@@ -3482,6 +4477,10 @@ function RegisterImageProcessingConfiguration() {
|
|
|
3482
4477
|
* supported texture formats directly, so no registration is required.
|
|
3483
4478
|
*/
|
|
3484
4479
|
function RegisterAbstractEngineTextureLoaders() {}
|
|
4480
|
+
/** Pure-build registration shim; compat wires the Lite array upload directly. */
|
|
4481
|
+
function RegisterEnginesExtensionsEngineTexture2DArrayImageSource() {}
|
|
4482
|
+
/** WebGPU pure-build registration shim; Babylon Lite is WebGPU-only. */
|
|
4483
|
+
function RegisterEnginesWebGPUExtensionsEngineTexture2DArrayImageSource() {}
|
|
3485
4484
|
/**
|
|
3486
4485
|
* Babylon.js `Constants` — the small subset of numeric constants referenced by
|
|
3487
4486
|
* the ported scenes. Extend as needed.
|
|
@@ -3508,7 +4507,15 @@ var Constants = {
|
|
|
3508
4507
|
TEXTURE_BILINEAR_SAMPLINGMODE: 2,
|
|
3509
4508
|
TEXTURE_TRILINEAR_SAMPLINGMODE: 3,
|
|
3510
4509
|
TEXTUREFORMAT_RGBA: 5,
|
|
3511
|
-
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
|
|
3512
4519
|
};
|
|
3513
4520
|
//#endregion
|
|
3514
4521
|
//#region src/events/pointer-events.ts
|
|
@@ -3596,8 +4603,8 @@ var Scene = class Scene extends AbstractScene {
|
|
|
3596
4603
|
* Babylon.js `scene.animationGroups` / `scene.animatables`. Loaded glTF /
|
|
3597
4604
|
* `.babylon` animation clips live on the Lite scene; `animationGroups` returns
|
|
3598
4605
|
* BJS-shaped `AnimationGroup`s over them (so scenes can `goToFrame`/`pause`/`stop`
|
|
3599
|
-
* to freeze a model at a deterministic frame). `animatables` surfaces the
|
|
3600
|
-
*
|
|
4606
|
+
* to freeze a model at a deterministic frame). `animatables` surfaces the
|
|
4607
|
+
* native-backed and fallback `Animatable`s started through the scene.
|
|
3601
4608
|
*/
|
|
3602
4609
|
get animationGroups() {
|
|
3603
4610
|
return (this._lite.animationGroups ?? []).map((g) => {
|
|
@@ -3641,7 +4648,11 @@ var Scene = class Scene extends AbstractScene {
|
|
|
3641
4648
|
_pendingTextures = [];
|
|
3642
4649
|
_pendingGroundBakes = [];
|
|
3643
4650
|
_pendingMorphBuilds = [];
|
|
4651
|
+
_materialPluginsRequested = false;
|
|
4652
|
+
_pendingMaterialPluginReconciliations = /* @__PURE__ */ new Set();
|
|
3644
4653
|
_runningAnimatables = [];
|
|
4654
|
+
/** @internal Lite manager that owns supported compat property animations. */
|
|
4655
|
+
_propertyAnimationManager = null;
|
|
3645
4656
|
_animationGroupCache = /* @__PURE__ */ new WeakMap();
|
|
3646
4657
|
/** @internal Structural `AnimationGroup`s stepped + weight-blended each frame. */
|
|
3647
4658
|
_structuralGroups = [];
|
|
@@ -3722,6 +4733,7 @@ var Scene = class Scene extends AbstractScene {
|
|
|
3722
4733
|
this._engine._lastDeltaMs = deltaMs;
|
|
3723
4734
|
this.onBeforeAnimationsObservable.notifyObservers(this);
|
|
3724
4735
|
if (this._blendManager) updateAnimationManager(this._blendManager, deltaMs);
|
|
4736
|
+
if (this._propertyAnimationManager) updateAnimationManager(this._propertyAnimationManager, deltaMs);
|
|
3725
4737
|
for (const a of this._runningAnimatables) a._tick(deltaMs);
|
|
3726
4738
|
if (this._structuralGroups.length > 0) {
|
|
3727
4739
|
for (const g of this._structuralGroups) g._advanceStructural(deltaMs);
|
|
@@ -3832,6 +4844,42 @@ var Scene = class Scene extends AbstractScene {
|
|
|
3832
4844
|
for (const { mesh, manager } of this._pendingMorphBuilds) manager._build(mesh, engine);
|
|
3833
4845
|
this._pendingMorphBuilds.length = 0;
|
|
3834
4846
|
}
|
|
4847
|
+
/**
|
|
4848
|
+
* @internal Request Lite's opt-in material-plugin bridges for this scene.
|
|
4849
|
+
* Once the engine is live, reconcile the changed material through Lite's
|
|
4850
|
+
* runtime rebuild path rather than leaving the startup-only request stranded.
|
|
4851
|
+
*/
|
|
4852
|
+
_requestMaterialPlugins(material) {
|
|
4853
|
+
this._materialPluginsRequested = true;
|
|
4854
|
+
if (material && this._engine._hasStarted) this._engine._registerLateWork(async () => {
|
|
4855
|
+
const { reconcileMaterialPlugins } = await import("@babylonjs/lite");
|
|
4856
|
+
await reconcileMaterialPlugins(this._lite, material);
|
|
4857
|
+
});
|
|
4858
|
+
else if (material && this._started) this._pendingMaterialPluginReconciliations.add(material);
|
|
4859
|
+
}
|
|
4860
|
+
/** @internal Enable requested material plugins after meshes are added and before scene registration. */
|
|
4861
|
+
async _enableMaterialPlugins() {
|
|
4862
|
+
if (this._materialPluginsRequested) {
|
|
4863
|
+
const { enableMaterialPlugins } = await import("@babylonjs/lite");
|
|
4864
|
+
enableMaterialPlugins(this._lite);
|
|
4865
|
+
this._materialPluginsRequested = false;
|
|
4866
|
+
this._pendingMaterialPluginReconciliations.clear();
|
|
4867
|
+
}
|
|
4868
|
+
}
|
|
4869
|
+
/** @internal Reconcile plugin requests raised by first-frame callbacks before engine startup completes. */
|
|
4870
|
+
async _reconcilePendingMaterialPlugins() {
|
|
4871
|
+
while (this._pendingMaterialPluginReconciliations.size > 0) {
|
|
4872
|
+
const materials = [...this._pendingMaterialPluginReconciliations];
|
|
4873
|
+
this._pendingMaterialPluginReconciliations.clear();
|
|
4874
|
+
const { reconcileMaterialPlugins } = await import("@babylonjs/lite");
|
|
4875
|
+
await Promise.all(materials.map((material) => reconcileMaterialPlugins(this._lite, material)));
|
|
4876
|
+
}
|
|
4877
|
+
this._materialPluginsRequested = false;
|
|
4878
|
+
}
|
|
4879
|
+
/** @internal Whether this scene queued plugin changes during the engine startup transition. */
|
|
4880
|
+
get _hasPendingMaterialPluginReconciliations() {
|
|
4881
|
+
return this._pendingMaterialPluginReconciliations.size > 0;
|
|
4882
|
+
}
|
|
3835
4883
|
/** @internal Clustered light containers to register on the Lite scene at engine start. */
|
|
3836
4884
|
_pendingClusteredContainers = [];
|
|
3837
4885
|
/** @internal Register a compat `ClusteredLightContainer` to be wired into the scene at engine start. */
|
|
@@ -3900,6 +4948,7 @@ var Scene = class Scene extends AbstractScene {
|
|
|
3900
4948
|
}
|
|
3901
4949
|
set defaultMaterial(value) {
|
|
3902
4950
|
this._defaultMaterial = value;
|
|
4951
|
+
value?._adoptScene(this);
|
|
3903
4952
|
}
|
|
3904
4953
|
get clearColor() {
|
|
3905
4954
|
const c = this._lite.clearColor;
|
|
@@ -4317,11 +5366,18 @@ var Scene = class Scene extends AbstractScene {
|
|
|
4317
5366
|
}
|
|
4318
5367
|
/**
|
|
4319
5368
|
* Babylon.js `scene.beginDirectAnimation(target, animations, from, to, loop, speedRatio?)`.
|
|
4320
|
-
*
|
|
4321
|
-
*
|
|
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.
|
|
4322
5372
|
*/
|
|
4323
5373
|
beginDirectAnimation(target, animations, from, to, loop = false, speedRatio = 1) {
|
|
4324
|
-
|
|
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);
|
|
4325
5381
|
this._runningAnimatables.push(animatable);
|
|
4326
5382
|
return animatable;
|
|
4327
5383
|
}
|
|
@@ -4370,6 +5426,9 @@ var Scene = class Scene extends AbstractScene {
|
|
|
4370
5426
|
this.onDisposeObservable.notifyObservers(this);
|
|
4371
5427
|
this.onPointerObservable.clear();
|
|
4372
5428
|
this._beforeRenderFlushCallbacks.clear();
|
|
5429
|
+
if (this._propertyAnimationManager) clearAnimationManager(this._propertyAnimationManager);
|
|
5430
|
+
if (this._blendManager) clearAnimationManager(this._blendManager);
|
|
5431
|
+
this._runningAnimatables.length = 0;
|
|
4373
5432
|
disposeScene(this._lite);
|
|
4374
5433
|
}
|
|
4375
5434
|
};
|
|
@@ -4383,11 +5442,11 @@ var Scene = class Scene extends AbstractScene {
|
|
|
4383
5442
|
* wrappers do the same by calling `addToScene` when a scene is supplied. The
|
|
4384
5443
|
* underlying Lite light is exposed as `_lite` for advanced interop.
|
|
4385
5444
|
*
|
|
4386
|
-
*
|
|
4387
|
-
*
|
|
4388
|
-
*
|
|
4389
|
-
*
|
|
4390
|
-
* and
|
|
5445
|
+
* As in Babylon.js, the getters hand out the light's own live objects, so both assignment
|
|
5446
|
+
* (`light.diffuse = new Color3(...)`) and in-place edits (`light.diffuse.copyFrom(c)`,
|
|
5447
|
+
* `light.direction.set(x, y, z)`, `light.position.y = 2`) reach the Lite light. Direction and
|
|
5448
|
+
* position are proxies over Lite's observable vectors; colours are proxies over the Lite colour
|
|
5449
|
+
* tuples, and every colour write bumps the light version so it reaches the lights UBO.
|
|
4391
5450
|
*/
|
|
4392
5451
|
/** Babylon.js `Light` — base class for all lights (derives from `Node`). */
|
|
4393
5452
|
var Light = class extends Node {
|
|
@@ -4438,6 +5497,21 @@ var Light = class extends Node {
|
|
|
4438
5497
|
this._liteVersionBump();
|
|
4439
5498
|
}
|
|
4440
5499
|
/**
|
|
5500
|
+
* @internal Babylon.js hands out the light's own `Color3`, so `light.diffuse.copyFrom(c)` or
|
|
5501
|
+
* `light.specular.set(0, 0, 0)` edits the light. Return a live proxy over the Lite tuple rather than a
|
|
5502
|
+
* copy (whose edits were silently dropped); a colour write cannot notify Lite, so it bumps the version.
|
|
5503
|
+
*/
|
|
5504
|
+
_liveColor(tuple) {
|
|
5505
|
+
return liteBackedColor3(tuple, () => this._bumpLiteVersion());
|
|
5506
|
+
}
|
|
5507
|
+
/** @internal Assign a colour and publish it (a tuple write cannot notify Lite by itself). */
|
|
5508
|
+
_writeColor(tuple, value) {
|
|
5509
|
+
tuple[0] = value.r;
|
|
5510
|
+
tuple[1] = value.g;
|
|
5511
|
+
tuple[2] = value.b;
|
|
5512
|
+
this._bumpLiteVersion();
|
|
5513
|
+
}
|
|
5514
|
+
/**
|
|
4441
5515
|
* Babylon.js `light.intensity`. While the light is disabled the Lite light
|
|
4442
5516
|
* carries `0`, but the getter still returns the logical value the caller set.
|
|
4443
5517
|
*/
|
|
@@ -4500,17 +5574,6 @@ function ensureLightVersionBump(lite) {
|
|
|
4500
5574
|
});
|
|
4501
5575
|
return bump;
|
|
4502
5576
|
}
|
|
4503
|
-
function readColor(tuple) {
|
|
4504
|
-
return new Color3(tuple[0], tuple[1], tuple[2]);
|
|
4505
|
-
}
|
|
4506
|
-
function writeColor(tuple, value) {
|
|
4507
|
-
tuple[0] = value.r;
|
|
4508
|
-
tuple[1] = value.g;
|
|
4509
|
-
tuple[2] = value.b;
|
|
4510
|
-
}
|
|
4511
|
-
function readVector(vec) {
|
|
4512
|
-
return new Vector3(vec.x, vec.y, vec.z);
|
|
4513
|
-
}
|
|
4514
5577
|
var HemisphericLight = class extends Light {
|
|
4515
5578
|
/** @internal Underlying Babylon Lite hemispheric light. */
|
|
4516
5579
|
_lite;
|
|
@@ -4523,28 +5586,28 @@ var HemisphericLight = class extends Light {
|
|
|
4523
5586
|
return "HemisphericLight";
|
|
4524
5587
|
}
|
|
4525
5588
|
get direction() {
|
|
4526
|
-
return
|
|
5589
|
+
return liteBackedVector3(this._lite.direction);
|
|
4527
5590
|
}
|
|
4528
5591
|
set direction(value) {
|
|
4529
5592
|
this._lite.direction.set(value.x, value.y, value.z);
|
|
4530
5593
|
}
|
|
4531
5594
|
get diffuse() {
|
|
4532
|
-
return
|
|
5595
|
+
return this._liveColor(this._lite.diffuseColor);
|
|
4533
5596
|
}
|
|
4534
5597
|
set diffuse(value) {
|
|
4535
|
-
|
|
5598
|
+
this._writeColor(this._lite.diffuseColor, value);
|
|
4536
5599
|
}
|
|
4537
5600
|
get specular() {
|
|
4538
|
-
return
|
|
5601
|
+
return this._liveColor(this._lite.specularColor);
|
|
4539
5602
|
}
|
|
4540
5603
|
set specular(value) {
|
|
4541
|
-
|
|
5604
|
+
this._writeColor(this._lite.specularColor, value);
|
|
4542
5605
|
}
|
|
4543
5606
|
get groundColor() {
|
|
4544
|
-
return
|
|
5607
|
+
return this._liveColor(this._lite.groundColor);
|
|
4545
5608
|
}
|
|
4546
5609
|
set groundColor(value) {
|
|
4547
|
-
|
|
5610
|
+
this._writeColor(this._lite.groundColor, value);
|
|
4548
5611
|
}
|
|
4549
5612
|
};
|
|
4550
5613
|
var DirectionalLight = class extends Light {
|
|
@@ -4559,28 +5622,28 @@ var DirectionalLight = class extends Light {
|
|
|
4559
5622
|
return "DirectionalLight";
|
|
4560
5623
|
}
|
|
4561
5624
|
get direction() {
|
|
4562
|
-
return
|
|
5625
|
+
return liteBackedVector3(this._lite.direction);
|
|
4563
5626
|
}
|
|
4564
5627
|
set direction(value) {
|
|
4565
5628
|
this._lite.direction.set(value.x, value.y, value.z);
|
|
4566
5629
|
}
|
|
4567
5630
|
get position() {
|
|
4568
|
-
return
|
|
5631
|
+
return liteBackedVector3(this._lite.position);
|
|
4569
5632
|
}
|
|
4570
5633
|
set position(value) {
|
|
4571
5634
|
this._lite.position.set(value.x, value.y, value.z);
|
|
4572
5635
|
}
|
|
4573
5636
|
get diffuse() {
|
|
4574
|
-
return
|
|
5637
|
+
return this._liveColor(this._lite.diffuse);
|
|
4575
5638
|
}
|
|
4576
5639
|
set diffuse(value) {
|
|
4577
|
-
|
|
5640
|
+
this._writeColor(this._lite.diffuse, value);
|
|
4578
5641
|
}
|
|
4579
5642
|
get specular() {
|
|
4580
|
-
return
|
|
5643
|
+
return this._liveColor(this._lite.specular);
|
|
4581
5644
|
}
|
|
4582
5645
|
set specular(value) {
|
|
4583
|
-
|
|
5646
|
+
this._writeColor(this._lite.specular, value);
|
|
4584
5647
|
}
|
|
4585
5648
|
};
|
|
4586
5649
|
var PointLight = class extends Light {
|
|
@@ -4601,22 +5664,22 @@ var PointLight = class extends Light {
|
|
|
4601
5664
|
this._lite.range = value;
|
|
4602
5665
|
}
|
|
4603
5666
|
get position() {
|
|
4604
|
-
return
|
|
5667
|
+
return liteBackedVector3(this._lite.position);
|
|
4605
5668
|
}
|
|
4606
5669
|
set position(value) {
|
|
4607
5670
|
this._lite.position.set(value.x, value.y, value.z);
|
|
4608
5671
|
}
|
|
4609
5672
|
get diffuse() {
|
|
4610
|
-
return
|
|
5673
|
+
return this._liveColor(this._lite.diffuse);
|
|
4611
5674
|
}
|
|
4612
5675
|
set diffuse(value) {
|
|
4613
|
-
|
|
5676
|
+
this._writeColor(this._lite.diffuse, value);
|
|
4614
5677
|
}
|
|
4615
5678
|
get specular() {
|
|
4616
|
-
return
|
|
5679
|
+
return this._liveColor(this._lite.specular);
|
|
4617
5680
|
}
|
|
4618
5681
|
set specular(value) {
|
|
4619
|
-
|
|
5682
|
+
this._writeColor(this._lite.specular, value);
|
|
4620
5683
|
}
|
|
4621
5684
|
};
|
|
4622
5685
|
var SpotLight = class extends Light {
|
|
@@ -4649,28 +5712,28 @@ var SpotLight = class extends Light {
|
|
|
4649
5712
|
this._lite.range = value;
|
|
4650
5713
|
}
|
|
4651
5714
|
get position() {
|
|
4652
|
-
return
|
|
5715
|
+
return liteBackedVector3(this._lite.position);
|
|
4653
5716
|
}
|
|
4654
5717
|
set position(value) {
|
|
4655
5718
|
this._lite.position.set(value.x, value.y, value.z);
|
|
4656
5719
|
}
|
|
4657
5720
|
get direction() {
|
|
4658
|
-
return
|
|
5721
|
+
return liteBackedVector3(this._lite.direction);
|
|
4659
5722
|
}
|
|
4660
5723
|
set direction(value) {
|
|
4661
5724
|
this._lite.direction.set(value.x, value.y, value.z);
|
|
4662
5725
|
}
|
|
4663
5726
|
get diffuse() {
|
|
4664
|
-
return
|
|
5727
|
+
return this._liveColor(this._lite.diffuse);
|
|
4665
5728
|
}
|
|
4666
5729
|
set diffuse(value) {
|
|
4667
|
-
|
|
5730
|
+
this._writeColor(this._lite.diffuse, value);
|
|
4668
5731
|
}
|
|
4669
5732
|
get specular() {
|
|
4670
|
-
return
|
|
5733
|
+
return this._liveColor(this._lite.specular);
|
|
4671
5734
|
}
|
|
4672
5735
|
set specular(value) {
|
|
4673
|
-
|
|
5736
|
+
this._writeColor(this._lite.specular, value);
|
|
4674
5737
|
}
|
|
4675
5738
|
};
|
|
4676
5739
|
//#endregion
|
|
@@ -4902,17 +5965,6 @@ var ClusteredLightContainer = class ClusteredLightContainer extends Light {
|
|
|
4902
5965
|
* so positioning the result moves them together — matching Babylon.js's single
|
|
4903
5966
|
* multi-material `toMesh` return.
|
|
4904
5967
|
*/
|
|
4905
|
-
/** @internal Add a freshly-built CSG result mesh to its scene at engine start. */
|
|
4906
|
-
function deferAddCsgMesh(mesh, scene, material) {
|
|
4907
|
-
scene._deferAdd(() => {
|
|
4908
|
-
const engine = scene.getEngine()._lite;
|
|
4909
|
-
if (material) {
|
|
4910
|
-
material._ensureRenderable(engine);
|
|
4911
|
-
mesh._lite.material = material._lite;
|
|
4912
|
-
}
|
|
4913
|
-
addToScene(scene._lite, mesh._lite);
|
|
4914
|
-
});
|
|
4915
|
-
}
|
|
4916
5968
|
/**
|
|
4917
5969
|
* Babylon.js `CSG` — legacy constructive solid geometry. Build from a mesh with
|
|
4918
5970
|
* {@link FromMesh}, combine with {@link subtract} / {@link intersect} /
|
|
@@ -4944,8 +5996,8 @@ var CSG = class CSG {
|
|
|
4944
5996
|
const engine = scene.getEngine()._lite;
|
|
4945
5997
|
const lite = createMeshFromCsg(engine, this._lite, name);
|
|
4946
5998
|
const mesh = new Mesh(name, lite, scene);
|
|
4947
|
-
|
|
4948
|
-
return mesh;
|
|
5999
|
+
if (material) mesh.material = material;
|
|
6000
|
+
return registerMeshAtStart(mesh, scene);
|
|
4949
6001
|
}
|
|
4950
6002
|
};
|
|
4951
6003
|
/** Module-wide unique material-slot counter for CSG2 (`MATERIAL_ID_RESERVE_COUNT` = 65536). */
|
|
@@ -4993,14 +6045,22 @@ var CSG2 = class CSG2 {
|
|
|
4993
6045
|
const engine = scene.getEngine()._lite;
|
|
4994
6046
|
const materials = [];
|
|
4995
6047
|
for (const [slot, material] of this._materials) {
|
|
4996
|
-
material
|
|
6048
|
+
attachMaterialToScene(material, scene);
|
|
4997
6049
|
materials[slot] = material._lite;
|
|
4998
6050
|
}
|
|
4999
6051
|
const liteMeshes = createMeshesFromCsg2(engine, this._lite, materials, name);
|
|
5000
6052
|
const savedMaterials = liteMeshes.map((m) => m.material);
|
|
5001
6053
|
const root = new Mesh(name, liteMeshes[0], scene);
|
|
6054
|
+
const wrapped = root.material;
|
|
5002
6055
|
root._lite.material = savedMaterials[0];
|
|
5003
|
-
scene._deferAdd(() =>
|
|
6056
|
+
scene._deferAdd(() => {
|
|
6057
|
+
const assigned = root.material;
|
|
6058
|
+
if (assigned && assigned !== wrapped) {
|
|
6059
|
+
attachMaterialToScene(assigned, scene);
|
|
6060
|
+
root._lite.material = assigned._lite;
|
|
6061
|
+
}
|
|
6062
|
+
addToScene(scene._lite, root._lite);
|
|
6063
|
+
});
|
|
5004
6064
|
for (let i = 1; i < liteMeshes.length; i++) {
|
|
5005
6065
|
const sub = liteMeshes[i];
|
|
5006
6066
|
sub.material = savedMaterials[i];
|
|
@@ -5313,6 +6373,80 @@ var GaussianSplattingMesh = class GaussianSplattingMesh extends TransformNode {
|
|
|
5313
6373
|
}
|
|
5314
6374
|
};
|
|
5315
6375
|
//#endregion
|
|
6376
|
+
//#region src/meshes/mesh-blending.ts
|
|
6377
|
+
var MeshBlendingRadiusClass = /* @__PURE__ */ function(MeshBlendingRadiusClass) {
|
|
6378
|
+
MeshBlendingRadiusClass[MeshBlendingRadiusClass["Small"] = 0] = "Small";
|
|
6379
|
+
MeshBlendingRadiusClass[MeshBlendingRadiusClass["Medium"] = 1] = "Medium";
|
|
6380
|
+
MeshBlendingRadiusClass[MeshBlendingRadiusClass["Large"] = 2] = "Large";
|
|
6381
|
+
MeshBlendingRadiusClass[MeshBlendingRadiusClass["ExtraLarge"] = 3] = "ExtraLarge";
|
|
6382
|
+
return MeshBlendingRadiusClass;
|
|
6383
|
+
}({});
|
|
6384
|
+
function PackMeshBlendingTag(groupId, radiusClass) {
|
|
6385
|
+
return packMeshBlendingTag(groupId, radiusClass);
|
|
6386
|
+
}
|
|
6387
|
+
function UnpackMeshBlendingTag(tag) {
|
|
6388
|
+
const unpacked = unpackMeshBlendingTag(tag);
|
|
6389
|
+
return {
|
|
6390
|
+
groupId: unpacked.groupId,
|
|
6391
|
+
radiusClass: unpacked.radiusClass
|
|
6392
|
+
};
|
|
6393
|
+
}
|
|
6394
|
+
var MeshBlendQuality = /* @__PURE__ */ function(MeshBlendQuality) {
|
|
6395
|
+
MeshBlendQuality[MeshBlendQuality["Low"] = 0] = "Low";
|
|
6396
|
+
MeshBlendQuality[MeshBlendQuality["Medium"] = 1] = "Medium";
|
|
6397
|
+
MeshBlendQuality[MeshBlendQuality["High"] = 2] = "High";
|
|
6398
|
+
MeshBlendQuality[MeshBlendQuality["Cinematic"] = 3] = "Cinematic";
|
|
6399
|
+
return MeshBlendQuality;
|
|
6400
|
+
}({});
|
|
6401
|
+
var MeshBlendDebugMode = /* @__PURE__ */ function(MeshBlendDebugMode) {
|
|
6402
|
+
MeshBlendDebugMode[MeshBlendDebugMode["Off"] = 0] = "Off";
|
|
6403
|
+
MeshBlendDebugMode[MeshBlendDebugMode["PackedTag"] = 1] = "PackedTag";
|
|
6404
|
+
MeshBlendDebugMode[MeshBlendDebugMode["CandidateDirectionDistance"] = 2] = "CandidateDirectionDistance";
|
|
6405
|
+
MeshBlendDebugMode[MeshBlendDebugMode["SeamFade"] = 3] = "SeamFade";
|
|
6406
|
+
MeshBlendDebugMode[MeshBlendDebugMode["RejectionReason"] = 4] = "RejectionReason";
|
|
6407
|
+
MeshBlendDebugMode[MeshBlendDebugMode["StageWork"] = 5] = "StageWork";
|
|
6408
|
+
MeshBlendDebugMode[MeshBlendDebugMode["Continuation"] = 6] = "Continuation";
|
|
6409
|
+
MeshBlendDebugMode[MeshBlendDebugMode["TinyObject"] = 7] = "TinyObject";
|
|
6410
|
+
MeshBlendDebugMode[MeshBlendDebugMode["MultiTarget"] = 8] = "MultiTarget";
|
|
6411
|
+
MeshBlendDebugMode[MeshBlendDebugMode["TargetColor"] = 9] = "TargetColor";
|
|
6412
|
+
MeshBlendDebugMode[MeshBlendDebugMode["ShadowAttenuation"] = 10] = "ShadowAttenuation";
|
|
6413
|
+
MeshBlendDebugMode[MeshBlendDebugMode["ColorInterpolation"] = 11] = "ColorInterpolation";
|
|
6414
|
+
MeshBlendDebugMode[MeshBlendDebugMode["WorldPosition"] = 12] = "WorldPosition";
|
|
6415
|
+
return MeshBlendDebugMode;
|
|
6416
|
+
}({});
|
|
6417
|
+
var MeshBlendDepthType = /* @__PURE__ */ function(MeshBlendDepthType) {
|
|
6418
|
+
MeshBlendDepthType[MeshBlendDepthType["View"] = 0] = "View";
|
|
6419
|
+
MeshBlendDepthType[MeshBlendDepthType["Screen"] = 1] = "Screen";
|
|
6420
|
+
return MeshBlendDepthType;
|
|
6421
|
+
}({});
|
|
6422
|
+
function CreateDefaultMeshBlendRadiusDefinitions() {
|
|
6423
|
+
return createDefaultMeshBlendRadiusDefinitions();
|
|
6424
|
+
}
|
|
6425
|
+
var MESH_BLENDING_BLOCKER = "Babylon Lite supports mesh blending through its native createMeshBlendingPostProcessTask API; the Babylon.js post-process, frame-graph, and node-render-graph wrapper classes are not implemented by the compat layer.";
|
|
6426
|
+
var ThinMeshBlendingPostProcess = class {
|
|
6427
|
+
constructor(..._args) {
|
|
6428
|
+
unsupported("ThinMeshBlendingPostProcess", MESH_BLENDING_BLOCKER);
|
|
6429
|
+
}
|
|
6430
|
+
};
|
|
6431
|
+
var MeshBlendingPostProcess = class {
|
|
6432
|
+
constructor(..._args) {
|
|
6433
|
+
unsupported("MeshBlendingPostProcess", MESH_BLENDING_BLOCKER);
|
|
6434
|
+
}
|
|
6435
|
+
};
|
|
6436
|
+
var FrameGraphMeshBlendingTask = class {
|
|
6437
|
+
constructor(..._args) {
|
|
6438
|
+
unsupported("FrameGraphMeshBlendingTask", MESH_BLENDING_BLOCKER);
|
|
6439
|
+
}
|
|
6440
|
+
};
|
|
6441
|
+
var NodeRenderGraphMeshBlendingPostProcessBlock = class {
|
|
6442
|
+
constructor(..._args) {
|
|
6443
|
+
unsupported("NodeRenderGraphMeshBlendingPostProcessBlock", MESH_BLENDING_BLOCKER);
|
|
6444
|
+
}
|
|
6445
|
+
};
|
|
6446
|
+
function RegisterMeshBlendingPostProcessBlock() {
|
|
6447
|
+
return unsupported("RegisterMeshBlendingPostProcessBlock", MESH_BLENDING_BLOCKER);
|
|
6448
|
+
}
|
|
6449
|
+
//#endregion
|
|
5316
6450
|
//#region src/textures/textures.ts
|
|
5317
6451
|
/**
|
|
5318
6452
|
* Babylon.js-compatible texture wrappers over Babylon Lite's `loadTexture2D`.
|
|
@@ -7359,6 +8493,10 @@ var SpriteManager = class {
|
|
|
7359
8493
|
addFacingBillboardSystem(scene._lite, system);
|
|
7360
8494
|
});
|
|
7361
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
|
+
}
|
|
7362
8500
|
/** @internal Map the Babylon.js `Constants.ALPHA_*` blend mode to a Lite billboard blend. */
|
|
7363
8501
|
_mapBlendMode() {
|
|
7364
8502
|
if (this.blendMode === ALPHA_ONEONE || this.blendMode === ALPHA_ADD) return billboardBlendAdditive;
|
|
@@ -7567,6 +8705,10 @@ var SpriteRenderer = class {
|
|
|
7567
8705
|
});
|
|
7568
8706
|
});
|
|
7569
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
|
+
}
|
|
7570
8712
|
/** @internal Map the Babylon.js blend mode to a Lite sprite blend descriptor. */
|
|
7571
8713
|
_blend() {
|
|
7572
8714
|
if (this.blendMode === ALPHA_PREMULTIPLIED) return spriteBlendPremultiplied;
|
|
@@ -7741,7 +8883,23 @@ var ShadowGenerator = class {
|
|
|
7741
8883
|
_flushCasterSync() {
|
|
7742
8884
|
if (!this._casterSyncDirty || !this._liteGen) return;
|
|
7743
8885
|
this._casterSyncDirty = false;
|
|
7744
|
-
setShadowTaskCasterMeshes(this._liteGen, this.
|
|
8886
|
+
setShadowTaskCasterMeshes(this._liteGen, this._liteCasterMeshes());
|
|
8887
|
+
}
|
|
8888
|
+
/**
|
|
8889
|
+
* The Lite meshes handed to the native shadow task: every requested caster that carries GPU geometry.
|
|
8890
|
+
* The compat loader wraps a model's complete hierarchy as `Mesh`es, so `addShadowCaster(root, true)`
|
|
8891
|
+
* legitimately collects transform-only roots and intermediate nodes into `renderList`, exactly as
|
|
8892
|
+
* Babylon.js does. Those nodes must not reach the native state: the render task cannot build a
|
|
8893
|
+
* renderable for a mesh without `_gpu` (it would throw inside the frame, every frame), and directional
|
|
8894
|
+
* fitting would substitute default bounds for it, distorting the shadow volume.
|
|
8895
|
+
*/
|
|
8896
|
+
_liteCasterMeshes() {
|
|
8897
|
+
const meshes = [];
|
|
8898
|
+
for (const caster of this._casters) {
|
|
8899
|
+
const lite = caster._lite;
|
|
8900
|
+
if (lite._gpu) meshes.push(lite);
|
|
8901
|
+
}
|
|
8902
|
+
return meshes;
|
|
7745
8903
|
}
|
|
7746
8904
|
/** Babylon.js `getShadowMap()` — returns a minimal render-list holder for parity. */
|
|
7747
8905
|
getShadowMap() {
|
|
@@ -7814,8 +8972,7 @@ var ShadowGenerator = class {
|
|
|
7814
8972
|
liteLight.shadowGenerator = liteGen;
|
|
7815
8973
|
this._liteGen = liteGen;
|
|
7816
8974
|
this._casterSyncDirty = false;
|
|
7817
|
-
|
|
7818
|
-
setShadowTaskCasterMeshes(liteGen, casterMeshes);
|
|
8975
|
+
setShadowTaskCasterMeshes(liteGen, this._liteCasterMeshes());
|
|
7819
8976
|
}
|
|
7820
8977
|
};
|
|
7821
8978
|
/** Babylon.js `CascadedShadowGenerator` backed by Lite's native CSM generator. */
|
|
@@ -8068,10 +9225,10 @@ function GetSupportedSimultaneousLights(scene, maxSimultaneousLights) {
|
|
|
8068
9225
|
//#endregion
|
|
8069
9226
|
//#region src/animations/easing.ts
|
|
8070
9227
|
/**
|
|
8071
|
-
* Babylon.js-compatible easing functions
|
|
9228
|
+
* Babylon.js-compatible easing functions over Babylon Lite's functional curves.
|
|
8072
9229
|
*
|
|
8073
|
-
* These
|
|
8074
|
-
*
|
|
9230
|
+
* These retain Babylon.js's class hierarchy and easing modes for porting while
|
|
9231
|
+
* delegating curve math to tree-shakable native Lite functions.
|
|
8075
9232
|
*/
|
|
8076
9233
|
var EASINGMODE_EASEIN = 0;
|
|
8077
9234
|
var EASINGMODE_EASEOUT = 1;
|
|
@@ -8097,33 +9254,32 @@ var EasingFunction = class {
|
|
|
8097
9254
|
};
|
|
8098
9255
|
var CircleEase = class extends EasingFunction {
|
|
8099
9256
|
easeInCore(gradient) {
|
|
8100
|
-
|
|
8101
|
-
return 1 - Math.sqrt(1 - g * g);
|
|
9257
|
+
return circleEase(gradient);
|
|
8102
9258
|
}
|
|
8103
9259
|
};
|
|
8104
9260
|
var QuadraticEase = class extends EasingFunction {
|
|
8105
9261
|
easeInCore(gradient) {
|
|
8106
|
-
return gradient
|
|
9262
|
+
return quadraticEase(gradient);
|
|
8107
9263
|
}
|
|
8108
9264
|
};
|
|
8109
9265
|
var CubicEase = class extends EasingFunction {
|
|
8110
9266
|
easeInCore(gradient) {
|
|
8111
|
-
return gradient
|
|
9267
|
+
return cubicEase(gradient);
|
|
8112
9268
|
}
|
|
8113
9269
|
};
|
|
8114
9270
|
var QuarticEase = class extends EasingFunction {
|
|
8115
9271
|
easeInCore(gradient) {
|
|
8116
|
-
return gradient
|
|
9272
|
+
return quarticEase(gradient);
|
|
8117
9273
|
}
|
|
8118
9274
|
};
|
|
8119
9275
|
var QuinticEase = class extends EasingFunction {
|
|
8120
9276
|
easeInCore(gradient) {
|
|
8121
|
-
return gradient
|
|
9277
|
+
return quinticEase(gradient);
|
|
8122
9278
|
}
|
|
8123
9279
|
};
|
|
8124
9280
|
var SineEase = class extends EasingFunction {
|
|
8125
9281
|
easeInCore(gradient) {
|
|
8126
|
-
return
|
|
9282
|
+
return sineEase(gradient);
|
|
8127
9283
|
}
|
|
8128
9284
|
};
|
|
8129
9285
|
var ExponentialEase = class extends EasingFunction {
|
|
@@ -8133,8 +9289,7 @@ var ExponentialEase = class extends EasingFunction {
|
|
|
8133
9289
|
this.exponent = exponent;
|
|
8134
9290
|
}
|
|
8135
9291
|
easeInCore(gradient) {
|
|
8136
|
-
|
|
8137
|
-
return (Math.exp(this.exponent * gradient) - 1) / (Math.exp(this.exponent) - 1);
|
|
9292
|
+
return exponentialEase(gradient, this.exponent);
|
|
8138
9293
|
}
|
|
8139
9294
|
};
|
|
8140
9295
|
var BackEase = class extends EasingFunction {
|
|
@@ -8144,8 +9299,7 @@ var BackEase = class extends EasingFunction {
|
|
|
8144
9299
|
this.amplitude = amplitude;
|
|
8145
9300
|
}
|
|
8146
9301
|
easeInCore(gradient) {
|
|
8147
|
-
|
|
8148
|
-
return Math.pow(gradient, 3) - gradient * num * Math.sin(Math.PI * gradient);
|
|
9302
|
+
return backEase(gradient, this.amplitude);
|
|
8149
9303
|
}
|
|
8150
9304
|
};
|
|
8151
9305
|
var ElasticEase = class extends EasingFunction {
|
|
@@ -8157,9 +9311,7 @@ var ElasticEase = class extends EasingFunction {
|
|
|
8157
9311
|
this.springiness = springiness;
|
|
8158
9312
|
}
|
|
8159
9313
|
easeInCore(gradient) {
|
|
8160
|
-
|
|
8161
|
-
const num3 = Math.max(0, this.springiness);
|
|
8162
|
-
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);
|
|
8163
9315
|
}
|
|
8164
9316
|
};
|
|
8165
9317
|
var BounceEase = class extends EasingFunction {
|
|
@@ -8171,21 +9323,39 @@ var BounceEase = class extends EasingFunction {
|
|
|
8171
9323
|
this.bounciness = bounciness;
|
|
8172
9324
|
}
|
|
8173
9325
|
easeInCore(gradient) {
|
|
8174
|
-
|
|
8175
|
-
|
|
8176
|
-
|
|
8177
|
-
|
|
8178
|
-
|
|
8179
|
-
|
|
8180
|
-
|
|
8181
|
-
|
|
8182
|
-
|
|
8183
|
-
|
|
8184
|
-
|
|
8185
|
-
|
|
8186
|
-
|
|
8187
|
-
|
|
8188
|
-
|
|
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);
|
|
8189
9359
|
}
|
|
8190
9360
|
};
|
|
8191
9361
|
//#endregion
|
|
@@ -9581,6 +10751,237 @@ function CreateMicrophoneSoundSourceAsync(name, options, engine) {
|
|
|
9581
10751
|
return resolveEngine(engine).createMicrophoneSoundSourceAsync(name, options);
|
|
9582
10752
|
}
|
|
9583
10753
|
//#endregion
|
|
10754
|
+
//#region src/materials/material-plugin.ts
|
|
10755
|
+
var MATERIAL_PLUGIN_INCLUDES_UNSUPPORTED = "Babylon.js shader includes depend on its ShaderStore include registry and expansion pipeline. Lite has no compatible include registry, and introducing one is a loader/shader-subsystem design rather than adapter translation.";
|
|
10756
|
+
var MATERIAL_PLUGIN_REGEX_UNSUPPORTED = "Regular-expression shader replacement requires access to the composed host shader source. Lite's plugin bridge exposes fixed injection slots only, so adding regex rewriting requires a new Lite shader-composition contract.";
|
|
10757
|
+
var MATERIAL_PLUGIN_HOOKS_UNSUPPORTED = "This Babylon.js plugin overrides hooks outside fixed-slot custom shader code. Executing those hooks requires Babylon.js-compatible define, uniform-buffer, sampler, texture, mesh-attribute, or render-target bridge contracts that Lite does not expose.";
|
|
10758
|
+
function toLiteCustomCode(code) {
|
|
10759
|
+
if (!code) return null;
|
|
10760
|
+
const translated = {};
|
|
10761
|
+
for (const [point, value] of Object.entries(code)) {
|
|
10762
|
+
if (point.startsWith("!")) return unsupported("MaterialPluginBase.getCustomCode(regex)", MATERIAL_PLUGIN_REGEX_UNSUPPORTED);
|
|
10763
|
+
switch (point) {
|
|
10764
|
+
case "CUSTOM_FRAGMENT_DEFINITIONS":
|
|
10765
|
+
case "CUSTOM_FRAGMENT_MAIN_BEGIN":
|
|
10766
|
+
case "CUSTOM_FRAGMENT_UPDATE_ALPHA":
|
|
10767
|
+
case "CUSTOM_FRAGMENT_UPDATE_DIFFUSE":
|
|
10768
|
+
case "CUSTOM_FRAGMENT_BEFORE_LIGHTS":
|
|
10769
|
+
case "CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION":
|
|
10770
|
+
case "CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR":
|
|
10771
|
+
case "CUSTOM_VERTEX_MAIN_BEGIN":
|
|
10772
|
+
case "CUSTOM_VERTEX_UPDATE_WORLDPOS":
|
|
10773
|
+
case "CUSTOM_VERTEX_MAIN_END":
|
|
10774
|
+
translated[point] = value;
|
|
10775
|
+
break;
|
|
10776
|
+
default: return unsupported(`MaterialPluginBase.getCustomCode(${point})`, "Lite's material-plugin bridge does not expose this Babylon.js shader injection point.");
|
|
10777
|
+
}
|
|
10778
|
+
}
|
|
10779
|
+
return translated;
|
|
10780
|
+
}
|
|
10781
|
+
function toLiteDefines(defines) {
|
|
10782
|
+
const translated = {};
|
|
10783
|
+
for (const [name, value] of Object.entries(defines)) if (typeof value === "boolean" || typeof value === "number") translated[name] = value;
|
|
10784
|
+
return translated;
|
|
10785
|
+
}
|
|
10786
|
+
/** Babylon.js-shaped manager for the adapter-visible material plugin list. */
|
|
10787
|
+
var MaterialPluginManager = class {
|
|
10788
|
+
_plugins = [];
|
|
10789
|
+
constructor(material) {}
|
|
10790
|
+
/** @internal Attach a plugin through Lite's descriptor list. */
|
|
10791
|
+
_addPlugin(plugin) {
|
|
10792
|
+
if (this._plugins.some((candidate) => candidate.name === plugin.name)) return false;
|
|
10793
|
+
this._plugins.push(plugin);
|
|
10794
|
+
this._plugins.sort((a, b) => a.priority - b.priority);
|
|
10795
|
+
plugin._attachToLiteMaterial();
|
|
10796
|
+
return true;
|
|
10797
|
+
}
|
|
10798
|
+
/** @internal Activate a plugin through Lite's descriptor state. */
|
|
10799
|
+
_activatePlugin(plugin) {
|
|
10800
|
+
plugin._setLiteEnabled(true);
|
|
10801
|
+
}
|
|
10802
|
+
/** @internal Remove a disposed plugin from the adapter-visible list. */
|
|
10803
|
+
_removePlugin(plugin) {
|
|
10804
|
+
const index = this._plugins.indexOf(plugin);
|
|
10805
|
+
if (index >= 0) this._plugins.splice(index, 1);
|
|
10806
|
+
}
|
|
10807
|
+
getPlugin(name) {
|
|
10808
|
+
return this._plugins.find((plugin) => plugin.name === name) ?? null;
|
|
10809
|
+
}
|
|
10810
|
+
};
|
|
10811
|
+
/**
|
|
10812
|
+
* Babylon.js `MaterialPluginBase` adapter over Lite's opt-in material-plugin
|
|
10813
|
+
* bridge. Subclasses keep the Babylon.js override shape while Lite receives a
|
|
10814
|
+
* plain plugin descriptor.
|
|
10815
|
+
*/
|
|
10816
|
+
var MaterialPluginBase = class MaterialPluginBase {
|
|
10817
|
+
_name;
|
|
10818
|
+
_priority;
|
|
10819
|
+
_resolveIncludes = false;
|
|
10820
|
+
markAllDefinesAsDirty;
|
|
10821
|
+
registerForExtraEvents = false;
|
|
10822
|
+
doNotSerialize = false;
|
|
10823
|
+
_material;
|
|
10824
|
+
_pluginManager;
|
|
10825
|
+
_pluginDefineNames;
|
|
10826
|
+
/** @internal Plain plugin descriptor attached to the backing Lite material. */
|
|
10827
|
+
_lite;
|
|
10828
|
+
constructor(material, name, priority, defines = {}, addToPluginList = true, enable = false, resolveIncludes = false) {
|
|
10829
|
+
this._material = material;
|
|
10830
|
+
this._name = name;
|
|
10831
|
+
this._priority = priority;
|
|
10832
|
+
this.resolveIncludes = resolveIncludes;
|
|
10833
|
+
this._pluginDefineNames = defines;
|
|
10834
|
+
this._pluginManager = material.pluginManager ??= new MaterialPluginManager(material);
|
|
10835
|
+
this.markAllDefinesAsDirty = () => material._markPluginDefinesDirty();
|
|
10836
|
+
this._lite = {
|
|
10837
|
+
get name() {
|
|
10838
|
+
return name;
|
|
10839
|
+
},
|
|
10840
|
+
get priority() {
|
|
10841
|
+
return priority;
|
|
10842
|
+
},
|
|
10843
|
+
defines: toLiteDefines(defines),
|
|
10844
|
+
isEnabled: enable,
|
|
10845
|
+
getCustomCode: (shaderType) => {
|
|
10846
|
+
this._assertSupportedExecution();
|
|
10847
|
+
return this.isCompatible(ShaderLanguage.WGSL) ? toLiteCustomCode(this.getCustomCode(shaderType, ShaderLanguage.WGSL)) : null;
|
|
10848
|
+
}
|
|
10849
|
+
};
|
|
10850
|
+
if (addToPluginList) this._pluginManager._addPlugin(this);
|
|
10851
|
+
}
|
|
10852
|
+
get name() {
|
|
10853
|
+
return this._name;
|
|
10854
|
+
}
|
|
10855
|
+
set name(value) {
|
|
10856
|
+
this._name = value;
|
|
10857
|
+
Object.defineProperty(this._lite, "name", {
|
|
10858
|
+
configurable: true,
|
|
10859
|
+
enumerable: true,
|
|
10860
|
+
get: () => this._name
|
|
10861
|
+
});
|
|
10862
|
+
}
|
|
10863
|
+
get priority() {
|
|
10864
|
+
return this._priority;
|
|
10865
|
+
}
|
|
10866
|
+
set priority(value) {
|
|
10867
|
+
this._priority = value;
|
|
10868
|
+
Object.defineProperty(this._lite, "priority", {
|
|
10869
|
+
configurable: true,
|
|
10870
|
+
enumerable: true,
|
|
10871
|
+
get: () => this._priority
|
|
10872
|
+
});
|
|
10873
|
+
}
|
|
10874
|
+
get resolveIncludes() {
|
|
10875
|
+
return this._resolveIncludes;
|
|
10876
|
+
}
|
|
10877
|
+
set resolveIncludes(value) {
|
|
10878
|
+
if (value) unsupported("MaterialPluginBase.resolveIncludes", MATERIAL_PLUGIN_INCLUDES_UNSUPPORTED);
|
|
10879
|
+
this._resolveIncludes = false;
|
|
10880
|
+
}
|
|
10881
|
+
/** @internal Unsupported derived stubs override this to avoid mutating Lite state before throwing. */
|
|
10882
|
+
get _attachToLite() {
|
|
10883
|
+
return true;
|
|
10884
|
+
}
|
|
10885
|
+
_enable(enable) {
|
|
10886
|
+
if (enable) this._pluginManager._activatePlugin(this);
|
|
10887
|
+
else this._setLiteEnabled(false);
|
|
10888
|
+
}
|
|
10889
|
+
/** @internal Attach this adapter's descriptor to the backing Lite material. */
|
|
10890
|
+
_attachToLiteMaterial() {
|
|
10891
|
+
if (!this._attachToLite) return;
|
|
10892
|
+
const liteMaterial = this._material._lite;
|
|
10893
|
+
liteMaterial.plugins = [...liteMaterial.plugins ?? [], this._lite];
|
|
10894
|
+
this._material._usesMaterialPlugins = true;
|
|
10895
|
+
this._material.getScene()?._requestMaterialPlugins(this._material._lite);
|
|
10896
|
+
}
|
|
10897
|
+
/** @internal Update this adapter's Lite activation state. */
|
|
10898
|
+
_setLiteEnabled(enable) {
|
|
10899
|
+
this._lite.isEnabled = enable;
|
|
10900
|
+
this.markAllDefinesAsDirty();
|
|
10901
|
+
}
|
|
10902
|
+
_assertSupportedExecution() {
|
|
10903
|
+
if (this.resolveIncludes) unsupported("MaterialPluginBase.resolveIncludes", MATERIAL_PLUGIN_INCLUDES_UNSUPPORTED);
|
|
10904
|
+
const base = MaterialPluginBase.prototype;
|
|
10905
|
+
if (this.registerForExtraEvents || this.collectDefines !== base.collectDefines || this.prepareDefinesBeforeAttributes !== base.prepareDefinesBeforeAttributes || this.prepareDefines !== base.prepareDefines || this.isReadyForSubMesh !== base.isReadyForSubMesh || this.hardBindForSubMesh !== base.hardBindForSubMesh || this.bindForSubMesh !== base.bindForSubMesh || this.hasTexture !== base.hasTexture || this.hasRenderTargetTextures !== base.hasRenderTargetTextures || this.fillRenderTargetTextures !== base.fillRenderTargetTextures || this.getActiveTextures !== base.getActiveTextures || this.getAnimatables !== base.getAnimatables || this.addFallbacks !== base.addFallbacks || this.getSamplers !== base.getSamplers || this.getAttributes !== base.getAttributes || this.getUniformBuffersNames !== base.getUniformBuffersNames || this.getUniforms !== base.getUniforms) unsupported("MaterialPluginBase hooks", MATERIAL_PLUGIN_HOOKS_UNSUPPORTED);
|
|
10906
|
+
}
|
|
10907
|
+
isCompatible(_shaderLanguage) {
|
|
10908
|
+
return _shaderLanguage === ShaderLanguage.GLSL;
|
|
10909
|
+
}
|
|
10910
|
+
getCustomCode(_shaderType, _shaderLanguage = ShaderLanguage.GLSL) {
|
|
10911
|
+
return null;
|
|
10912
|
+
}
|
|
10913
|
+
isReadyForSubMesh(_defines, _scene, _engine, _subMesh) {
|
|
10914
|
+
return true;
|
|
10915
|
+
}
|
|
10916
|
+
hardBindForSubMesh(_uniformBuffer, _scene, _engine, _subMesh) {}
|
|
10917
|
+
bindForSubMesh(_uniformBuffer, _scene, _engine, _subMesh) {}
|
|
10918
|
+
collectDefines(defines) {
|
|
10919
|
+
if (!this._pluginDefineNames) return;
|
|
10920
|
+
for (const [name, value] of Object.entries(this._pluginDefineNames)) if (!name.startsWith("_")) {
|
|
10921
|
+
const valueType = typeof value;
|
|
10922
|
+
defines[name] = {
|
|
10923
|
+
type: valueType === "number" || valueType === "string" || valueType === "boolean" ? valueType : "object",
|
|
10924
|
+
default: value
|
|
10925
|
+
};
|
|
10926
|
+
}
|
|
10927
|
+
}
|
|
10928
|
+
prepareDefinesBeforeAttributes(_defines, _scene, _mesh) {}
|
|
10929
|
+
prepareDefines(_defines, _scene, _mesh) {}
|
|
10930
|
+
hasTexture(_texture) {
|
|
10931
|
+
return false;
|
|
10932
|
+
}
|
|
10933
|
+
hasRenderTargetTextures() {
|
|
10934
|
+
return false;
|
|
10935
|
+
}
|
|
10936
|
+
fillRenderTargetTextures(_renderTargets) {}
|
|
10937
|
+
getActiveTextures(_activeTextures) {}
|
|
10938
|
+
getAnimatables(_animatables) {}
|
|
10939
|
+
addFallbacks(_defines, _fallbacks, currentRank) {
|
|
10940
|
+
return currentRank;
|
|
10941
|
+
}
|
|
10942
|
+
getSamplers(_samplers) {}
|
|
10943
|
+
getAttributes(_attributes, _scene, _mesh) {}
|
|
10944
|
+
getUniformBuffersNames(_ubos) {}
|
|
10945
|
+
getUniforms(_shaderLanguage = ShaderLanguage.GLSL) {
|
|
10946
|
+
return {};
|
|
10947
|
+
}
|
|
10948
|
+
getClassName() {
|
|
10949
|
+
return "MaterialPluginBase";
|
|
10950
|
+
}
|
|
10951
|
+
copyTo(plugin) {
|
|
10952
|
+
plugin.name = this.name;
|
|
10953
|
+
plugin.priority = this.priority;
|
|
10954
|
+
plugin.resolveIncludes = this.resolveIncludes;
|
|
10955
|
+
plugin.registerForExtraEvents = this.registerForExtraEvents;
|
|
10956
|
+
plugin.doNotSerialize = this.doNotSerialize;
|
|
10957
|
+
}
|
|
10958
|
+
serialize() {
|
|
10959
|
+
return {
|
|
10960
|
+
name: this.name,
|
|
10961
|
+
priority: this.priority,
|
|
10962
|
+
resolveIncludes: this.resolveIncludes,
|
|
10963
|
+
registerForExtraEvents: this.registerForExtraEvents,
|
|
10964
|
+
doNotSerialize: this.doNotSerialize
|
|
10965
|
+
};
|
|
10966
|
+
}
|
|
10967
|
+
parse(source, _scene, _rootUrl) {
|
|
10968
|
+
if (typeof source.resolveIncludes === "boolean") this.resolveIncludes = source.resolveIncludes;
|
|
10969
|
+
if (typeof source.name === "string") this.name = source.name;
|
|
10970
|
+
if (typeof source.priority === "number") this.priority = source.priority;
|
|
10971
|
+
if (typeof source.registerForExtraEvents === "boolean") this.registerForExtraEvents = source.registerForExtraEvents;
|
|
10972
|
+
if (typeof source.doNotSerialize === "boolean") this.doNotSerialize = source.doNotSerialize;
|
|
10973
|
+
}
|
|
10974
|
+
dispose(_forceDisposeTextures) {
|
|
10975
|
+
const liteMaterial = this._material._lite;
|
|
10976
|
+
if (liteMaterial.plugins) {
|
|
10977
|
+
liteMaterial.plugins = liteMaterial.plugins.filter((plugin) => plugin !== this._lite);
|
|
10978
|
+
this._material._usesMaterialPlugins = liteMaterial.plugins.length > 0;
|
|
10979
|
+
this._material._markPluginDefinesDirty();
|
|
10980
|
+
}
|
|
10981
|
+
this._pluginManager._removePlugin(this);
|
|
10982
|
+
}
|
|
10983
|
+
};
|
|
10984
|
+
//#endregion
|
|
9584
10985
|
//#region src/unsupported/unsupported-apis.ts
|
|
9585
10986
|
/**
|
|
9586
10987
|
* Stubs for Babylon.js core/loader APIs that are **known but not supported** by
|
|
@@ -9595,9 +10996,9 @@ function CreateMicrophoneSoundSourceAsync(name, options, engine) {
|
|
|
9595
10996
|
* As Babylon Lite gains a capability, the corresponding stub here should be
|
|
9596
10997
|
* replaced by a real wrapper (and its `COMPAT-STATUS.md` row upgraded).
|
|
9597
10998
|
*/
|
|
9598
|
-
var WHITE_BALANCE_UNSUPPORTED = "White balance requires color-temperature math, a shader uniform, material/post-process defines, and pipeline invalidation that Babylon Lite does not expose; adding it needs a cross-cutting Lite subsystem design.";
|
|
9599
10999
|
var FLUID_RENDERER_UNSUPPORTED = "Fluid rendering requires dedicated depth, thickness, and diffuse passes plus render-target lifecycle and composition policies that Babylon Lite does not define.";
|
|
9600
11000
|
var USD_LOADER_UNSUPPORTED = "OpenUSD loading requires an OpenUSD WebAssembly worker, virtual-file staging, command-buffer extraction, and a USD-to-Lite scene/material materializer; those form a new loader subsystem with unresolved ownership and material-mapping design.";
|
|
11001
|
+
var DITHERED_TILE_FADE_UNSUPPORTED = "Lite's material-plugin bridge supports shared shader injection, but not Babylon.js per-draw mesh uniforms, hardware-instance bounds, or custom thin-instance attributes/varyings. Adding those requires an opt-in per-renderable plugin-data design.";
|
|
9601
11002
|
var USDFileLoader = class {
|
|
9602
11003
|
constructor(_options = {}) {
|
|
9603
11004
|
unsupported("USDFileLoader", USD_LOADER_UNSUPPORTED);
|
|
@@ -9606,13 +11007,17 @@ var USDFileLoader = class {
|
|
|
9606
11007
|
function RegisterUSDFileLoader() {
|
|
9607
11008
|
return unsupported("RegisterUSDFileLoader", USD_LOADER_UNSUPPORTED);
|
|
9608
11009
|
}
|
|
9609
|
-
var
|
|
9610
|
-
var
|
|
9611
|
-
|
|
9612
|
-
|
|
11010
|
+
var FLOW_GRAPH_UNSUPPORTED = "Babylon Lite's flow-graph runtime does not expose Babylon.js FlowGraph blocks, connections, or contexts. Validation requires a stable cross-model graph adapter and block registry design.";
|
|
11011
|
+
var FlowGraphValidationSeverity = /* @__PURE__ */ function(FlowGraphValidationSeverity) {
|
|
11012
|
+
FlowGraphValidationSeverity[FlowGraphValidationSeverity["Error"] = 0] = "Error";
|
|
11013
|
+
FlowGraphValidationSeverity[FlowGraphValidationSeverity["Warning"] = 1] = "Warning";
|
|
11014
|
+
return FlowGraphValidationSeverity;
|
|
11015
|
+
}({});
|
|
11016
|
+
function ValidateFlowGraph(_flowGraph) {
|
|
11017
|
+
return unsupported("ValidateFlowGraph", FLOW_GRAPH_UNSUPPORTED);
|
|
9613
11018
|
}
|
|
9614
|
-
function
|
|
9615
|
-
return unsupported("
|
|
11019
|
+
function ValidateFlowGraphWithBlockList(_flowGraph, _allKnownBlocks) {
|
|
11020
|
+
return unsupported("ValidateFlowGraphWithBlockList", FLOW_GRAPH_UNSUPPORTED);
|
|
9616
11021
|
}
|
|
9617
11022
|
var FluidRenderingObject = class {
|
|
9618
11023
|
static UsePerParticleSizeAttribute = false;
|
|
@@ -9653,6 +11058,62 @@ var MultiMaterial = class {
|
|
|
9653
11058
|
unsupported("MultiMaterial", "Babylon Lite uses one material per renderable. Split the mesh geometry by material into separate meshes instead.");
|
|
9654
11059
|
}
|
|
9655
11060
|
};
|
|
11061
|
+
var DitheredTileFadeMaterialPlugin = class DitheredTileFadeMaterialPlugin extends MaterialPluginBase {
|
|
11062
|
+
static Name = "DitheredTileFade";
|
|
11063
|
+
/** @internal The unsupported constructor must not alter the material or scene. */
|
|
11064
|
+
get _attachToLite() {
|
|
11065
|
+
return false;
|
|
11066
|
+
}
|
|
11067
|
+
constructor(material) {
|
|
11068
|
+
super(material, DitheredTileFadeMaterialPlugin.Name, 190);
|
|
11069
|
+
unsupported("DitheredTileFadeMaterialPlugin", DITHERED_TILE_FADE_UNSUPPORTED);
|
|
11070
|
+
}
|
|
11071
|
+
static GetOrCreate(_material) {
|
|
11072
|
+
return unsupported("DitheredTileFadeMaterialPlugin.GetOrCreate", DITHERED_TILE_FADE_UNSUPPORTED);
|
|
11073
|
+
}
|
|
11074
|
+
get isEnabled() {
|
|
11075
|
+
return unsupported("DitheredTileFadeMaterialPlugin.isEnabled", DITHERED_TILE_FADE_UNSUPPORTED);
|
|
11076
|
+
}
|
|
11077
|
+
set isEnabled(_value) {
|
|
11078
|
+
unsupported("DitheredTileFadeMaterialPlugin.isEnabled", DITHERED_TILE_FADE_UNSUPPORTED);
|
|
11079
|
+
}
|
|
11080
|
+
setFadeBounds(_mesh, _lowerBound, _upperBound) {
|
|
11081
|
+
unsupported("DitheredTileFadeMaterialPlugin.setFadeBounds", DITHERED_TILE_FADE_UNSUPPORTED);
|
|
11082
|
+
}
|
|
11083
|
+
setFadeLowerBound(_mesh, _lowerBound) {
|
|
11084
|
+
unsupported("DitheredTileFadeMaterialPlugin.setFadeLowerBound", DITHERED_TILE_FADE_UNSUPPORTED);
|
|
11085
|
+
}
|
|
11086
|
+
setFadeUpperBound(_mesh, _upperBound) {
|
|
11087
|
+
unsupported("DitheredTileFadeMaterialPlugin.setFadeUpperBound", DITHERED_TILE_FADE_UNSUPPORTED);
|
|
11088
|
+
}
|
|
11089
|
+
getFadeBoundsToRef(_mesh, _result) {
|
|
11090
|
+
return unsupported("DitheredTileFadeMaterialPlugin.getFadeBoundsToRef", DITHERED_TILE_FADE_UNSUPPORTED);
|
|
11091
|
+
}
|
|
11092
|
+
resetFade(_mesh) {
|
|
11093
|
+
unsupported("DitheredTileFadeMaterialPlugin.resetFade", DITHERED_TILE_FADE_UNSUPPORTED);
|
|
11094
|
+
}
|
|
11095
|
+
setThinInstanceFadeBounds(_mesh, _index, _lowerBound, _upperBound, _refresh = true) {
|
|
11096
|
+
unsupported("DitheredTileFadeMaterialPlugin.setThinInstanceFadeBounds", DITHERED_TILE_FADE_UNSUPPORTED);
|
|
11097
|
+
}
|
|
11098
|
+
setThinInstanceFadeBoundsBuffer(_mesh, _bounds) {
|
|
11099
|
+
unsupported("DitheredTileFadeMaterialPlugin.setThinInstanceFadeBoundsBuffer", DITHERED_TILE_FADE_UNSUPPORTED);
|
|
11100
|
+
}
|
|
11101
|
+
commitThinInstanceFadeBounds(_mesh) {
|
|
11102
|
+
unsupported("DitheredTileFadeMaterialPlugin.commitThinInstanceFadeBounds", DITHERED_TILE_FADE_UNSUPPORTED);
|
|
11103
|
+
}
|
|
11104
|
+
resetThinInstanceFade(_mesh, _index, _refresh = true) {
|
|
11105
|
+
unsupported("DitheredTileFadeMaterialPlugin.resetThinInstanceFade", DITHERED_TILE_FADE_UNSUPPORTED);
|
|
11106
|
+
}
|
|
11107
|
+
reset() {
|
|
11108
|
+
unsupported("DitheredTileFadeMaterialPlugin.reset", DITHERED_TILE_FADE_UNSUPPORTED);
|
|
11109
|
+
}
|
|
11110
|
+
copyToMaterial(_material) {
|
|
11111
|
+
return unsupported("DitheredTileFadeMaterialPlugin.copyToMaterial", DITHERED_TILE_FADE_UNSUPPORTED);
|
|
11112
|
+
}
|
|
11113
|
+
getClassName() {
|
|
11114
|
+
return "DitheredTileFadeMaterialPlugin";
|
|
11115
|
+
}
|
|
11116
|
+
};
|
|
9656
11117
|
var ShaderMaterial = class {
|
|
9657
11118
|
constructor() {
|
|
9658
11119
|
unsupported("ShaderMaterial", "Babylon Lite is WGSL-only. Use the native `createShaderMaterial` (WGSL) API; there is no automatic GLSL translation.");
|
|
@@ -9951,6 +11412,9 @@ var GaussianSplattingStream = class {
|
|
|
9951
11412
|
constructor(..._args) {
|
|
9952
11413
|
unsupported("GaussianSplattingStream", "Gaussian-Splatting LOD streaming is a whole GPU subsystem (SOG-octree LOD residency + work-buffer decode into render-target atlases) with no Babylon Lite equivalent. Load the full cloud with `GaussianSplattingMesh` / `loadSplat` instead.");
|
|
9953
11414
|
}
|
|
11415
|
+
get minimumResidentSplats() {
|
|
11416
|
+
return unsupported("GaussianSplattingStream.minimumResidentSplats", "The value is owned by Babylon.js's SOG streaming residency controller; Babylon Lite has no LOD residency subsystem from which to derive it.");
|
|
11417
|
+
}
|
|
9954
11418
|
};
|
|
9955
11419
|
/** Babylon.js `AddGaussianSplattingStreamPart` — appends a streamed LOD part to a GS compound mesh. */
|
|
9956
11420
|
function AddGaussianSplattingStreamPart(..._args) {
|
|
@@ -10030,8 +11494,228 @@ var SceneSerializer = {
|
|
|
10030
11494
|
}
|
|
10031
11495
|
};
|
|
10032
11496
|
//#endregion
|
|
11497
|
+
//#region src/loading/unsupported-khr-interactivity.ts
|
|
11498
|
+
var KHR_INTERACTIVITY_UNSUPPORTED = "KHR_interactivity depends on Babylon.js FlowGraph block, connection, context, serialization, and glTF-reference models. Lite's flow-graph runtime uses a different graph model, so a stable cross-model adapter requires a broader loader/runtime design.";
|
|
11499
|
+
var KHR_INTERACTIVITY_EXPORT_UNSUPPORTED = "KHR_interactivity export planning depends on Babylon.js FlowGraph block provenance and the Babylon.js glTF serializer's final entity-index remapping context. Lite exposes a different runtime graph model and no glTF serializer.";
|
|
11500
|
+
function ParseDebugLogTemplate(_message) {
|
|
11501
|
+
return unsupported("GLTF2.ParseDebugLogTemplate", KHR_INTERACTIVITY_UNSUPPORTED);
|
|
11502
|
+
}
|
|
11503
|
+
function getMappingForFullOperationName(_operation) {
|
|
11504
|
+
return unsupported("GLTF2.getMappingForFullOperationName", KHR_INTERACTIVITY_UNSUPPORTED);
|
|
11505
|
+
}
|
|
11506
|
+
function getMappingForDeclaration(_declaration, _returnNoOpIfNotAvailable = true) {
|
|
11507
|
+
return unsupported("GLTF2.getMappingForDeclaration", KHR_INTERACTIVITY_UNSUPPORTED);
|
|
11508
|
+
}
|
|
11509
|
+
function getNoOpMappingForDeclaration(_declaration) {
|
|
11510
|
+
return unsupported("GLTF2.getNoOpMappingForDeclaration", KHR_INTERACTIVITY_UNSUPPORTED);
|
|
11511
|
+
}
|
|
11512
|
+
function addNewInteractivityFlowGraphMapping(_key, _extension, _mapping) {
|
|
11513
|
+
unsupported("GLTF2.addNewInteractivityFlowGraphMapping", KHR_INTERACTIVITY_UNSUPPORTED);
|
|
11514
|
+
}
|
|
11515
|
+
function getAllSupportedNativeNodeTypes() {
|
|
11516
|
+
return unsupported("GLTF2.getAllSupportedNativeNodeTypes", KHR_INTERACTIVITY_UNSUPPORTED);
|
|
11517
|
+
}
|
|
11518
|
+
function HasDefaultInteractivityFlowInput(operation) {
|
|
11519
|
+
return hasDefaultInteractivityFlowInput(operation);
|
|
11520
|
+
}
|
|
11521
|
+
function NormalizeInteractivityEventDataConfiguration(value) {
|
|
11522
|
+
return normalizeInteractivityEventDataConfiguration(value);
|
|
11523
|
+
}
|
|
11524
|
+
function GetInteractivityOperationRegistry() {
|
|
11525
|
+
return unsupported("GLTF2.GetInteractivityOperationRegistry", KHR_INTERACTIVITY_UNSUPPORTED);
|
|
11526
|
+
}
|
|
11527
|
+
var gltfTypeToBabylonType = {
|
|
11528
|
+
float: {
|
|
11529
|
+
length: 1,
|
|
11530
|
+
flowGraphType: "number",
|
|
11531
|
+
elementType: "number"
|
|
11532
|
+
},
|
|
11533
|
+
bool: {
|
|
11534
|
+
length: 1,
|
|
11535
|
+
flowGraphType: "boolean",
|
|
11536
|
+
elementType: "boolean"
|
|
11537
|
+
},
|
|
11538
|
+
float2: {
|
|
11539
|
+
length: 2,
|
|
11540
|
+
flowGraphType: "Vector2",
|
|
11541
|
+
elementType: "number"
|
|
11542
|
+
},
|
|
11543
|
+
float3: {
|
|
11544
|
+
length: 3,
|
|
11545
|
+
flowGraphType: "Vector3",
|
|
11546
|
+
elementType: "number"
|
|
11547
|
+
},
|
|
11548
|
+
float4: {
|
|
11549
|
+
length: 4,
|
|
11550
|
+
flowGraphType: "Vector4",
|
|
11551
|
+
elementType: "number"
|
|
11552
|
+
},
|
|
11553
|
+
float4x4: {
|
|
11554
|
+
length: 16,
|
|
11555
|
+
flowGraphType: "Matrix",
|
|
11556
|
+
elementType: "number"
|
|
11557
|
+
},
|
|
11558
|
+
float2x2: {
|
|
11559
|
+
length: 4,
|
|
11560
|
+
flowGraphType: "Matrix2D",
|
|
11561
|
+
elementType: "number"
|
|
11562
|
+
},
|
|
11563
|
+
float3x3: {
|
|
11564
|
+
length: 9,
|
|
11565
|
+
flowGraphType: "Matrix3D",
|
|
11566
|
+
elementType: "number"
|
|
11567
|
+
},
|
|
11568
|
+
int: {
|
|
11569
|
+
length: 1,
|
|
11570
|
+
flowGraphType: "FlowGraphInteger",
|
|
11571
|
+
elementType: "number"
|
|
11572
|
+
},
|
|
11573
|
+
ref: {
|
|
11574
|
+
length: 1,
|
|
11575
|
+
flowGraphType: "string",
|
|
11576
|
+
elementType: "string"
|
|
11577
|
+
},
|
|
11578
|
+
custom: {
|
|
11579
|
+
length: 0,
|
|
11580
|
+
flowGraphType: "any",
|
|
11581
|
+
elementType: "any"
|
|
11582
|
+
}
|
|
11583
|
+
};
|
|
11584
|
+
var FlowGraphEventReferenceBlock = class {
|
|
11585
|
+
config;
|
|
11586
|
+
constructor(config) {
|
|
11587
|
+
this.config = config;
|
|
11588
|
+
unsupported("GLTF2.FlowGraphEventReferenceBlock", KHR_INTERACTIVITY_UNSUPPORTED);
|
|
11589
|
+
}
|
|
11590
|
+
};
|
|
11591
|
+
var FlowGraphGLTFDataProvider = class {
|
|
11592
|
+
constructor(_config = {}) {
|
|
11593
|
+
unsupported("GLTF2.FlowGraphGLTFDataProvider", KHR_INTERACTIVITY_UNSUPPORTED);
|
|
11594
|
+
}
|
|
11595
|
+
};
|
|
11596
|
+
function GetInteractivityObjectReference(_context, _value) {
|
|
11597
|
+
return unsupported("GLTF2.GetInteractivityObjectReference", KHR_INTERACTIVITY_UNSUPPORTED);
|
|
11598
|
+
}
|
|
11599
|
+
var FlowGraphObjectReferenceBlock = class {
|
|
11600
|
+
constructor(_config = {}) {
|
|
11601
|
+
unsupported("GLTF2.FlowGraphObjectReferenceBlock", KHR_INTERACTIVITY_UNSUPPORTED);
|
|
11602
|
+
}
|
|
11603
|
+
};
|
|
11604
|
+
var FlowGraphUnsupportedInteractivityBlock = class {
|
|
11605
|
+
config;
|
|
11606
|
+
constructor(config) {
|
|
11607
|
+
this.config = config;
|
|
11608
|
+
unsupported("GLTF2.FlowGraphUnsupportedInteractivityBlock", KHR_INTERACTIVITY_UNSUPPORTED);
|
|
11609
|
+
}
|
|
11610
|
+
};
|
|
11611
|
+
var KHR_INTERACTIVITY_SPECIFICATION_COMMIT = "f798712c5685bc9223a628140fba707db8889300";
|
|
11612
|
+
function _NormalizeKHRInteractivityRuntimeValue(value) {
|
|
11613
|
+
return normalizeKhrInteractivityRuntimeValue(value);
|
|
11614
|
+
}
|
|
11615
|
+
function _CreateKHRInteractivityRuntimeValueSnapshot(value) {
|
|
11616
|
+
return createKhrInteractivityRuntimeValueSnapshot(value);
|
|
11617
|
+
}
|
|
11618
|
+
function CloneKHRInteractivityGraph(_graph) {
|
|
11619
|
+
return unsupported("GLTF2.CloneKHRInteractivityGraph", KHR_INTERACTIVITY_UNSUPPORTED);
|
|
11620
|
+
}
|
|
11621
|
+
function CreateEffectiveKHRInteractivityGraph(_graph, _declarations, _assetNodeCount) {
|
|
11622
|
+
return unsupported("GLTF2.CreateEffectiveKHRInteractivityGraph", KHR_INTERACTIVITY_UNSUPPORTED);
|
|
11623
|
+
}
|
|
11624
|
+
function CreateKHRInteractivityGraphModel(_graph, _index = 0, _supportedExtensions, _assetNodeCount) {
|
|
11625
|
+
return unsupported("GLTF2.CreateKHRInteractivityGraphModel", KHR_INTERACTIVITY_UNSUPPORTED);
|
|
11626
|
+
}
|
|
11627
|
+
function CreateKHRInteractivityDocument(_extension, _supportedExtensions, _assetNodeCount) {
|
|
11628
|
+
return unsupported("GLTF2.CreateKHRInteractivityDocument", KHR_INTERACTIVITY_UNSUPPORTED);
|
|
11629
|
+
}
|
|
11630
|
+
function _CaptureKHRInteractivityRuntimeInputDefaults(_flowGraph) {
|
|
11631
|
+
unsupported("GLTF2._CaptureKHRInteractivityRuntimeInputDefaults", KHR_INTERACTIVITY_UNSUPPORTED);
|
|
11632
|
+
}
|
|
11633
|
+
var KHRInteractivityExportError = class extends Error {
|
|
11634
|
+
diagnostics;
|
|
11635
|
+
constructor(diagnostics) {
|
|
11636
|
+
super(diagnostics.map((diagnostic) => `${diagnostic.path}: ${diagnostic.message}`).join("\n"));
|
|
11637
|
+
this.diagnostics = diagnostics;
|
|
11638
|
+
this.name = "KHRInteractivityExportError";
|
|
11639
|
+
}
|
|
11640
|
+
};
|
|
11641
|
+
var KHRInteractivityExportPlan = class {
|
|
11642
|
+
required = true;
|
|
11643
|
+
additionalExtensionsUsed = [];
|
|
11644
|
+
additionalExtensionsRequired = [];
|
|
11645
|
+
constructor(_flowGraphs, _options = {}) {
|
|
11646
|
+
unsupported("GLTF2.KHRInteractivityExportPlan", KHR_INTERACTIVITY_EXPORT_UNSUPPORTED);
|
|
11647
|
+
}
|
|
11648
|
+
analyze() {
|
|
11649
|
+
return unsupported("GLTF2.KHRInteractivityExportPlan.analyze", KHR_INTERACTIVITY_EXPORT_UNSUPPORTED);
|
|
11650
|
+
}
|
|
11651
|
+
build(_context) {
|
|
11652
|
+
return unsupported("GLTF2.KHRInteractivityExportPlan.build", KHR_INTERACTIVITY_EXPORT_UNSUPPORTED);
|
|
11653
|
+
}
|
|
11654
|
+
};
|
|
11655
|
+
function CreateKHRInteractivityExportPlan(flowGraphs, options = {}) {
|
|
11656
|
+
return new KHRInteractivityExportPlan(flowGraphs, options);
|
|
11657
|
+
}
|
|
11658
|
+
var InteractivityGraphToFlowGraphParser = class {
|
|
11659
|
+
/** @internal Upstream parser timing state; the parser itself is unsupported. */
|
|
11660
|
+
_animationTargetFps;
|
|
11661
|
+
constructor(_interactivityGraph, _gltf, animationTargetFps = 60, _graphIndex = 0, _supportedExtensions, _declarationModels) {
|
|
11662
|
+
this._animationTargetFps = animationTargetFps;
|
|
11663
|
+
unsupported("GLTF2.InteractivityGraphToFlowGraphParser", KHR_INTERACTIVITY_UNSUPPORTED);
|
|
11664
|
+
}
|
|
11665
|
+
getVariableName(_index) {
|
|
11666
|
+
return unsupported("GLTF2.InteractivityGraphToFlowGraphParser.getVariableName", KHR_INTERACTIVITY_UNSUPPORTED);
|
|
11667
|
+
}
|
|
11668
|
+
get arrays() {
|
|
11669
|
+
return unsupported("GLTF2.InteractivityGraphToFlowGraphParser.arrays", KHR_INTERACTIVITY_UNSUPPORTED);
|
|
11670
|
+
}
|
|
11671
|
+
serializeToFlowGraph() {
|
|
11672
|
+
return unsupported("GLTF2.InteractivityGraphToFlowGraphParser.serializeToFlowGraph", KHR_INTERACTIVITY_UNSUPPORTED);
|
|
11673
|
+
}
|
|
11674
|
+
};
|
|
11675
|
+
function InitializeInteractivityNodeState(_nodes, _state, _getAuthoredState) {
|
|
11676
|
+
unsupported("GLTF2.InitializeInteractivityNodeState", KHR_INTERACTIVITY_UNSUPPORTED);
|
|
11677
|
+
}
|
|
11678
|
+
function GetInteractivityNodeState(_node, _state) {
|
|
11679
|
+
return unsupported("GLTF2.GetInteractivityNodeState", KHR_INTERACTIVITY_UNSUPPORTED);
|
|
11680
|
+
}
|
|
11681
|
+
function SetInteractivityNodeState(_node, _state, _value) {
|
|
11682
|
+
unsupported("GLTF2.SetInteractivityNodeState", KHR_INTERACTIVITY_UNSUPPORTED);
|
|
11683
|
+
}
|
|
11684
|
+
//#endregion
|
|
10033
11685
|
//#region src/loading/gltf2.ts
|
|
10034
|
-
var gltf2_exports = /* @__PURE__ */ __exportAll({
|
|
11686
|
+
var gltf2_exports = /* @__PURE__ */ __exportAll({
|
|
11687
|
+
CloneKHRInteractivityGraph: () => CloneKHRInteractivityGraph,
|
|
11688
|
+
CreateEffectiveKHRInteractivityGraph: () => CreateEffectiveKHRInteractivityGraph,
|
|
11689
|
+
CreateKHRInteractivityDocument: () => CreateKHRInteractivityDocument,
|
|
11690
|
+
CreateKHRInteractivityExportPlan: () => CreateKHRInteractivityExportPlan,
|
|
11691
|
+
CreateKHRInteractivityGraphModel: () => CreateKHRInteractivityGraphModel,
|
|
11692
|
+
FlowGraphEventReferenceBlock: () => FlowGraphEventReferenceBlock,
|
|
11693
|
+
FlowGraphGLTFDataProvider: () => FlowGraphGLTFDataProvider,
|
|
11694
|
+
FlowGraphObjectReferenceBlock: () => FlowGraphObjectReferenceBlock,
|
|
11695
|
+
FlowGraphUnsupportedInteractivityBlock: () => FlowGraphUnsupportedInteractivityBlock,
|
|
11696
|
+
GetInteractivityNodeState: () => GetInteractivityNodeState,
|
|
11697
|
+
GetInteractivityObjectReference: () => GetInteractivityObjectReference,
|
|
11698
|
+
GetInteractivityOperationRegistry: () => GetInteractivityOperationRegistry,
|
|
11699
|
+
HasDefaultInteractivityFlowInput: () => HasDefaultInteractivityFlowInput,
|
|
11700
|
+
InitializeInteractivityNodeState: () => InitializeInteractivityNodeState,
|
|
11701
|
+
InteractivityGraphToFlowGraphParser: () => InteractivityGraphToFlowGraphParser,
|
|
11702
|
+
KHRInteractivityExportError: () => KHRInteractivityExportError,
|
|
11703
|
+
KHRInteractivityExportPlan: () => KHRInteractivityExportPlan,
|
|
11704
|
+
KHR_INTERACTIVITY_SPECIFICATION_COMMIT: () => KHR_INTERACTIVITY_SPECIFICATION_COMMIT,
|
|
11705
|
+
NormalizeInteractivityEventDataConfiguration: () => NormalizeInteractivityEventDataConfiguration,
|
|
11706
|
+
OpenPBRMaterialLoadingAdapter: () => OpenPBRMaterialLoadingAdapter,
|
|
11707
|
+
ParseDebugLogTemplate: () => ParseDebugLogTemplate,
|
|
11708
|
+
SetInteractivityNodeState: () => SetInteractivityNodeState,
|
|
11709
|
+
_CaptureKHRInteractivityRuntimeInputDefaults: () => _CaptureKHRInteractivityRuntimeInputDefaults,
|
|
11710
|
+
_CreateKHRInteractivityRuntimeValueSnapshot: () => _CreateKHRInteractivityRuntimeValueSnapshot,
|
|
11711
|
+
_NormalizeKHRInteractivityRuntimeValue: () => _NormalizeKHRInteractivityRuntimeValue,
|
|
11712
|
+
addNewInteractivityFlowGraphMapping: () => addNewInteractivityFlowGraphMapping,
|
|
11713
|
+
getAllSupportedNativeNodeTypes: () => getAllSupportedNativeNodeTypes,
|
|
11714
|
+
getMappingForDeclaration: () => getMappingForDeclaration,
|
|
11715
|
+
getMappingForFullOperationName: () => getMappingForFullOperationName,
|
|
11716
|
+
getNoOpMappingForDeclaration: () => getNoOpMappingForDeclaration,
|
|
11717
|
+
gltfTypeToBabylonType: () => gltfTypeToBabylonType
|
|
11718
|
+
});
|
|
10035
11719
|
//#endregion
|
|
10036
11720
|
//#region src/loading/gltf1.ts
|
|
10037
11721
|
var gltf1_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -10197,6 +11881,7 @@ var WeightedSound = class {
|
|
|
10197
11881
|
unsupported("WeightedSound", "Audio is not part of Babylon Lite.");
|
|
10198
11882
|
}
|
|
10199
11883
|
};
|
|
11884
|
+
var FBX_LOADER_UNSUPPORTED = "FBX support requires a parser, DCC transform/material/animation mapping, geometry and skin materialization, and a scene-scheduled constraint solver. Those form a new loader subsystem with unresolved ownership and mapping policies.";
|
|
10200
11885
|
var OBJFileLoader = class {
|
|
10201
11886
|
constructor() {
|
|
10202
11887
|
unsupported("OBJFileLoader", "The OBJ format is not supported by Babylon Lite. Convert to glTF.");
|
|
@@ -10207,9 +11892,77 @@ var STLFileLoader = class {
|
|
|
10207
11892
|
unsupported("STLFileLoader", "The STL format is not supported by Babylon Lite. Convert to glTF.");
|
|
10208
11893
|
}
|
|
10209
11894
|
};
|
|
11895
|
+
var FBXFileLoaderMetadata = {
|
|
11896
|
+
name: "fbx",
|
|
11897
|
+
extensions: { ".fbx": { isBinary: true } }
|
|
11898
|
+
};
|
|
10210
11899
|
var FBXFileLoader = class {
|
|
11900
|
+
constructor(_options = {}) {
|
|
11901
|
+
unsupported("FBXFileLoader", FBX_LOADER_UNSUPPORTED);
|
|
11902
|
+
}
|
|
11903
|
+
};
|
|
11904
|
+
var FBXConstraintSolver = class {
|
|
10211
11905
|
constructor() {
|
|
10212
|
-
unsupported("
|
|
11906
|
+
unsupported("FBXConstraintSolver", FBX_LOADER_UNSUPPORTED);
|
|
11907
|
+
}
|
|
11908
|
+
static Get(_scene) {
|
|
11909
|
+
return unsupported("FBXConstraintSolver.Get", FBX_LOADER_UNSUPPORTED);
|
|
11910
|
+
}
|
|
11911
|
+
static GetOrCreate(_scene) {
|
|
11912
|
+
return unsupported("FBXConstraintSolver.GetOrCreate", FBX_LOADER_UNSUPPORTED);
|
|
11913
|
+
}
|
|
11914
|
+
get constraints() {
|
|
11915
|
+
return unsupported("FBXConstraintSolver.constraints", FBX_LOADER_UNSUPPORTED);
|
|
11916
|
+
}
|
|
11917
|
+
get cyclicConstraints() {
|
|
11918
|
+
return unsupported("FBXConstraintSolver.cyclicConstraints", FBX_LOADER_UNSUPPORTED);
|
|
11919
|
+
}
|
|
11920
|
+
register(_behavior) {
|
|
11921
|
+
unsupported("FBXConstraintSolver.register", FBX_LOADER_UNSUPPORTED);
|
|
11922
|
+
}
|
|
11923
|
+
unregister(_behavior) {
|
|
11924
|
+
unsupported("FBXConstraintSolver.unregister", FBX_LOADER_UNSUPPORTED);
|
|
11925
|
+
}
|
|
11926
|
+
invalidateOrder() {
|
|
11927
|
+
unsupported("FBXConstraintSolver.invalidateOrder", FBX_LOADER_UNSUPPORTED);
|
|
11928
|
+
}
|
|
11929
|
+
beginFrame() {
|
|
11930
|
+
unsupported("FBXConstraintSolver.beginFrame", FBX_LOADER_UNSUPPORTED);
|
|
11931
|
+
}
|
|
11932
|
+
solve() {
|
|
11933
|
+
unsupported("FBXConstraintSolver.solve", FBX_LOADER_UNSUPPORTED);
|
|
11934
|
+
}
|
|
11935
|
+
};
|
|
11936
|
+
var FBXConstraintBehavior = class {
|
|
11937
|
+
constraint;
|
|
11938
|
+
name;
|
|
11939
|
+
attachedNode = null;
|
|
11940
|
+
enabled = true;
|
|
11941
|
+
constructor(constraint, _options) {
|
|
11942
|
+
this.constraint = constraint;
|
|
11943
|
+
this.name = `fbxConstraint:${constraint.name}`;
|
|
11944
|
+
unsupported("FBXConstraintBehavior", FBX_LOADER_UNSUPPORTED);
|
|
11945
|
+
}
|
|
11946
|
+
init() {
|
|
11947
|
+
unsupported("FBXConstraintBehavior.init", FBX_LOADER_UNSUPPORTED);
|
|
11948
|
+
}
|
|
11949
|
+
attach(_target) {
|
|
11950
|
+
unsupported("FBXConstraintBehavior.attach", FBX_LOADER_UNSUPPORTED);
|
|
11951
|
+
}
|
|
11952
|
+
detach() {
|
|
11953
|
+
unsupported("FBXConstraintBehavior.detach", FBX_LOADER_UNSUPPORTED);
|
|
11954
|
+
}
|
|
11955
|
+
captureBase() {
|
|
11956
|
+
unsupported("FBXConstraintBehavior.captureBase", FBX_LOADER_UNSUPPORTED);
|
|
11957
|
+
}
|
|
11958
|
+
restoreBase() {
|
|
11959
|
+
unsupported("FBXConstraintBehavior.restoreBase", FBX_LOADER_UNSUPPORTED);
|
|
11960
|
+
}
|
|
11961
|
+
dependencyNodes() {
|
|
11962
|
+
return unsupported("FBXConstraintBehavior.dependencyNodes", FBX_LOADER_UNSUPPORTED);
|
|
11963
|
+
}
|
|
11964
|
+
evaluate() {
|
|
11965
|
+
unsupported("FBXConstraintBehavior.evaluate", FBX_LOADER_UNSUPPORTED);
|
|
10213
11966
|
}
|
|
10214
11967
|
};
|
|
10215
11968
|
var BVHFileLoader = class {
|
|
@@ -10581,6 +12334,6 @@ var NodeParticleSystemSet = class NodeParticleSystemSet {
|
|
|
10581
12334
|
}
|
|
10582
12335
|
};
|
|
10583
12336
|
//#endregion
|
|
10584
|
-
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, 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, DynamicTexture, EASINGMODE_EASEIN, EASINGMODE_EASEINOUT, EASINGMODE_EASEOUT, EasingFunction, EdgesRenderer, EffectLayer, ElasticEase, Engine, Epsilon, ExecuteCodeAction, ExponentialEase, FBXFileLoader, FSR1RenderingPipeline, FactorGradient, FadeInOutBehavior, FluidRenderer, FluidRendererSceneComponent, FluidRenderingObject, FluidRenderingObjectCustomParticles, FluidRenderingObjectParticleSystem, FluidRenderingTargetRenderer, FlyCamera, FollowBehavior, FollowCamera, 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, Matrix, MaxTintMagnitude, Mesh, MeshBuilder, MeshoptCompression, MinTemperatureKelvin, MirrorTexture, MorphTarget, MorphTargetManager, MultiMaterial, MultiPointerScaleBehavior, Node, NodeMaterial, NodeParticleSystemSet, NullEngine, OBJFileLoader, Observable, OnAudioEngineV2CreatedObservable, OpenPBRMaterial, OpenPBRMaterialDefines, OpenPBRMaterialLoadingAdapter, OutlineRenderer, PBRAnisotropicConfiguration, PBRClearCoatConfiguration, PBRIridescenceConfiguration, PBRMaterial, PBRMetallicRoughnessMaterial, PBRSheenConfiguration, PBRSpecularGlossinessMaterial, 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, RegisterFluidRenderer, RegisterGreasedLinePluginMaterial, RegisterImageProcessingConfiguration, 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, ThinSprite, ToDegrees, ToRadians, Tools, TouchCamera, TransformNode, USDFileLoader, UninstallHtmlInCanvasPolyfill, UniversalCamera, UploadHtmlElementToTexture, UploadImageToTexture2DArrayLayer, UtilityLayerRenderer, 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 };
|
|
10585
12338
|
|
|
10586
12339
|
//# sourceMappingURL=index.js.map
|