@babylonjs/lite-compat 1.39.3 → 1.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## @babylonjs/lite v1.40.0
4
+
5
+ ### ✨ Features
6
+
7
+ - **compat:** add texture readback and sync color hex ([#916](https://github.com/BabylonJS/Babylon-Lite/pull/916))
8
+
9
+ ### 🐛 Bug Fixes
10
+
11
+ - **post-process:** scale-relative degeneracy guard for screen-space depth normals ([#912](https://github.com/BabylonJS/Babylon-Lite/pull/912))
12
+
13
+ ### ⚡ Performance
14
+
15
+ - **shadow:** reconcile PCF shadow casters incrementally ([#915](https://github.com/BabylonJS/Babylon-Lite/pull/915))
16
+ - **frame-graph:** add addMeshesToTask / removeMeshesFromTask batch APIs ([#910](https://github.com/BabylonJS/Babylon-Lite/pull/910))
17
+
18
+ ### 🏗️ Build & CI
19
+
20
+ - deploy versioned playground from release tags and retire npm publish pipelines ([#911](https://github.com/BabylonJS/Babylon-Lite/pull/911))
21
+
22
+ **Full Changelog**: https://github.com/BabylonJS/Babylon-Lite/compare/npm-lite-v1.39.3...npm-lite-v1.40.0
23
+
3
24
  ## @babylonjs/lite v1.39.3
4
25
 
5
26
  ### ⚠️ BREAKING CHANGES
package/README.md CHANGED
@@ -128,7 +128,7 @@ overloads within a supported area may still be absent.
128
128
  | CSG / CSG2 | ✅ | over Lite boolean ops |
129
129
  | Gizmos (position/rotation/scale/bounding-box/light/camera + `GizmoManager`) | ⚡ | over Lite gizmo suite; `isEnabled` toggles per-axis interactivity (display-only when disabled) |
130
130
  | Materials (`StandardMaterial`, `PBRMaterial`, metallic-rough / spec-gloss, `NodeMaterial`) | ⚡ | Includes native bent-normal IBL occlusion and cloned loaded PBR materials; BJS parallax scale semantics, Gaussian-splat plugins, preprocessed `ShaderMaterial`, `MultiMaterial`, `BackgroundMaterial`, and `OpenPBRMaterial` remain unsupported |
131
- | Textures (`Texture`, `RawTexture`, `RawTexture2DArray`, `RawTexture3D`, `DynamicTexture`, `HtmlTexture`, `ExternalTexture`, cube textures) | ⚡ | URL textures support ready-image replacement with material rebinding. Texture/scatter processors support exact constant-only paths; textured operands need BJS's missing procedural render-target pipeline and throw. Arrays, base-level 3D volumes, dynamic/HTML/external textures, and cube environments work; `RenderTargetTexture` / `MirrorTexture` remain unsupported |
131
+ | Textures (`Texture`, `RawTexture`, `RawTexture2DArray`, `RawTexture3D`, `DynamicTexture`, `HtmlTexture`, `ExternalTexture`, cube textures) | ⚡ | URL textures support ready-image replacement with material rebinding. `BaseTexture.readPixels` forwards GPU-backed color textures to Lite RGBA8 readback with mip, array-layer, caller-buffer, and crop support; environment cube handles have no standalone readback allocation. Texture/scatter processors support exact constant-only paths; textured operands need BJS's missing procedural render-target pipeline and throw. Arrays, base-level 3D volumes, dynamic/HTML/external textures, and cube environments work; `RenderTargetTexture` / `MirrorTexture` remain unsupported |
132
132
  | Animation (keyframe `Animation`, easing, `Animatable`, `AnimationGroup` incl. weighted/additive blend) | ⚡ | All standard easing classes, including `PowerEase` / `BezierCurveEase`, reuse Lite's native functional curves; `beginAnimation` / `beginDirectAnimation` delegate supported float/vector/quaternion tracks to Lite property animation; unsupported tracks use an explicit compat evaluator; structural groups remain compat-owned; loaded glTF skeletal blending supported; root-motion analysis/controller APIs throw |
133
133
  | Morph targets (`MorphTarget` / `MorphTargetManager`) | ✅ | over Lite morph targets, including named loader-produced targets and live influence writes |
134
134
  | Sprites (`SpriteManager` / `Sprite`) | ⚡ | camera-facing billboards; `SpriteMap` / packed atlas unsupported |
@@ -137,7 +137,7 @@ overloads within a supported area may still be absent.
137
137
  | Audio V2 (`AudioEngineV2`, `StaticSound`, `StreamingSound`, `AudioBus`, buses/sources/analyzer) | ⚡ | over Lite's AudioV2 port; `MainAudioBus` spatial/analyzer and a second main bus unsupported |
138
138
  | Physics (`HavokPlugin`, `scene.enablePhysics`/`getPhysicsEngine`, `PhysicsAggregate`/`PhysicsBody`/`PhysicsShape`) | ⚡ | Native Havok V2 forwarding for common body/shape operations, thin-instance bodies, and filtered raycasts with instance indices; unrecognized enum values throw at the compat boundary |
139
139
  | Particles (`NodeParticleSystemSet` / `ParticleSystemSet` — Node Particle Editor) | ⚡ | NPE snippet/JSON graphs: `Parse`/`ParseFromSnippetAsync` → `buildAsync` → `start`, with stable named systems through both `set.systems` and `scene.particleSystems`, plus `isStarted`; imperative classic/GPU/solid construction and programmatic block authoring remain unsupported |
140
- | Post-processes, layers (glow/highlight), probes, WebXR | ❌ | Babylon.js wrapper classes remain unsupported; Lite SSAO has materially different sampling/intensity/blur semantics and is available through native tasks |
140
+ | Post-processes, layers (glow/highlight), probes, WebXR | ⚡ | `SSAO2RenderingPipeline` forwards its common scene/camera lifecycle and settings to Lite's native SSAO controller; estimator-specific controls are readback-only. Other Babylon.js post-process wrapper classes, layers, probes, and WebXR remain unsupported |
141
141
 
142
142
  ### `@babylonjs/loaders`
143
143
 
package/index.d.ts CHANGED
@@ -1112,6 +1112,7 @@ export declare abstract class BaseTexture {
1112
1112
  */
1113
1113
  getInternalTexture(): Texture2D | null;
1114
1114
  abstract whenReadyAsync(): Promise<void>;
1115
+ readPixels(faceIndex?: number, level?: number, buffer?: ArrayBufferView | null, _flushRenderer?: boolean, _noDataConversion?: boolean, x?: number, y?: number, width?: number, height?: number): Promise<ArrayBufferView> | null;
1115
1116
  dispose(): void;
1116
1117
  }
1117
1118
 
@@ -1505,6 +1506,7 @@ export declare class Color4 {
1505
1506
  clone(): Color4;
1506
1507
  equals(other: Color4): boolean;
1507
1508
  asArray(): [number, number, number, number];
1509
+ toHexString(returnAsColor3?: boolean): string;
1508
1510
  static FromArray(array: ArrayLike<number>, offset?: number): Color4;
1509
1511
  static FromInts(r: number, g: number, b: number, a: number): Color4;
1510
1512
  }
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { $ as Vector2, A as Material, B as attachMaterialToScene, C as RegisterPolygonBuilder, D as registerMeshAtStart, E as VertexData, F as PBRMetallicRoughnessMaterial, G as BoundingSphere, H as Observable, I as PBRSheenConfiguration, J as transformNormal, K as Matrix, L as PBRSpecularGlossinessMaterial, M as PBRClearCoatConfiguration, N as PBRIridescenceConfiguration, O as MorphTarget, P as PBRMaterial, Q as liteBackedColor3, R as PushMaterial, S as PolygonBuilder, T as VertexBuffer, U as BoundingBox, V as Node, W as BoundingInfo, X as Color3, Y as Quaternion, Z as Color4, _ as GroundMesh, a as CreateDisc, b as Mesh, c as CreateLines, d as CreatePolygonVertexData, et as Vector3, f as CreateSphere, g as ExtrudePolygon, h as CreateTorus, i as CreateDashedLines, it as unsupported, j as PBRAnisotropicConfiguration, k as MorphTargetManager, l as CreatePlane, m as CreateTiledPlane, n as CreateBox, nt as liteBackedVector3, o as CreateGround, p as CreateTiledBox, q as transformCoordinates, r as CreateCylinder, rt as LiteCompatError, s as CreateLineSystem, t as AbstractMesh, tt as Vector4, u as CreatePolygon, v as InstancedMesh, w as TransformNode, x as MeshBuilder, y as LinesMesh, z as StandardMaterial } from "./meshes-FwqJpX7D.js";
2
- import { CharacterSupportedState as CharacterSupportedState$1, GAUSSIAN_SPLATTING_MAX_PART_COUNT, MaxTintMagnitude, MinTemperatureKelvin, PhysicsConstraintAxis as PhysicsConstraintAxis$1, PhysicsConstraintType as PhysicsConstraintType$1, PhysicsMotionType as PhysicsMotionType$1, PhysicsPrestepType as PhysicsPrestepType$1, PhysicsShapeType as PhysicsShapeType$1, VERSION, _getGaussianPointSplattingPackedShBytesPerSplat, _hasGaussianPointSplattingProjectedDepth, addAnimationGroup, addBillboardSpriteIndex, addBillboardSystemToScene, addClusteredLightContainer, addComputeDispatch, addPolarToRef, addSphericalToRef, addSprite2DIndex, addToScene, animateParticleSystem, applyPhysicsBodyForce, applyPhysicsBodyImpulse, attachAxisDragGizmoToNode, attachAxisScaleGizmoToNode, attachBoundingBoxGizmoToNode, attachCameraGizmoToCamera, attachControl, attachFreeControl, attachGeospatialControls, attachLightGizmoToLight, attachPlaneDragGizmoToNode, attachPlaneRotationGizmoToNode, attachPositionGizmoToNode, attachRotationGizmoToNode, attachScaleGizmoToNode, attachSceneSsaoPipeline, backEase, bakeCurrentTransformIntoVertices, bezierCurveEase, billboardBlendAdditive, billboardBlendAlpha, bounceEase, calculatePhysicsCharacterMovementToRef, circleEase, clampGaussianSplattingGpuSortKeyBits, clearAnimationManager, clearBoneOverride, clearStorageBuffer, cloneTransformNode, computeGaussianSplattingGpuSortDepthCoefficients, computeGaussianSplattingGpuSortDepthRange, computeGaussianSplattingGpuSortKeyScale, 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, createExternalTexture, createFacingBillboardSystem, createFreeCamera, createGeospatialCamera, createGpuPicker, createGridMaterial, createHavokWorld, createHemisphericLight, createHtmlTexture, createKhrInteractivityRuntimeValueSnapshot, createLightGizmo, createMeshFromCsg, createMeshesFromCsg2, createMicrophoneSoundSourceAsync, createNullEngine, createParticleBillboard, createPcfDirectionalShadowGenerator, createPcfSpotlightShadowGenerator, createPhysicsAggregate, createPhysicsBody, createPhysicsCharacterController, createPhysicsConstraint, createPhysicsShape, createPickingRay, createPlaneDragGizmo, createPlaneRotationGizmo, createPointLight, createPositionGizmo, createPropertyAnimationClip, createPropertyAnimationGroup, createRectAreaLight, createRotationGizmo, createScaleGizmo, createSceneContext, createSceneSsaoPipeline, createSoundAsync, createSoundBufferAsync, createSoundSourceAsync, createSpotLight, createSprite2DLayer, createSpriteRenderer, createStorageBuffer, createStreamingSoundAsync, createTexture2DArray, createTexture2DArrayFromKtx2, createTexture2DArrayFromPixels, createTexture2DArrayFromUrls, createTexture2DFromPixels, createTexture3DFromPixels, createTransformNode, createUniformBuffer, createUtilityLayer, csg2Add, csg2Intersect, csg2Subtract, csgIntersect, csgSubtract, csgUnion, cubicEase, decodeGaussianSplattingGpuSortSogMean, detachSceneSsaoPipeline, disableGaussianPointSplatting, disableOrthographicCamera, disposeAudioBus, disposeAudioEngine, disposeAxisDragGizmo, disposeAxisScaleGizmo, disposeBoundingBoxGizmo, disposeCameraGizmo, disposeComputeBindingSet, disposeComputeShader, disposeCsg2, disposeEngine, disposeHtmlTexture, disposeLightGizmo, disposePhysics, disposePicker, disposePlaneDragGizmo, disposePlaneRotationGizmo, disposePositionGizmo, disposeRotationGizmo, disposeScaleGizmo, disposeScene, disposeSceneSsaoPipeline, disposeSound, disposeSoundSource, disposeStorageBuffer, disposeStreamingSound, disposeUniformBuffer, disposeUsd, disposeUtilityLayer, dividePolarToRef, divideSphericalToRef, divideTextureProcessConstants, elasticEase, enableAnalyzer, enableAnimationBlending, enableArcRotateKeyboardControls, enableBoneControlForSkinnedAssets, enableGaussianPointSplatting, enableHavokThinInstancePhysicsSync, enableMirroredMeshes, enableOrthographicCamera, enableRectAreaLights, enableSpatial, enableStereo, enableUnsupportedGltfMaterialExtension, encodeIdToColor, exponentialEase, getBoneByName, getByteFrequencyData, getByteTimeDomainData, getCameraPosition, getFloatFrequencyData, getFloatTimeDomainData, getGaussianSplattingGpuSortPaddedCount, getGaussianSplattingGpuSortPassCount, getGaussianSplattingGpuSorterMaxSplatCount, getGaussianSplattingMaxPartCount, getGaussianSplattingPartIndexVaryingDeclaration, getMasterVolume, getMaterialFamily, getMeshSkeleton, getParticleSystems, getPhysicsBodyAngularVelocity, getPhysicsBodyLinearVelocity, getPickedUV, getProjectionMatrix, getVariantNames, getViewMatrix, getWhiteBalanceMatrix, goToFrame, hasDefaultInteractivityFlowInput, initializeCsg2Async, inverseLerp, invertMat4, isExternalTextureReady, isParticleSystemStarted, loadBabylon, loadBasisTexture2D, loadDdsEnvironment, loadEnvironment, loadGltf, loadHdrEnvironment, loadImageToArrayLayer, loadKtxTexture2D, loadSOG, loadSPZ, loadSplat, loadSpriteAtlas, loadTexture2D, loadUsd, markClusteredLightContainerDirty, multiScatterToSingleScatterAlbedoConstants, multiplyMat4, multiplyPolarToRef, multiplySphericalToRef, normalizeInteractivityEventDataConfiguration, normalizeKhrInteractivityRuntimeValue, onBeforeRender, onEngineDeviceLost, onPhysicsAfterStep, onSceneDispose, packGaussianSplattingGpuSortIntervals, packMeshBlendingTag, parseNodeMaterialFromSnippet, parseNodeParticleSetFromSnippet, pauseAnimation, pauseSound, pauseStreamingSound, physicsRaycast, pickAsync, pickMeshesWithRayPrecise, playAnimation, playSound, playStreamingSound, polarFromVec2ToRef, polarToVec2ToRef, powerEase, preloadStreamingInstanceAsync, preloadStreamingInstancesAsync, processAreaLightTexture, quadraticEase, quarticEase, quinticEase, readStorageBufferAfterFrame, rebuildSceneRenderables, registerNodeParticleSet, registerScene, registerSceneWithShadowSupport, registerSpriteRenderer, registerUtilityLayer, releasePhysicsConstraint, releasePhysicsShape, releaseTexture, removeAnimationGroup, removeFromScene, removePhysicsBody, requestHtmlTextureUpdate, resetSkeletonToRest, resetVariant, resizeEngine, resolveCameraViewport, resumeSound, resumeStreamingSound, sampleCatmullRomSpline, sampleHermiteSpline, scalePolarToRef, scaleSphericalToRef, selectVariant, setAnimationAdditive, setBonePosition, setBoneRotationQuaternion, setBoneScaling, setBusVolume, setClipPlane, setEngineSize, setEnvironmentLightingRotation, setEnvironmentSkyboxRotation, setFog, setGeospatialOrientation, setMasterVolume, setParent, 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, singleScatterToMultiScatterAlbedoConstants, sphericalFromVec3ToRef, sphericalToVec3ToRef, spriteBlendAdditive, spriteBlendAlpha, spriteBlendPremultiplied, startEngine, startParticleSystem, stepScene, stopAnimation, stopEngine, stopParticleSystem, stopSound, stopStreamingSound, submitComputeTasks, subtractPolarToRef, subtractSphericalToRef, syncParticleBillboard, temperatureTintToXyz, thinWalledScatterWeightConstants, transmissionFractionConstants, transmissionScatterToSingleScatterAlbedoConstants, unlockAudioEngineAsync, unpackMeshBlendingTag, updateAnimationManager, updateBillboardSpriteIndex, updateDynamicTexture, updateHtmlTexture, updateSpatialAudio, updateSprite2DIndex, updateStorageBufferRange, updateTexture2DArrayFromPixels, updateTexture2DFromPixels, updateUniformBuffer, uploadImageToArrayLayer, whenHtmlTextureReady } from "@babylonjs/lite";
1
+ import { $ as Vector2, A as Material, B as attachMaterialToScene, C as RegisterPolygonBuilder, D as registerMeshAtStart, E as VertexData, F as PBRMetallicRoughnessMaterial, G as BoundingSphere, H as Observable, I as PBRSheenConfiguration, J as transformNormal, K as Matrix, L as PBRSpecularGlossinessMaterial, M as PBRClearCoatConfiguration, N as PBRIridescenceConfiguration, O as MorphTarget, P as PBRMaterial, Q as liteBackedColor3, R as PushMaterial, S as PolygonBuilder, T as VertexBuffer, U as BoundingBox, V as Node, W as BoundingInfo, X as Color3, Y as Quaternion, Z as Color4, _ as GroundMesh, a as CreateDisc, b as Mesh, c as CreateLines, d as CreatePolygonVertexData, et as Vector3, f as CreateSphere, g as ExtrudePolygon, h as CreateTorus, i as CreateDashedLines, it as unsupported, j as PBRAnisotropicConfiguration, k as MorphTargetManager, l as CreatePlane, m as CreateTiledPlane, n as CreateBox, nt as liteBackedVector3, o as CreateGround, p as CreateTiledBox, q as transformCoordinates, r as CreateCylinder, rt as LiteCompatError, s as CreateLineSystem, t as AbstractMesh, tt as Vector4, u as CreatePolygon, v as InstancedMesh, w as TransformNode, x as MeshBuilder, y as LinesMesh, z as StandardMaterial } from "./meshes-CdVN59oi.js";
2
+ import { CharacterSupportedState as CharacterSupportedState$1, GAUSSIAN_SPLATTING_MAX_PART_COUNT, MaxTintMagnitude, MinTemperatureKelvin, PhysicsConstraintAxis as PhysicsConstraintAxis$1, PhysicsConstraintType as PhysicsConstraintType$1, PhysicsMotionType as PhysicsMotionType$1, PhysicsPrestepType as PhysicsPrestepType$1, PhysicsShapeType as PhysicsShapeType$1, VERSION, _getGaussianPointSplattingPackedShBytesPerSplat, _hasGaussianPointSplattingProjectedDepth, addAnimationGroup, addBillboardSpriteIndex, addBillboardSystemToScene, addClusteredLightContainer, addComputeDispatch, addPolarToRef, addSphericalToRef, addSprite2DIndex, addToScene, animateParticleSystem, applyPhysicsBodyForce, applyPhysicsBodyImpulse, attachAxisDragGizmoToNode, attachAxisScaleGizmoToNode, attachBoundingBoxGizmoToNode, attachCameraGizmoToCamera, attachControl, attachFreeControl, attachGeospatialControls, attachLightGizmoToLight, attachPlaneDragGizmoToNode, attachPlaneRotationGizmoToNode, attachPositionGizmoToNode, attachRotationGizmoToNode, attachScaleGizmoToNode, attachSceneSsaoPipeline, backEase, bakeCurrentTransformIntoVertices, bezierCurveEase, billboardBlendAdditive, billboardBlendAlpha, bounceEase, calculatePhysicsCharacterMovementToRef, circleEase, clampGaussianSplattingGpuSortKeyBits, clearAnimationManager, clearBoneOverride, clearStorageBuffer, cloneTransformNode, computeGaussianSplattingGpuSortDepthCoefficients, computeGaussianSplattingGpuSortDepthRange, computeGaussianSplattingGpuSortKeyScale, 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, createExternalTexture, createFacingBillboardSystem, createFreeCamera, createGeospatialCamera, createGpuPicker, createGridMaterial, createHavokWorld, createHemisphericLight, createHtmlTexture, createKhrInteractivityRuntimeValueSnapshot, createLightGizmo, createMeshFromCsg, createMeshesFromCsg2, createMicrophoneSoundSourceAsync, createNullEngine, createParticleBillboard, createPcfDirectionalShadowGenerator, createPcfSpotlightShadowGenerator, createPhysicsAggregate, createPhysicsBody, createPhysicsCharacterController, createPhysicsConstraint, createPhysicsShape, createPickingRay, createPlaneDragGizmo, createPlaneRotationGizmo, createPointLight, createPositionGizmo, createPropertyAnimationClip, createPropertyAnimationGroup, createRectAreaLight, createRotationGizmo, createScaleGizmo, createSceneContext, createSceneSsaoPipeline, createSoundAsync, createSoundBufferAsync, createSoundSourceAsync, createSpotLight, createSprite2DLayer, createSpriteRenderer, createStorageBuffer, createStreamingSoundAsync, createTexture2DArray, createTexture2DArrayFromKtx2, createTexture2DArrayFromPixels, createTexture2DArrayFromUrls, createTexture2DFromPixels, createTexture3DFromPixels, createTransformNode, createUniformBuffer, createUtilityLayer, csg2Add, csg2Intersect, csg2Subtract, csgIntersect, csgSubtract, csgUnion, cubicEase, decodeGaussianSplattingGpuSortSogMean, detachSceneSsaoPipeline, disableGaussianPointSplatting, disableOrthographicCamera, disposeAudioBus, disposeAudioEngine, disposeAxisDragGizmo, disposeAxisScaleGizmo, disposeBoundingBoxGizmo, disposeCameraGizmo, disposeComputeBindingSet, disposeComputeShader, disposeCsg2, disposeEngine, disposeHtmlTexture, disposeLightGizmo, disposePhysics, disposePicker, disposePlaneDragGizmo, disposePlaneRotationGizmo, disposePositionGizmo, disposeRotationGizmo, disposeScaleGizmo, disposeScene, disposeSceneSsaoPipeline, disposeSound, disposeSoundSource, disposeStorageBuffer, disposeStreamingSound, disposeUniformBuffer, disposeUsd, disposeUtilityLayer, dividePolarToRef, divideSphericalToRef, divideTextureProcessConstants, elasticEase, enableAnalyzer, enableAnimationBlending, enableArcRotateKeyboardControls, enableBoneControlForSkinnedAssets, enableGaussianPointSplatting, enableHavokThinInstancePhysicsSync, enableMirroredMeshes, enableOrthographicCamera, enableRectAreaLights, enableSpatial, enableStereo, enableUnsupportedGltfMaterialExtension, encodeIdToColor, exponentialEase, getBoneByName, getByteFrequencyData, getByteTimeDomainData, getCameraPosition, getFloatFrequencyData, getFloatTimeDomainData, getGaussianSplattingGpuSortPaddedCount, getGaussianSplattingGpuSortPassCount, getGaussianSplattingGpuSorterMaxSplatCount, getGaussianSplattingMaxPartCount, getGaussianSplattingPartIndexVaryingDeclaration, getMasterVolume, getMaterialFamily, getMeshSkeleton, getParticleSystems, getPhysicsBodyAngularVelocity, getPhysicsBodyLinearVelocity, getPickedUV, getProjectionMatrix, getTextureReadbackInfo, getVariantNames, getViewMatrix, getWhiteBalanceMatrix, goToFrame, hasDefaultInteractivityFlowInput, initializeCsg2Async, inverseLerp, invertMat4, isExternalTextureReady, isParticleSystemStarted, loadBabylon, loadBasisTexture2D, loadDdsEnvironment, loadEnvironment, loadGltf, loadHdrEnvironment, loadImageToArrayLayer, loadKtxTexture2D, loadSOG, loadSPZ, loadSplat, loadSpriteAtlas, loadTexture2D, loadUsd, markClusteredLightContainerDirty, multiScatterToSingleScatterAlbedoConstants, multiplyMat4, multiplyPolarToRef, multiplySphericalToRef, normalizeInteractivityEventDataConfiguration, normalizeKhrInteractivityRuntimeValue, onBeforeRender, onEngineDeviceLost, onPhysicsAfterStep, onSceneDispose, packGaussianSplattingGpuSortIntervals, packMeshBlendingTag, parseNodeMaterialFromSnippet, parseNodeParticleSetFromSnippet, pauseAnimation, pauseSound, pauseStreamingSound, physicsRaycast, pickAsync, pickMeshesWithRayPrecise, playAnimation, playSound, playStreamingSound, polarFromVec2ToRef, polarToVec2ToRef, powerEase, preloadStreamingInstanceAsync, preloadStreamingInstancesAsync, processAreaLightTexture, quadraticEase, quarticEase, quinticEase, readStorageBufferAfterFrame, readTexturePixelsRGBA8, rebuildSceneRenderables, registerNodeParticleSet, registerScene, registerSceneWithShadowSupport, registerSpriteRenderer, registerUtilityLayer, releasePhysicsConstraint, releasePhysicsShape, releaseTexture, removeAnimationGroup, removeFromScene, removePhysicsBody, requestHtmlTextureUpdate, resetSkeletonToRest, resetVariant, resizeEngine, resolveCameraViewport, resumeSound, resumeStreamingSound, sampleCatmullRomSpline, sampleHermiteSpline, scalePolarToRef, scaleSphericalToRef, selectVariant, setAnimationAdditive, setBonePosition, setBoneRotationQuaternion, setBoneScaling, setBusVolume, setClipPlane, setEngineSize, setEnvironmentLightingRotation, setEnvironmentSkyboxRotation, setFog, setGeospatialOrientation, setMasterVolume, setParent, 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, singleScatterToMultiScatterAlbedoConstants, sphericalFromVec3ToRef, sphericalToVec3ToRef, spriteBlendAdditive, spriteBlendAlpha, spriteBlendPremultiplied, startEngine, startParticleSystem, stepScene, stopAnimation, stopEngine, stopParticleSystem, stopSound, stopStreamingSound, submitComputeTasks, subtractPolarToRef, subtractSphericalToRef, syncParticleBillboard, temperatureTintToXyz, thinWalledScatterWeightConstants, transmissionFractionConstants, transmissionScatterToSingleScatterAlbedoConstants, unlockAudioEngineAsync, unpackMeshBlendingTag, updateAnimationManager, updateBillboardSpriteIndex, updateDynamicTexture, updateHtmlTexture, updateSpatialAudio, updateSprite2DIndex, updateStorageBufferRange, updateTexture2DArrayFromPixels, updateTexture2DFromPixels, updateUniformBuffer, uploadImageToArrayLayer, whenHtmlTextureReady } from "@babylonjs/lite";
3
3
  // \0rolldown/runtime.js
4
4
  var __defProp = Object.defineProperty;
5
5
  var __exportAll = (all, no_symbols) => {
@@ -7190,6 +7190,8 @@ var BaseTexture = class {
7190
7190
  }
7191
7191
  /** @internal The underlying Lite texture handle. Undefined until the async load resolves. */
7192
7192
  _lite;
7193
+ /** @internal Engine used by the optional GPU readback adapter. */
7194
+ _readbackEngine;
7193
7195
  /** @internal One-shot listeners fired when the GPU handle first resolves (see {@link _onReady}). */
7194
7196
  _readyListeners;
7195
7197
  getClassName() {
@@ -7232,6 +7234,34 @@ var BaseTexture = class {
7232
7234
  getInternalTexture() {
7233
7235
  return this._lite ?? null;
7234
7236
  }
7237
+ readPixels(faceIndex = 0, level = 0, buffer = null, _flushRenderer = true, _noDataConversion = false, x = 0, y = 0, width = Number.MAX_VALUE, height = Number.MAX_VALUE) {
7238
+ const texture = this._lite;
7239
+ const engine = this._readbackEngine;
7240
+ if (!texture || !engine) return null;
7241
+ const info = getTextureReadbackInfo(texture);
7242
+ const selection = info.kind === "cube" ? { face: faceIndex } : info.kind === "2d-array" ? { layer: faceIndex } : {};
7243
+ return readTexturePixelsRGBA8(engine, texture, {
7244
+ mipLevel: level,
7245
+ ...selection
7246
+ }).then((result) => {
7247
+ if (!Number.isInteger(x) || !Number.isInteger(y) || x < 0 || y < 0 || x >= result.width || y >= result.height) throw new RangeError(`BaseTexture.readPixels: origin (${x}, ${y}) is outside ${result.width}x${result.height}`);
7248
+ const readWidth = Math.min(result.width, width);
7249
+ const readHeight = Math.min(result.height, height);
7250
+ if (x + readWidth > result.width || y + readHeight > result.height) throw new RangeError(`BaseTexture.readPixels: region (${x}, ${y}, ${readWidth}, ${readHeight}) exceeds ${result.width}x${result.height}`);
7251
+ const rowBytes = readWidth * 4;
7252
+ const pixels = x === 0 && y === 0 && readWidth === result.width && readHeight === result.height ? result.pixels : new Uint8Array(rowBytes * readHeight);
7253
+ if (pixels !== result.pixels) for (let row = 0; row < readHeight; row++) {
7254
+ const start = ((y + row) * result.width + x) * 4;
7255
+ pixels.set(result.pixels.subarray(start, start + rowBytes), row * rowBytes);
7256
+ }
7257
+ if (buffer) {
7258
+ const data = new Uint8Array(buffer.buffer);
7259
+ data.set(pixels.subarray(0, Math.min(data.byteLength, pixels.byteLength)));
7260
+ return data;
7261
+ }
7262
+ return pixels;
7263
+ });
7264
+ }
7235
7265
  dispose() {
7236
7266
  this._levelListeners = void 0;
7237
7267
  }
@@ -7251,6 +7281,7 @@ var HtmlTexture = class extends BaseTexture {
7251
7281
  this.name = name;
7252
7282
  this.element = element;
7253
7283
  this._engine = options.scene?.getEngine() ?? options.engine ?? null;
7284
+ this._readbackEngine = this._engine?._lite;
7254
7285
  this.host = this._engine?.getRenderingCanvas() ?? null;
7255
7286
  if (!this._engine || !element) {
7256
7287
  this._ready = Promise.reject(/* @__PURE__ */ new Error("HtmlTexture requires an engine and HTML element."));
@@ -7362,6 +7393,7 @@ var Texture = class Texture extends BaseTexture {
7362
7393
  const engineWrapper = scene ? void 0 : sceneOrEngine;
7363
7394
  const engine = scene ? scene.getEngine()._lite : engineWrapper._lite;
7364
7395
  this._engine = engine;
7396
+ this._readbackEngine = engine;
7365
7397
  const filterOpts = this.samplingMode === Texture.NEAREST_SAMPLINGMODE || this.samplingMode === Texture.NEAREST_NEAREST ? {
7366
7398
  minFilter: "nearest",
7367
7399
  magFilter: "nearest"
@@ -7460,7 +7492,8 @@ var RawTexture = class RawTexture extends BaseTexture {
7460
7492
  constructor(data, width, height, scene) {
7461
7493
  super();
7462
7494
  this._scene = scene;
7463
- this._lite = createTexture2DFromPixels(scene.getEngine()._lite, data, width, height);
7495
+ this._readbackEngine = scene.getEngine()._lite;
7496
+ this._lite = createTexture2DFromPixels(this._readbackEngine, data, width, height);
7464
7497
  }
7465
7498
  getClassName() {
7466
7499
  return "RawTexture";
@@ -7496,8 +7529,9 @@ var RawTexture3D = class extends BaseTexture {
7496
7529
  this.format = format;
7497
7530
  if (generateMipMaps) unsupported("RawTexture3D(generateMipMaps)", "Babylon.js 3D mip generation renders every depth slice of every level and requires a mip-capable 3D allocation plus a dedicated shader/pipeline. Babylon Lite's public 3D texture factory allocates only one level; adding this GPU subsystem is not a small mechanical extension. Pass false to create a base-level texture.");
7498
7531
  this._scene = scene;
7532
+ this._readbackEngine = scene.getEngine()._lite;
7499
7533
  const bytes = toRgbaBytes(data, width, height, depth);
7500
- this._lite = createTexture3DFromPixels(scene.getEngine()._lite, bytes, width, height, depth);
7534
+ this._lite = createTexture3DFromPixels(this._readbackEngine, bytes, width, height, depth);
7501
7535
  }
7502
7536
  getClassName() {
7503
7537
  return "RawTexture3D";
@@ -7560,6 +7594,7 @@ var DynamicTexture = class extends BaseTexture {
7560
7594
  super();
7561
7595
  this.name = name;
7562
7596
  this._scene = scene;
7597
+ this._readbackEngine = scene.getEngine()._lite;
7563
7598
  this._width = options.width;
7564
7599
  this._height = options.height;
7565
7600
  this._canvas = document.createElement("canvas");
@@ -7568,7 +7603,7 @@ var DynamicTexture = class extends BaseTexture {
7568
7603
  const ctx = this._canvas.getContext("2d");
7569
7604
  if (!ctx) throw new Error("DynamicTexture: 2D canvas context unavailable.");
7570
7605
  this._context = ctx;
7571
- this._dyn = createDynamicTexture(scene.getEngine()._lite, options.width, options.height);
7606
+ this._dyn = createDynamicTexture(this._readbackEngine, options.width, options.height);
7572
7607
  this._lite = this._dyn;
7573
7608
  }
7574
7609
  getClassName() {
@@ -7734,9 +7769,10 @@ var RenderTargetTexture = class {
7734
7769
  };
7735
7770
  // src/lights/area-light-texture-tools.ts
7736
7771
  var ProcessedAreaLightTexture = class extends BaseTexture {
7737
- constructor(texture) {
7772
+ constructor(texture, engine) {
7738
7773
  super();
7739
7774
  this._lite = texture;
7775
+ this._readbackEngine = engine._lite;
7740
7776
  }
7741
7777
  whenReadyAsync() {
7742
7778
  return Promise.resolve();
@@ -7771,7 +7807,7 @@ var AreaLightTextureTools = class {
7771
7807
  const processed = await processAreaLightTexture(this._engine._lite, source._lite);
7772
7808
  this._shaderLanguage = ShaderLanguage.WGSL;
7773
7809
  this._ready = true;
7774
- return new ProcessedAreaLightTexture(processed);
7810
+ return new ProcessedAreaLightTexture(processed, this._engine);
7775
7811
  }
7776
7812
  dispose() {}
7777
7813
  };
@@ -8558,6 +8594,7 @@ var RawTexture2DArray = class RawTexture2DArray extends BaseTexture {
8558
8594
  this.format = format;
8559
8595
  this._sceneRef = scene;
8560
8596
  const engine = scene.getEngine()._lite;
8597
+ this._readbackEngine = engine;
8561
8598
  const tex = data === null ? createTexture2DArray(engine, width, height, depth, { mipMaps: generateMipMaps }) : createTexture2DArrayFromPixels(engine, toRgbaBytes(data, width, height, depth), width, height, depth, { mipMaps: generateMipMaps });
8562
8599
  this._liteArray = tex;
8563
8600
  this._lite = tex;
@@ -8612,6 +8649,7 @@ var RawTexture2DArray = class RawTexture2DArray extends BaseTexture {
8612
8649
  tex._sceneRef = scene;
8613
8650
  tex._liteArray = liteArray;
8614
8651
  tex._lite = liteArray;
8652
+ tex._readbackEngine = scene.getEngine()._lite;
8615
8653
  return tex;
8616
8654
  }
8617
8655
  /** Babylon.js `RawTexture2DArray.CreateRGBATexture` — RGBA raw-bytes factory. */