@babylonjs/addons 9.25.0 → 9.26.1

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.
Files changed (46) hide show
  1. package/index.d.ts +1 -0
  2. package/index.js +1 -0
  3. package/index.js.map +1 -1
  4. package/multiTexture/Shaders/multiTextureCompositeAdd.fragment.d.ts +5 -0
  5. package/multiTexture/Shaders/multiTextureCompositeAdd.fragment.js +13 -0
  6. package/multiTexture/Shaders/multiTextureCompositeAdd.fragment.js.map +1 -0
  7. package/multiTexture/Shaders/multiTextureCompositeAlphaBlend.fragment.d.ts +5 -0
  8. package/multiTexture/Shaders/multiTextureCompositeAlphaBlend.fragment.js +19 -0
  9. package/multiTexture/Shaders/multiTextureCompositeAlphaBlend.fragment.js.map +1 -0
  10. package/multiTexture/Shaders/multiTextureCompositeAlphaMax.fragment.d.ts +5 -0
  11. package/multiTexture/Shaders/multiTextureCompositeAlphaMax.fragment.js +13 -0
  12. package/multiTexture/Shaders/multiTextureCompositeAlphaMax.fragment.js.map +1 -0
  13. package/multiTexture/Shaders/multiTextureCompositeMultiply.fragment.d.ts +5 -0
  14. package/multiTexture/Shaders/multiTextureCompositeMultiply.fragment.js +13 -0
  15. package/multiTexture/Shaders/multiTextureCompositeMultiply.fragment.js.map +1 -0
  16. package/multiTexture/Shaders/multiTextureCompositeScreen.fragment.d.ts +5 -0
  17. package/multiTexture/Shaders/multiTextureCompositeScreen.fragment.js +13 -0
  18. package/multiTexture/Shaders/multiTextureCompositeScreen.fragment.js.map +1 -0
  19. package/multiTexture/Shaders/multiTextureCompositeSubtract.fragment.d.ts +5 -0
  20. package/multiTexture/Shaders/multiTextureCompositeSubtract.fragment.js +13 -0
  21. package/multiTexture/Shaders/multiTextureCompositeSubtract.fragment.js.map +1 -0
  22. package/multiTexture/ShadersWGSL/multiTextureCompositeAdd.fragment.d.ts +5 -0
  23. package/multiTexture/ShadersWGSL/multiTextureCompositeAdd.fragment.js +17 -0
  24. package/multiTexture/ShadersWGSL/multiTextureCompositeAdd.fragment.js.map +1 -0
  25. package/multiTexture/ShadersWGSL/multiTextureCompositeAlphaBlend.fragment.d.ts +5 -0
  26. package/multiTexture/ShadersWGSL/multiTextureCompositeAlphaBlend.fragment.js +23 -0
  27. package/multiTexture/ShadersWGSL/multiTextureCompositeAlphaBlend.fragment.js.map +1 -0
  28. package/multiTexture/ShadersWGSL/multiTextureCompositeAlphaMax.fragment.d.ts +5 -0
  29. package/multiTexture/ShadersWGSL/multiTextureCompositeAlphaMax.fragment.js +17 -0
  30. package/multiTexture/ShadersWGSL/multiTextureCompositeAlphaMax.fragment.js.map +1 -0
  31. package/multiTexture/ShadersWGSL/multiTextureCompositeMultiply.fragment.d.ts +5 -0
  32. package/multiTexture/ShadersWGSL/multiTextureCompositeMultiply.fragment.js +16 -0
  33. package/multiTexture/ShadersWGSL/multiTextureCompositeMultiply.fragment.js.map +1 -0
  34. package/multiTexture/ShadersWGSL/multiTextureCompositeScreen.fragment.d.ts +5 -0
  35. package/multiTexture/ShadersWGSL/multiTextureCompositeScreen.fragment.js +17 -0
  36. package/multiTexture/ShadersWGSL/multiTextureCompositeScreen.fragment.js.map +1 -0
  37. package/multiTexture/ShadersWGSL/multiTextureCompositeSubtract.fragment.d.ts +5 -0
  38. package/multiTexture/ShadersWGSL/multiTextureCompositeSubtract.fragment.js +17 -0
  39. package/multiTexture/ShadersWGSL/multiTextureCompositeSubtract.fragment.js.map +1 -0
  40. package/multiTexture/index.d.ts +1 -0
  41. package/multiTexture/index.js +2 -0
  42. package/multiTexture/index.js.map +1 -0
  43. package/multiTexture/multiTexture.d.ts +346 -0
  44. package/multiTexture/multiTexture.js +1051 -0
  45. package/multiTexture/multiTexture.js.map +1 -0
  46. package/package.json +2 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multiTexture.js","sourceRoot":"","sources":["../../../../dev/addons/src/multiTexture/multiTexture.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,E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AAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC3B,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;IAC/B,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAqBX;AArBD,WAAY,cAAc;IACtB;;;;;;;;OAQG;IACH,iEAAe,CAAA;IACf,wIAAwI;IACxI,6DAAa,CAAA;IACb,iDAAiD;IACjD,iDAAO,CAAA;IACP,8DAA8D;IAC9D,2DAAY,CAAA;IACZ,6EAA6E;IAC7E,2DAAY,CAAA;IACZ,sCAAsC;IACtC,uDAAU,CAAA;AACd,CAAC,EArBW,cAAc,KAAd,cAAc,QAqBzB","sourcesContent":["/**\n * MultiTexture: composes an array of image files into a single TEXTURE_2D_ARRAY that can be\n * assigned to a material slot like any other texture.\n *\n * Lives in @babylonjs/addons (not core) because it is an application-oriented, optional feature\n * with WebGL2/WebGPU requirements, URL polling, and a non-trivial memory footprint.\n */\n\nimport { Constants } from \"core/Engines/constants\";\n// Import the side-effect-free registration functions (the .pure variants), not the non-pure\n// wrappers: a wrapper runs its top-level registration at module load, which would eagerly mutate\n// the engine prototypes for every @babylonjs/addons consumer and double-register with the lazy\n// call below. RegisterMultiTexture() invokes them lazily on first MultiTexture construction.\nimport { RegisterEnginesExtensionsEngineTexture2DArrayImageSource } from \"core/Engines/Extensions/engine.texture2DArrayImageSource.pure\";\nimport { RegisterEnginesWebGPUExtensionsEngineTexture2DArrayImageSource } from \"core/Engines/WebGPU/Extensions/engine.texture2DArrayImageSource.pure\";\nimport { Logger } from \"core/Misc/logger\";\nimport { ShaderLanguage } from \"core/Materials/shaderLanguage\";\nimport { type Nullable } from \"core/types\";\nimport { type InternalTexture } from \"core/Materials/Textures/internalTexture\";\nimport { type ThinEngine } from \"core/Engines/thinEngine.pure\";\nimport { type Scene } from \"core/scene.pure\";\nimport { Observable } from \"core/Misc/observable\";\nimport { BaseTexture } from \"core/Materials/Textures/baseTexture.pure\";\nimport { type ISize } from \"core/Maths/math.size\";\nimport { type IProceduralTextureCreationOptions, ProceduralTexture } from \"core/Materials/Textures/Procedurals/proceduralTexture.pure\";\nimport { RawTexture2DArray } from \"core/Materials/Textures/rawTexture2DArray\";\nimport { UploadImageToTexture2DArrayLayer } from \"core/Materials/Textures/rawTexture2DArray.functions\";\nimport { Texture } from \"core/Materials/Textures/texture.pure\";\n/**\n * Options for creating a MultiTexture.\n */\nexport interface IMultiTextureOptions {\n /** Fixed layer resolution. REQUIRED. Positive integer. */\n width: number;\n /** Fixed layer resolution. REQUIRED. Positive integer. */\n height: number;\n /** Array depth to allocate. Optional positive integer; default: urls.length. Must be \\>= urls.length and \\<= the engine's texture2DArrayMaxLayerCount (else throw). Required when urls is empty. */\n maxLayers?: number;\n /** Default MultiBlendMode.ALPHA_BLEND. */\n blendMode?: MultiBlendMode;\n /** Default false. Passed to RawTexture2DArray: mip levels of the LAYER array. On WebGL2 they are consumed by the composite when rttScale less than 1 (trilinear minification); on WebGPU the composite fetches texels exactly, so these mips only affect direct per-layer sampling via `arrayTexture`. The composite RTT itself never has mips (consumed at 1:1 by materials). */\n generateMipMaps?: boolean;\n /** Default Texture.TRILINEAR_SAMPLINGMODE. Passed to RawTexture2DArray. On WebGL2 the composite shader reads the layers through this sampler, so it also drives the composite's mag/min filtering; on WebGPU the composite fetches texels exactly (see the class notes), so it only affects direct per-layer sampling via `arrayTexture`. */\n samplingMode?: number;\n /** Default false. Passed through to UploadImageToTexture2DArrayLayer. */\n premultiplyAlpha?: boolean;\n /** \"resize\" (default): scale to width×height. \"strict\": rejects mismatched dims. */\n fit?: \"resize\" | \"strict\";\n /** Composite RTT resolution = width*rttScale × height*rttScale. Default 1. On WebGL2 values other than 1 produce a filtered (bilinear) rescale of the composite; on WebGPU the composite fetches its texels exactly, so rttScale effectively rescales the render target without filtering. */\n rttScale?: number;\n /** Default false. HEAD-polling change detection. */\n watch?: boolean;\n /** Default 2000 ms. Only used when watch is true. */\n pollInterval?: number;\n /** Fired once after all initial layers have settled (success or failure). */\n onLoad?: () => void;\n /** Fired on any async failure (init, updateLayer, poll). Not thrown. */\n onError?: (message?: string, exception?: any) => void;\n}\n\n/** Composite fragment shader name per blend mode (index aligned with MultiBlendMode). */\nconst FRAGMENT_NAMES = [\n \"multiTextureCompositeAlphaBlend\",\n \"multiTextureCompositeAlphaMax\",\n \"multiTextureCompositeAdd\",\n \"multiTextureCompositeMultiply\",\n \"multiTextureCompositeSubtract\",\n \"multiTextureCompositeScreen\",\n];\n\n/** Defines flag token per blend mode (index aligned with MultiBlendMode). Cache key only - referenced by no shader line. */\nconst MODE_FLAGS = [\"ALPHA_BLEND\", \"ALPHA_MAX\", \"ADD\", \"MULTIPLY\", \"SUBTRACT\", \"SCREEN\"];\n\n/** Maximum number of in-flight decodes during initialization and watch polling. */\nconst DECODE_CONCURRENCY = 4;\n\n/** Default watch-mode poll interval in milliseconds when options.pollInterval is omitted. */\nconst DEFAULT_POLL_INTERVAL_MS = 2000;\n\ninterface ILayerEntry {\n url: string;\n etag: string | null;\n lastModified: string | null;\n /** Always retained until replaced or disposed (enables cheap re-uploads on shift/reallocation). */\n bitmap: ImageBitmap | null;\n /** False until the first successful upload. */\n loaded: boolean;\n /**\n * Per-layer generation token: bumped every time a load for this entry starts. A settling\n * load may only commit state if it still carries the entry's newest generation, so a\n * superseded load (newer updateLayerAsync / watch reload for the same entry) is dropped.\n */\n generation: number;\n /** One-shot warning state: avoids repeated error logging for persistently failing watched layers. */\n warnedLoadFailure: boolean;\n}\n\nlet _Registered = false;\n\n/**\n * Register side effects for MultiTexture.\n * Registers the core 2D-array image-source extensions for both backends (the WebGL2\n * `engine.texture2DArrayImageSource` and its WebGPU counterpart) lazily at first use, matching\n * the Atmosphere addon's convention. Safe to call multiple times; only the first call has an effect.\n */\nexport function RegisterMultiTexture(): void {\n if (_Registered) {\n return;\n }\n _Registered = true;\n\n RegisterEnginesExtensionsEngineTexture2DArrayImageSource();\n RegisterEnginesWebGPUExtensionsEngineTexture2DArrayImageSource();\n}\n\n/**\n * Composes an array of image files into a single TEXTURE_2D_ARRAY and blends the layers per pixel\n * according to a selectable {@link MultiBlendMode}. The blended result is written to a render-target\n * texture that can be assigned to materials like any other texture.\n *\n * Requires a WebGL2 or WebGPU engine (TEXTURE_2D_ARRAY + sampler2DArray). The constructor throws\n * synchronously on WebGL1.\n *\n * Supported source formats are the raster formats your browser can decode with createImageBitmap\n * (PNG, JPEG, WebP, AVIF, GIF first frame, BMP). Compressed/container formats such as KTX2 are NOT\n * supported: the existing KTX2 transcode path goes straight to the GPU (which would bypass the\n * CPU pixel cache this class maintains), and KTX2 containers hold the whole array in a single file\n * (which conflicts with the one-file-per-layer-index update model).\n *\n * Notes:\n * - `url` is null (the base texture loader is not used); the `urls` property is the source of truth.\n * - By default every decoded layer is read back into a CPU `Uint8ClampedArray` (see `pixels`). This\n * costs one canvas readback (and a full-width×height RGBA CPU copy) per (re)load of a layer — it\n * runs on every initial load, `updateLayerAsync` reload, and watch-triggered reload, so frequent\n * reloads or large layers carry a CPU/memory cost (roughly `width × height × 4` bytes per layer).\n * - With `premultiplyAlpha: true` the GPU layers are stored premultiplied, but the CPU `pixels`\n * cache still holds the raw decoded (non-premultiplied) bytes.\n * - The default ALPHA_BLEND mode composites the layers with standard source-over blending: each\n * layer is drawn over the accumulated result, so later layers cover earlier ones and a fully\n * opaque layer hides everything below it. With straight-alpha layers (premultiplyAlpha: false)\n * the fold is the source-over `over` operator (`outA = layer.a + outA * (1 - layer.a)`); with\n * the premultiplied form (`out = layer + out * (1 - layer.a)`). The composite always outputs\n * straight RGBA, so materials see identical pixels regardless of `premultiplyAlpha` (which\n * only controls the layer storage/fold).\n * - ALPHA_MAX picks the sample with the highest alpha; ties (equal alpha) resolve to the highest\n * layer index (last input draws over earlier ones).\n * - With zero active layers, ALPHA_BLEND/ALPHA_MAX/ADD/SUBTRACT/SCREEN output transparent black\n * and MULTIPLY outputs white (empty-product identity).\n * - Compositing is performed independently of the scene render loop: MultiTexture re-composites\n * its internal render target explicitly after every mutation (layer add/insert/remove/update,\n * blend-mode change, array growth), so `scene.proceduralTexturesEnabled` has no effect on it.\n * - How the composite samples the layer array depends on the engine backend, but both are\n * filtered and honour `samplingMode`. On WebGL2 the GLSL composite shader reads the layers\n * through the array sampler (`texture(...)`), so `samplingMode` affects the output, `rttScale`\n * other than 1 produces a filtered bilinear rescale, and (with `generateMipMaps: true`)\n * trilinear minification can use the layer mips. On WebGPU the WGSL composite shader samples\n * the layer array through its sampler at mip 0 (`textureSampleLevel(..., 0.0)`), so `samplingMode`\n * affects the output but only mip-0 filtering applies (no mip-level selection) and `rttScale`\n * rescale is filtered at mip 0. The `_arrayTexture` sampler that materials use to read the\n * per-layer array is unaffected by this backend difference.\n * - `MultiTexture` lives in `@babylonjs/addons` and lazily registers the core 2D-array\n * image-source extensions on first construction, matching the `Atmosphere` addon's convention.\n * No engine mutation occurs at addons import time. `RegisterMultiTexture()` calls both the WebGL2\n * (`engine.texture2DArrayImageSource`) and WebGPU pure registration functions, so a pure/tree-shaken\n * WebGPU build receives `updateTextureArrayLayerFromImageSource` without any extra consumer import.\n * - The allocated array depth (options.maxLayers ?? urls.length) must be a positive integer and no\n * larger than the device limit getCaps().texture2DArrayMaxLayerCount. Empty urls are only accepted\n * together with an explicit options.maxLayers. addLayerAsync/insertLayerAsync double the depth when it is\n * full and throw a RangeError if the doubled depth would exceed that limit.\n */\nexport class MultiTexture extends BaseTexture {\n /**\n * The internal ProceduralTexture that composites the layers into the render-target texture\n * assigned to materials. MultiTexture composes, rather than extends, ProceduralTexture: it\n * creates this composite with `skipSceneRegistration: true` so the scene render loop does not\n * drive it, and calls {@link _renderComposite} explicitly after each mutation. All texture\n * surface methods (isReady/getInternalTexture) forward to it.\n */\n public get composite(): ProceduralTexture {\n return this._compositeInternal;\n }\n private _compositeInternal: ProceduralTexture;\n /** Fired once after all initial layers have settled (success or failure). */\n public readonly onLoadObservable: Observable<MultiTexture> = new Observable<MultiTexture>();\n private _layers: ILayerEntry[];\n private _layerCount: number;\n private _maxLayers: number;\n private _deviceMaxLayerCap: number;\n private _blendMode: MultiBlendMode;\n private _pollTimer: ReturnType<typeof setInterval> | null = null;\n /** True while a _poll() tick is in flight; overlapping interval firings early-return so a slow tick never double-fetches. */\n private _pollInFlight = false;\n private _canvas: Nullable<OffscreenCanvas | HTMLCanvasElement>;\n private _ctx: Nullable<CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D>;\n private _disposed: boolean = false;\n private _mtOptions: IMultiTextureOptions;\n private _arrayTexture: RawTexture2DArray;\n\n /** Number of in-flight mip-suppressed operations (init pool + mutations). See _suppressArrayMips. */\n private _mipSuppressCount = 0;\n /**\n * Number of active layers (drives the uLayerCount uniform). Changes only via addLayerAsync/removeLayerAsync.\n */\n public get layerCount(): number {\n return this._layerCount;\n }\n\n /**\n * The underlying TEXTURE_2D_ARRAY, for users who want to sample individual layers directly.\n */\n public get arrayTexture(): RawTexture2DArray {\n return this._arrayTexture;\n }\n\n /**\n * Forwards to the internal composite: the render-target texture that composites the layers is\n * owned by the composite, so the material samples it through here.\n * @returns The composite's internal texture.\n */\n public override getInternalTexture(): Nullable<InternalTexture> {\n return this.composite.getInternalTexture();\n }\n\n /**\n * Forwards to the internal composite: ready once the composite's render-target texture is ready.\n * @returns True if the composite's render-target texture is ready, otherwise false.\n */\n public override isReady(): boolean {\n return this.composite.isReady();\n }\n\n /**\n * Renders the internal composite, applying the current layer uploads and blend mode.\n * The composite only draws once its effect is compiled (shaders load asynchronously), so the\n * first render is deferred to the compiled callback instead of drawing a stale/empty target.\n */\n private _renderComposite(): void {\n // Kick off effect creation / definition refresh, and ensure getEffect() is populated.\n this.composite.isReady();\n this.composite.executeWhenReady(() => {\n if (!this._disposed) {\n this.composite.render();\n }\n });\n }\n\n /**\n * Forwards to the composite: the composite render-target is what materials sample.\n * @returns The composite render-target size.\n */\n public override getSize(): ISize {\n return this.composite.getSize();\n }\n\n /**\n * Forwards to the composite: the composite render-target base size is what materials sample.\n * @returns The composite render-target base size.\n */\n public override getBaseSize(): ISize {\n return this.composite.getBaseSize();\n }\n\n /**\n * Forwards to the composite's sampling mode.\n * @returns the composite render-target's sampling mode.\n */\n public override get samplingMode(): number {\n return this.composite.samplingMode;\n }\n\n /**\n * Forwards to the composite, which owns the render-target texture the material binds.\n * @param samplingMode the new sampling mode\n * @param generateMipMaps whether to generate mip maps\n */\n public override updateSamplingMode(samplingMode: number, generateMipMaps = false): void {\n this.composite.updateSamplingMode(samplingMode, generateMipMaps);\n }\n\n /**\n * Forwards to the composite's render-target texture.\n * @param faceIndex defines the face of the texture to read (in case of cube texture)\n * @param level defines the LOD level of the texture to read (in case of Mip Maps)\n * @param buffer defines a user defined buffer to fill with data (can be null)\n * @param flushRenderer true to flush the renderer from the pending commands before reading the pixels\n * @param noDataConversion false to convert the data to Uint8Array (if texture type is UNSIGNED_BYTE) or to Float32Array (if texture type is anything but UNSIGNED_BYTE). If true, the type of the generated buffer (if buffer==null) will depend on the type of the texture\n * @param x defines the region x coordinates to start reading from (default to 0)\n * @param y defines the region y coordinates to start reading from (default to 0)\n * @param width defines the region width to read from (default to the texture size at level)\n * @param height defines the region width to read from (default to the texture size at level)\n * @returns the composite render-target's pixel buffer promise.\n */\n public override readPixels(\n faceIndex?: number,\n level?: number,\n buffer?: Nullable<ArrayBufferView>,\n flushRenderer?: boolean,\n noDataConversion?: boolean,\n x?: number,\n y?: number,\n width?: number,\n height?: number\n ): Nullable<Promise<ArrayBufferView>> {\n return this.composite.readPixels(faceIndex, level, buffer, flushRenderer, noDataConversion, x, y, width, height);\n }\n\n /**\n * Forwards to the composite's render-target texture.\n * @param faceIndex defines the face of the texture to read (in case of cube texture)\n * @param level defines the LOD level of the texture to read (in case of Mip Maps)\n * @param buffer defines a user defined buffer to fill with data (can be null)\n * @param flushRenderer true to flush the renderer from the pending commands before reading the pixels\n * @param noDataConversion false to convert the data to Uint8Array (if texture type is UNSIGNED_BYTE) or to Float32Array (if texture type is anything but UNSIGNED_BYTE). If true, the type of the generated buffer (if buffer==null) will depend on the type of the texture\n * @returns the composite render-target's pixel buffer.\n */\n public override _readPixelsSync(\n faceIndex?: number,\n level?: number,\n buffer?: Nullable<ArrayBufferView>,\n flushRenderer?: boolean,\n noDataConversion?: boolean\n ): Nullable<ArrayBufferView> {\n return this.composite._readPixelsSync(faceIndex, level, buffer, flushRenderer, noDataConversion);\n }\n\n /**\n * Forwards to the composite render-target's format.\n * @returns the composite render-target's internal format.\n */\n public override get textureFormat(): number {\n return this.composite.textureFormat;\n }\n\n /**\n * Forwards to the composite render-target's type.\n * @returns the composite render-target's internal type.\n */\n public override get textureType(): number {\n return this.composite.textureType;\n }\n\n /**\n * The input URLs, in layer order. Updated by addLayerAsync/insertLayerAsync/removeLayerAsync/updateLayerAsync.\n */\n public readonly urls: string[];\n\n /**\n * CPU pixel cache. `pixels[i]` is a full `width × height × 4` RGBA (non-premultiplied) copy of\n * decoded layer i, or `null` if that layer has not loaded (yet) or failed to load. It is\n * repopulated on every (re)load of a layer (initial load, `updateLayerAsync`, watch reload) and\n * cleared on dispose. Memory footprint is approximately `width × height × 4` bytes per loaded\n * layer; skip it if you only need the GPU composite and do not read `pixels`.\n */\n public readonly pixels: Array<Uint8ClampedArray | null>;\n\n /**\n * Creates a new MultiTexture.\n * @param name defines the name of the texture\n * @param urls defines the array of image URLs to load as layers\n * @param scene defines the hosting scene\n * @param options defines the creation options (width/height required)\n */\n constructor(name: string, urls: string[], scene: Scene, options: IMultiTextureOptions) {\n super(scene);\n RegisterMultiTexture();\n // The two child GPU resources are allocated mid-construction and must be released if the\n // constructor throws (see the catch below): without them a failure after allocation leaves\n // scene-registered textures whose GPU memory is never freed.\n let compositeAllocated = false;\n let arrayAllocated = false;\n try {\n const engine = scene.getEngine();\n if (!engine || (!engine.isWebGPU && (engine as ThinEngine).webGLVersion < 2)) {\n throw new Error(\n \"MultiTexture requires WebGL2 (TEXTURE_2D_ARRAY + sampler2DArray) or WebGPU. \" +\n \"This context is WebGL1 or unavailable. Create the engine with WebGL2 enabled, e.g. \" +\n \"new Engine(canvas, { webglVersion: 2 }).\"\n );\n }\n\n if (!Number.isInteger(options.width) || options.width <= 0 || !Number.isInteger(options.height) || options.height <= 0) {\n throw new Error(\"MultiTexture: width and height must be positive integers.\");\n }\n\n const deviceMaxLayerCap = engine.getCaps().texture2DArrayMaxLayerCount;\n\n if (options.maxLayers !== undefined && (!Number.isInteger(options.maxLayers) || options.maxLayers < 1)) {\n throw new Error(`MultiTexture: maxLayers must be a positive integer (got ${options.maxLayers}).`);\n }\n if (options.maxLayers === undefined && urls.length === 0) {\n throw new Error(`MultiTexture: urls is empty; pass options.maxLayers (positive integer, <= device limit ${deviceMaxLayerCap}) to define the array depth.`);\n }\n if (options.maxLayers !== undefined && options.maxLayers < urls.length) {\n throw new Error(`MultiTexture: maxLayers (${options.maxLayers}) must be >= urls.length (${urls.length}).`);\n }\n\n const blendMode = options.blendMode ?? MultiBlendMode.ALPHA_BLEND;\n const maxLayers = options.maxLayers ?? urls.length;\n if (maxLayers > deviceMaxLayerCap) {\n throw new Error(\n `MultiTexture: array depth ${maxLayers} exceeds the device limit texture2DArrayMaxLayerCount (${deviceMaxLayerCap}). Pass a smaller maxLayers (or fewer urls) or use a device with a higher limit.`\n );\n }\n const rttW = Math.max(1, Math.round(options.width * (options.rttScale ?? 1)));\n const rttH = Math.max(1, Math.round(options.height * (options.rttScale ?? 1)));\n const generateMipMaps = options.generateMipMaps ?? false;\n const shaderLanguage = engine.isWebGPU ? ShaderLanguage.WGSL : ShaderLanguage.GLSL;\n\n const extraInitializationsAsync = async (): Promise<void> => {\n // Import ALL six fragment companions for this language so any later blend-mode swap\n // finds its source in the store. Static import list - do not build dynamic import paths from variables.\n if (shaderLanguage === ShaderLanguage.WGSL) {\n await Promise.all([\n import(\"./ShadersWGSL/multiTextureCompositeAlphaBlend.fragment\"),\n import(\"./ShadersWGSL/multiTextureCompositeAlphaMax.fragment\"),\n import(\"./ShadersWGSL/multiTextureCompositeAdd.fragment\"),\n import(\"./ShadersWGSL/multiTextureCompositeMultiply.fragment\"),\n import(\"./ShadersWGSL/multiTextureCompositeSubtract.fragment\"),\n import(\"./ShadersWGSL/multiTextureCompositeScreen.fragment\"),\n ]);\n } else {\n await Promise.all([\n import(\"./Shaders/multiTextureCompositeAlphaBlend.fragment\"),\n import(\"./Shaders/multiTextureCompositeAlphaMax.fragment\"),\n import(\"./Shaders/multiTextureCompositeAdd.fragment\"),\n import(\"./Shaders/multiTextureCompositeMultiply.fragment\"),\n import(\"./Shaders/multiTextureCompositeSubtract.fragment\"),\n import(\"./Shaders/multiTextureCompositeScreen.fragment\"),\n ]);\n }\n };\n\n const creationOptions: IProceduralTextureCreationOptions = {\n shaderLanguage,\n extraInitializationsAsync,\n };\n\n this._compositeInternal = new ProceduralTexture(\n name,\n { width: rttW, height: rttH },\n FRAGMENT_NAMES[blendMode],\n scene,\n {\n ...creationOptions,\n skipSceneRegistration: true,\n },\n /*generateMipMaps*/ false,\n /*isCube*/ false,\n Constants.TEXTURETYPE_UNSIGNED_BYTE\n );\n compositeAllocated = true;\n // Ensure texture-surface forwarding reaches the composite and this class behaves as a\n // self-contained BaseTexture (dedicated single-slot texture, scene-aware, render-target).\n this.name = name;\n this.isRenderTarget = true;\n\n this._mtOptions = {\n ...options,\n maxLayers,\n blendMode,\n generateMipMaps,\n samplingMode: options.samplingMode ?? Texture.TRILINEAR_SAMPLINGMODE,\n premultiplyAlpha: options.premultiplyAlpha ?? false,\n fit: options.fit ?? \"resize\",\n rttScale: options.rttScale ?? 1,\n watch: options.watch ?? false,\n pollInterval: options.pollInterval ?? DEFAULT_POLL_INTERVAL_MS,\n };\n this._maxLayers = maxLayers;\n this._deviceMaxLayerCap = deviceMaxLayerCap;\n this._blendMode = blendMode;\n\n this._arrayTexture = new RawTexture2DArray(\n null,\n options.width,\n options.height,\n maxLayers,\n Constants.TEXTUREFORMAT_RGBA,\n scene,\n generateMipMaps,\n /*invertY*/ false,\n options.samplingMode ?? Texture.TRILINEAR_SAMPLINGMODE,\n Constants.TEXTURETYPE_UNSIGNED_BYTE\n );\n this._arrayTexture.name = `${this.name}_2DArray`;\n arrayAllocated = true;\n this._layers = urls.map((url) => this._createLayerEntry(url));\n this._layerCount = this._layers.length;\n this.urls = urls.slice();\n this.pixels = new Array<Uint8ClampedArray | null>(this._layerCount).fill(null);\n\n this.composite.defines = this._buildDefines(MODE_FLAGS[blendMode]);\n this.composite.setTexture(\"uLayers\", this._arrayTexture);\n this.composite.setInt(\"uLayerCount\", this._layerCount);\n\n let canvas: OffscreenCanvas | HTMLCanvasElement | null = null;\n if (typeof OffscreenCanvas !== \"undefined\") {\n canvas = new OffscreenCanvas(options.width, options.height);\n } else if (typeof document !== \"undefined\") {\n canvas = document.createElement(\"canvas\");\n canvas.width = options.width;\n canvas.height = options.height;\n }\n if (!canvas) {\n throw new Error(\"MultiTexture: no 2D canvas surface available (requires DOM or OffscreenCanvas).\");\n }\n this._canvas = canvas;\n // The union overload of getContext can surface non-2D context types (e.g. ImageBitmapRenderingContext)\n // that the \"2d\" id never actually returns; narrow for the field's declared type.\n this._ctx = (canvas.getContext(\"2d\", { willReadFrequently: true }) ?? null) as CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D | null;\n void this._initialize();\n } catch (e) {\n // A failed constructor must not leak the child GPU resources allocated mid-build: the\n // composite render target and the 2D-array are still scene-registered at this point, so\n // abandon them before rethrowing. Cannot delegate to dispose() here because _layers and\n // name may not be assigned yet when the throw predates them.\n if (compositeAllocated) {\n try {\n this._compositeInternal.dispose();\n } catch {\n /* disposal of a partially-built composite must not mask the original error */\n }\n }\n if (arrayAllocated) {\n try {\n this._arrayTexture.dispose();\n } catch {\n /* disposal of a partially-built array must not mask the original error */\n }\n }\n // A failed constructor must not leave a half-built texture registered in the scene\n // (BaseTexture registers `this` via addTexture in super). Roll that back before rethrowing.\n if (scene.textures) {\n const index = scene.textures.indexOf(this);\n if (index >= 0) {\n scene.textures.splice(index, 1);\n scene.onTextureRemovedObservable.notifyObservers(this);\n }\n }\n throw e;\n }\n }\n\n /**\n * How the layers combine. Setting it swaps the composite fragment shader and triggers one\n * re-composite.\n */\n public get blendMode(): MultiBlendMode {\n return this._blendMode;\n }\n\n public set blendMode(value: MultiBlendMode) {\n if (value === this._blendMode) {\n return;\n }\n this._blendMode = value;\n // Both lines are required: setFragment alone would keep the stale cached effect, because the\n // composite only rebuilds its effect when `defines` changes.\n this.composite.setFragment(FRAGMENT_NAMES[value]);\n this.composite.defines = this._buildDefines(MODE_FLAGS[value]);\n this._renderComposite();\n }\n\n /**\n * Replaces a layer by URL. Fetches, decodes and uploads layer i only.\n * Exactly one texSubImage3D is issued for the target layer; uLayerCount is unchanged.\n * @param index defines the layer index to replace\n * @param url defines the new source for the layer\n * @returns a promise resolving once the layer has been uploaded\n */\n public async updateLayerAsync(index: number, url: string): Promise<void> {\n if (!Number.isInteger(index) || index < 0 || index >= this._layerCount) {\n throw new RangeError(`MultiTexture: layer index ${index} out of range [0, ${this._layerCount}).`);\n }\n\n const entry = this._layers[index];\n entry.url = url;\n entry.etag = null;\n entry.lastModified = null;\n entry.warnedLoadFailure = false;\n this.urls[index] = url;\n\n await this._loadEntryOrThrow(entry);\n }\n\n /**\n * Appends a new layer at the end and returns its index. Grows the underlying array (doubling its\n * depth and re-uploading the existing layers from their retained bitmaps) when the current depth\n * is exhausted. Throws a RangeError if the doubled depth would exceed the device's\n * texture2DArrayMaxLayerCount.\n * @param url defines the URL of the image to load as the new layer\n * @returns a promise resolving to the index of the new layer\n */\n public async addLayerAsync(url: string): Promise<number> {\n const newIndex = this._layerCount;\n\n let entry: ILayerEntry;\n // Rebuilding the mip chain once per upload would make a grow (N shifted layers) +\n // the new layer's decode regenerate the whole chain N+1 times. Suppress generation for\n // the entire mutation and build the chain exactly once in the finally below.\n this._suppressArrayMips();\n try {\n if (newIndex >= this._maxLayers) {\n this._growArray();\n }\n entry = this._pushLayerEntry(url);\n // The fragment shader only samples the first uLayerCount layers, so the uniform must\n // track the internal count or the freshly appended layer is never composited.\n this.composite.setInt(\"uLayerCount\", this._layerCount);\n } catch (e) {\n // Release the mip suppression BEFORE reporting: the onError callback may throw, and the\n // release must not be skippable, or later mip regeneration stays disabled.\n this._generateArrayMips();\n this._reportError(e);\n throw e;\n }\n\n // The load reports its own failure (see _loadEntryOrThrow) and rethrows; restore the mip\n // chain in finally so a failed decode still leaves the shifted/available layers mipped.\n try {\n await this._loadEntryOrThrow(entry);\n } finally {\n this._generateArrayMips();\n }\n\n return newIndex;\n }\n\n /**\n * Inserts a new layer at the given index and returns it. Layers at index and above shift up by\n * one: loaded layers are re-uploaded from their retained bitmaps, and a shifted layer that is\n * still loading lands in its new slot when its in-flight load settles (loads resolve against\n * their layer entry, never against a stale index). uLayerCount is incremented. Inserting at\n * `layerCount` appends (addLayerAsync-equivalent). Grows the underlying array (doubling its depth)\n * when the current depth is exhausted, same as addLayerAsync, and throws a RangeError if the doubled\n * depth would exceed the device's texture2DArrayMaxLayerCount.\n * @param index defines the layer index to insert at (0..layerCount, inclusive)\n * @param url defines the URL of the image to load as the new layer\n * @returns a promise resolving to the index of the inserted layer\n */\n public async insertLayerAsync(index: number, url: string): Promise<number> {\n if (!Number.isInteger(index) || index < 0 || index > this._layerCount) {\n throw new RangeError(`MultiTexture: layer index ${index} out of range [0, ${this._layerCount}].`);\n }\n\n let entry: ILayerEntry;\n // Same batching as addLayerAsync: suppression spans the grow/shift uploads AND the new\n // layer's decode, with one final chain generation.\n this._suppressArrayMips();\n try {\n if (this._layerCount + 1 > this._maxLayers) {\n this._growArray();\n }\n\n entry = this._createLayerEntry(url);\n this._layers.splice(index, 0, entry);\n this.pixels.splice(index, 0, null);\n this.urls.splice(index, 0, url);\n this._layerCount++;\n\n // Move the shifted layers up on the GPU before the new layer is decoded, top-down so no\n // slot is overwritten before its old content is re-read.\n for (let j = this._layerCount - 1; j > index; j--) {\n this._reuploadSlot(j);\n }\n\n // The fragment shader only samples the first uLayerCount layers, so the uniform must\n // track the internal count or the freshly inserted layer is never composited.\n this.composite.setInt(\"uLayerCount\", this._layerCount);\n // Re-composite even if the load below fails: the shift above already moved GPU slots.\n this._renderComposite();\n } catch (e) {\n // Release the mip suppression BEFORE reporting: the onError callback may throw, and the\n // release must not be skippable, or later mip regeneration stays disabled.\n this._generateArrayMips();\n this._reportError(e);\n throw e;\n }\n\n // The load reports its own failure (see _loadEntryOrThrow) and rethrows; restore the mip\n // chain in finally so a failed decode still leaves the shifted/available layers mipped.\n try {\n await this._loadEntryOrThrow(entry);\n } finally {\n this._generateArrayMips();\n }\n\n return index;\n }\n\n /**\n * Removes a layer. Higher indices shift down (re-uploaded from their retained bitmaps) and\n * uLayerCount is decremented.\n * @param index defines the layer index to remove\n * @returns a promise resolving once the shift is done\n */\n public async removeLayerAsync(index: number): Promise<void> {\n if (!Number.isInteger(index) || index < 0 || index >= this._layerCount) {\n throw new RangeError(`MultiTexture: layer index ${index} out of range [0, ${this._layerCount}).`);\n }\n const removed = this._layers.splice(index, 1)[0];\n this.pixels.splice(index, 1);\n this.urls.splice(index, 1);\n if (removed.bitmap) {\n removed.bitmap.close();\n }\n this._layerCount--;\n\n // Same batching as the other mutations: suppress mip generation for the shift uploads and\n // rebuild the chain exactly once.\n this._suppressArrayMips();\n try {\n for (let j = index; j < this._layerCount; j++) {\n this._reuploadSlot(j);\n }\n\n // The splice moved every live entry down one slot, so the highest GPU slot (== the new\n // layerCount) is now vacated but still holds the removed layer's pixels. Clear it, or a\n // later addLayerAsync that lands there with a failed load would resurrect the stale\n // layer, and SUBTRACT (which samples layer 0 unconditionally) would show leftover pixel\n // data once the last layer is removed.\n this._clearLayerSlot(this._arrayTexture, this._layerCount);\n\n this.composite.setInt(\"uLayerCount\", this._layerCount);\n this._renderComposite();\n } finally {\n this._generateArrayMips();\n }\n }\n /**\n * Disposes the texture: stops the watch poller, closes every retained bitmap, disposes the layer\n * array and releases the composite render target through the standard procedural-texture path.\n */\n public override dispose(): void {\n if (this._disposed) {\n return;\n }\n this._disposed = true;\n\n if (this._pollTimer !== null) {\n clearInterval(this._pollTimer);\n this._pollTimer = null;\n }\n\n for (let i = 0; i < this._layers.length; i++) {\n const entry = this._layers[i];\n if (entry.bitmap) {\n entry.bitmap.close();\n entry.bitmap = null;\n }\n }\n\n for (let i = 0; i < this.pixels.length; i++) {\n this.pixels[i] = null;\n }\n\n this._layers.length = 0;\n this._canvas = null;\n this._ctx = null;\n\n this._arrayTexture.dispose();\n this.composite.dispose();\n\n // Honor the base-texture dispose contract: fires onDisposeObservable, clears metadata and\n // tears down scene registration. The inherited _texture is null (never set), so the\n // ThinTexture.dispose path is a safe no-op and the array/composite above are the real GPU\n // owners.\n super.dispose();\n }\n\n /**\n * Clones the texture: builds a fresh MultiTexture in the same scene with the same name, the\n * current layer urls and the resolved options (layer resolution, current array capacity,\n * current blend mode, sampling mode, mipmap generation, RTT scale, fit and watch settings).\n * The clone re-fetches and re-decodes its layers from scratch; it never shares the 2D array\n * texture, the pixel cache or the load callbacks (onLoad/onError are not inherited).\n * @returns the cloned texture\n */\n public override clone(): MultiTexture {\n const newTexture = new MultiTexture(this.name, this.urls.slice(), <Scene>this.getScene(), {\n width: this._mtOptions.width,\n height: this._mtOptions.height,\n maxLayers: this._maxLayers,\n blendMode: this._blendMode,\n generateMipMaps: this._mtOptions.generateMipMaps,\n samplingMode: this._mtOptions.samplingMode,\n premultiplyAlpha: this._mtOptions.premultiplyAlpha,\n fit: this._mtOptions.fit,\n rttScale: this._mtOptions.rttScale,\n watch: this._mtOptions.watch,\n pollInterval: this._mtOptions.pollInterval,\n });\n\n // Base texture state carried over per the ProceduralTexture.clone() contract.\n newTexture.hasAlpha = this.hasAlpha;\n newTexture.level = this.level;\n newTexture.coordinatesMode = this.coordinatesMode;\n\n return newTexture;\n }\n\n /**\n * MultiTexture is intentionally not scene-serializable: the scene loader has no parser for it,\n * so the payload produced by the inherited base serialization could never be reconstructed\n * (urls, capacity, blend mode and watch options have no serialized fields). Fails explicitly\n * instead of returning a misleading JSON object.\n * @param _allowEmptyName accepted for signature compatibility; ignored\n * @throws Error always\n */\n public override serialize(_allowEmptyName = false): never {\n throw new Error(\n \"MultiTexture: serialize() is not supported. The scene loader has no MultiTexture parser (urls, capacity, blend mode and watch options cannot round-trip). Use clone() for an in-memory copy, or persist your urls/options to rebuild it.\"\n );\n }\n\n private _buildDefines(flag: string): string {\n return (\n // The loop bound is baked to the device cap, not the current layer count, so growing the\n // array never changes the effect defines (no shader rebuild on addLayerAsync/insertLayerAsync).\n // The uLayerCount uniform bounds sampling, so layers beyond the active count are never read.\n \"#define MULTITEXTURE_MAXLAYERS \" +\n this._deviceMaxLayerCap +\n \"\\n#define MULTITEXTURE_WIDTH \" +\n this._mtOptions.width +\n \"\\n#define MULTITEXTURE_HEIGHT \" +\n this._mtOptions.height +\n \"\\n#define MULTITEXTURE_BLEND_\" +\n flag +\n // ALPHA_BLEND's source-over fold differs for straight-alpha vs premultiplied layers.\n (this._mtOptions.premultiplyAlpha ? \"\\n#define MULTITEXTURE_PREMULTIPLY\" : \"\")\n );\n }\n\n private _bitmapOptions(): ImageBitmapOptions {\n // Straight layers decode at native size and let _uploadToLayer resize via the 2D canvas\n // (which preserves straight RGBA); only premultiplied storage resizes here. \"strict\" fit\n // checks the native size.\n //\n // Memory tradeoff (deliberate): the native-resolution bitmap is retained on each entry for\n // the texture's lifetime so insert/remove shifts re-upload via the same 2D-canvas resize\n // that guarantees straight bytes on both backends. createImageBitmap's resize option is not\n // used here because Chromium premultiplies a resized straight decode, which would silently\n // corrupt the alpha after the first mutation. A straight 1024^2 source targeting 128^2 thus\n // holds ~4 MB per layer instead of ~64 KB; use options.fit \"resize\" together with\n // premultiplyAlpha:true if per-layer memory must shrink (premultiplied storage resizes at\n // decode). Retaining the native bitmap is what keeps the WebGL2/WebGPU byte parity intact.\n const options: ImageBitmapOptions = { premultiplyAlpha: this._mtOptions.premultiplyAlpha ? \"premultiply\" : \"none\" };\n if (this._mtOptions.fit === \"resize\" && this._mtOptions.premultiplyAlpha) {\n options.resizeWidth = this._mtOptions.width;\n options.resizeHeight = this._mtOptions.height;\n options.resizeQuality = \"high\";\n }\n return options;\n }\n\n private _reportError(error: unknown): void {\n const message = String((error as { message?: unknown })?.message ?? error);\n Logger.Error(message);\n this._mtOptions.onError?.(message, error);\n }\n\n private _createLayerEntry(url: string): ILayerEntry {\n return { url, etag: null, lastModified: null, bitmap: null, loaded: false, generation: 0, warnedLoadFailure: false };\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n private async _loadEntryOrThrow(entry: ILayerEntry): Promise<void> {\n // Public addLayer/insertLayer/updateLayerAsync contract: report the failure and rethrow.\n try {\n await this._loadEntry(entry);\n } catch (e) {\n this._reportError(e);\n throw e;\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n private async _loadEntryAndReport(entry: ILayerEntry): Promise<void> {\n // Internal pools (init, watch): report the failure and keep going.\n try {\n await this._loadEntry(entry);\n } catch (e) {\n this._reportError(e);\n }\n }\n\n private _warnWatchFailure(entry: ILayerEntry, detail: string): void {\n if (entry.warnedLoadFailure) {\n return;\n }\n // The entry may have been removed while this tick was running: nothing left to warn about.\n const index = this._layers.indexOf(entry);\n if (index === -1) {\n return;\n }\n entry.warnedLoadFailure = true;\n const message = `MultiTexture: watched layer ${index} (${entry.url}) ${detail}`;\n Logger.Error(message);\n this._mtOptions.onError?.(message);\n }\n private _uploadToLayer(target: RawTexture2DArray, index: number, bitmap: ImageBitmap): void {\n if (this._mtOptions.premultiplyAlpha) {\n UploadImageToTexture2DArrayLayer(target, bitmap, index, { premultiplyAlpha: true });\n return;\n }\n // Straight storage must not resize through createImageBitmap (Chromium premultiplies a\n // resized decode even with premultiplyAlpha \"none\"), so upload the native-sized bitmap and\n // only scale via the 2D canvas drawImage, which preserves straight RGBA.\n const canvas = this._canvas;\n const ctx = this._ctx;\n if (canvas && ctx && (bitmap.width !== this._mtOptions.width || bitmap.height !== this._mtOptions.height)) {\n ctx.clearRect(0, 0, this._mtOptions.width, this._mtOptions.height);\n ctx.drawImage(bitmap, 0, 0, this._mtOptions.width, this._mtOptions.height);\n UploadImageToTexture2DArrayLayer(target, canvas, index, { premultiplyAlpha: false });\n } else {\n UploadImageToTexture2DArrayLayer(target, bitmap, index, { premultiplyAlpha: false });\n }\n }\n private _reuploadSlot(index: number, target: RawTexture2DArray = this._arrayTexture): void {\n const bitmap = this._layers[index].bitmap;\n if (bitmap !== null) {\n this._uploadToLayer(target, index, bitmap);\n } else {\n // A shifted layer with no decoded bitmap (still loading, or its load failed) must not\n // leave the GPU slot holding the PREVIOUS layer: urls/pixels describe a transparent\n // layer here, so upload a cleared canvas (a valid cross-backend ImageSource).\n this._clearLayerSlot(target, index);\n }\n }\n\n private _clearLayerSlot(target: RawTexture2DArray, index: number): void {\n if (!this._canvas || !this._ctx) {\n // No drawable surface to clear from: leave the slot untouched.\n return;\n }\n // Clears a slot to transparent when the shifted layer has no decoded bitmap, so insert/remove\n // never leaves the previous layer's pixels there. A cleared canvas is a valid ImageSource on\n // both backends (unlike raw ImageData).\n this._ctx.clearRect(0, 0, this._mtOptions.width, this._mtOptions.height);\n UploadImageToTexture2DArrayLayer(target, this._canvas, index, { premultiplyAlpha: false });\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n private async _loadEntry(entry: ILayerEntry): Promise<void> {\n // Body runs across awaits; if dispose() wins the race, skip the fetch entirely.\n if (this._disposed) {\n return;\n }\n // Per-layer generation token: every new load for this entry (init, updateLayerAsync,\n // watch reload) supersedes the previous one. The settling load revalidates it in\n // _uploadBitmap before committing any state.\n const generation = ++entry.generation;\n const url = entry.url;\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(`MultiTexture: failed to fetch ${url}: ${response.status} ${response.statusText}`);\n }\n const etag = response.headers.get(\"etag\");\n const lastModified = response.headers.get(\"last-modified\");\n const blob = await response.blob();\n\n const bitmap = await createImageBitmap(blob, this._bitmapOptions());\n\n if (this._mtOptions.fit === \"strict\") {\n const width = bitmap.width;\n const height = bitmap.height;\n if (width !== this._mtOptions.width || height !== this._mtOptions.height) {\n bitmap.close();\n const index = this._layers.indexOf(entry);\n throw new Error(\n `MultiTexture: layer ${index} (${url}) is ${width}x${height}, expected ${this._mtOptions.width}x${this._mtOptions.height}. Use fit: \"resize\" to auto-scale.`\n );\n }\n }\n\n this._uploadBitmap(entry, bitmap, { etag, lastModified, generation });\n }\n\n private _uploadBitmap(entry: ILayerEntry, bitmap: ImageBitmap, meta: { etag: string | null; lastModified: string | null; generation: number }): void {\n // The load resolved across awaits, so revalidate before committing: dispose() may have\n // destroyed the arrays, a mutation may have removed or moved this entry, or a newer load\n // for the same entry may have superseded this one's generation token.\n if (this._disposed) {\n bitmap.close();\n return;\n }\n const index = this._layers.indexOf(entry);\n if (index === -1 || entry.generation !== meta.generation) {\n bitmap.close();\n return;\n }\n\n this._uploadToLayer(this._arrayTexture, index, bitmap);\n\n if (this._canvas && this._ctx) {\n this._ctx.clearRect(0, 0, this._mtOptions.width, this._mtOptions.height);\n this._ctx.drawImage(bitmap, 0, 0, this._mtOptions.width, this._mtOptions.height);\n this.pixels[index] = this._ctx.getImageData(0, 0, this._mtOptions.width, this._mtOptions.height).data.slice();\n } else {\n this.pixels[index] = null;\n }\n\n if (entry.bitmap !== null) {\n entry.bitmap.close();\n }\n entry.bitmap = bitmap;\n entry.loaded = true;\n entry.etag = meta.etag;\n entry.lastModified = meta.lastModified;\n entry.warnedLoadFailure = false;\n\n this._renderComposite();\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n private async _initialize(): Promise<void> {\n try {\n if (this._disposed) {\n // Dispose won the init race; leave the texture as-is, the object is dead.\n return;\n }\n // Suppress mip generation for the whole decode pool so per-layer uploads never rebuild\n // the chain; a single rebuild happens once the pool (and any concurrent mutation) settles.\n this._suppressArrayMips();\n\n // Snapshot the entries so the pool always loads exactly the layers the texture was\n // constructed with: insertLayerAsync/removeLayerAsync may splice _layers while the pool is\n // running, and following live indices would skip a layer or load one twice. Each\n // entry decides its own landing slot when its load settles (see _uploadBitmap).\n const initial = this._layers.slice();\n let next = 0;\n const count = initial.length;\n const workerAsync = async (): Promise<void> => {\n let i: number;\n while ((i = next++) < count) {\n // eslint-disable-next-line no-await-in-loop -- decode pool: each worker processes layers sequentially.\n await this._loadEntryAndReport(initial[i]);\n }\n };\n const workers: Promise<void>[] = [];\n for (let w = 0; w < DECODE_CONCURRENCY; w++) {\n workers.push(workerAsync());\n }\n await Promise.all(workers);\n\n if (!this._disposed) {\n this.onLoadObservable.notifyObservers(this);\n this._mtOptions.onLoad?.();\n\n this._renderComposite();\n }\n if (this._mtOptions.watch) {\n this._startPolling();\n }\n } catch (e) {\n this._reportError(e);\n } finally {\n // Build the chain once over every upload that landed while generation was suppressed,\n // on both the success and error paths (a throwing onLoad/onError must not leave the\n // suppression stuck). The gate re-resolves the LIVE array texture after the pool\n // (mutations may have grown and replaced this._arrayTexture mid-pool), so it never\n // targets a disposed capture.\n this._generateArrayMips();\n }\n }\n\n private _pushLayerEntry(url: string): ILayerEntry {\n const entry = this._createLayerEntry(url);\n this._layers.push(entry);\n this.pixels.push(null);\n this.urls.push(url);\n this._layerCount++;\n return entry;\n }\n\n private _growArray(): void {\n const scene = this.getScene()!;\n const newDepth = this._maxLayers * 2;\n\n if (newDepth > this._deviceMaxLayerCap) {\n throw new RangeError(\n `MultiTexture: cannot grow the array from depth ${this._maxLayers} to ${newDepth}: the device limit texture2DArrayMaxLayerCount is ${this._deviceMaxLayerCap}. Remove a layer, or recreate the MultiTexture with a larger options.maxLayers (<= ${this._deviceMaxLayerCap}) to allow more growth headroom.`\n );\n }\n\n const newRaw = new RawTexture2DArray(\n null,\n this._mtOptions.width,\n this._mtOptions.height,\n newDepth,\n Constants.TEXTUREFORMAT_RGBA,\n scene,\n this._mtOptions.generateMipMaps ?? false,\n /*invertY*/ false,\n this._mtOptions.samplingMode ?? Texture.TRILINEAR_SAMPLINGMODE,\n Constants.TEXTURETYPE_UNSIGNED_BYTE\n );\n const newInternal = newRaw.getInternalTexture();\n // UploadImageToTexture2DArrayLayer regenerates the WHOLE array's mip chain per upload when\n // texture.generateMipMaps is set. Re-uploading N shifted layers would therefore rebuild the\n // full mip chain N times. Suppress generation here and leave the array suppressed: the\n // calling mutation (addLayerAsync/insertLayerAsync) holds the flag off across THIS grow AND\n // the new layer's decode, then rebuilds the chain exactly once via _generateArrayMips.\n if ((this._mtOptions.generateMipMaps ?? false) && newInternal) {\n newInternal.generateMipMaps = false;\n }\n\n for (let i = 0; i < this._layerCount; i++) {\n this._reuploadSlot(i, newRaw);\n }\n\n this._arrayTexture.dispose();\n\n this._arrayTexture = newRaw;\n\n this.composite.setTexture(\"uLayers\", newRaw);\n\n this._maxLayers = newDepth;\n\n // No defines change on growth: MAXLAYERS is baked to the device cap and uLayerCount bounds\n // sampling, so the composite effect is reused and only re-rendered against the grown array.\n this._renderComposite();\n }\n\n // The upload extension regenerates the array's whole mip chain per upload when generateMipMaps\n // is set, so a multi-upload mutation would rebuild it once per upload. Suppress it for the whole\n // mutation and rebuild once (see _generateArrayMips); a counter rather than a boolean lets the\n // init pool and concurrent mutations nest safely.\n private _suppressArrayMips(): void {\n if (!(this._mtOptions.generateMipMaps ?? false) || this._disposed) {\n return;\n }\n const internal = this._arrayTexture.getInternalTexture();\n if (internal) {\n internal.generateMipMaps = false;\n }\n this._mipSuppressCount++;\n }\n\n // Restores mip generation and rebuilds the chain when the last suppressor finishes (count 0);\n // the array was allocated with mip support, so one generateMipmaps covers every upload that ran\n // while generation was suppressed.\n private _generateArrayMips(): void {\n if (this._mipSuppressCount > 0) {\n this._mipSuppressCount--;\n }\n if (this._mipSuppressCount > 0 || !(this._mtOptions.generateMipMaps ?? false) || this._disposed) {\n // Still suppressed by another in-flight op (it will rebuild), or mips are disabled /\n // the object was disposed, so there is nothing to (re)build.\n return;\n }\n const internal = this._arrayTexture.getInternalTexture();\n if (internal) {\n internal.generateMipMaps = true;\n this.getScene()!.getEngine().generateMipmaps(internal);\n }\n }\n\n private _startPolling(): void {\n if (this._pollTimer !== null || this._disposed) {\n return;\n }\n this._pollTimer = setInterval(() => {\n void this._poll();\n }, this._mtOptions.pollInterval);\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n private async _poll(): Promise<void> {\n if (this._pollInFlight) {\n return;\n }\n this._pollInFlight = true;\n if (this._disposed) {\n this._pollInFlight = false;\n return;\n }\n if (typeof document !== \"undefined\" && document.visibilityState === \"hidden\") {\n this._pollInFlight = false;\n return;\n }\n\n const entries = this._layers.slice();\n let next = 0;\n const count = entries.length;\n const workerAsync = async (): Promise<void> => {\n let i: number;\n while ((i = next++) < count) {\n const entry = entries[i];\n try {\n if (entry.etag === null && entry.lastModified === null) {\n // No etag/last-modified recorded for this entry — either it never loaded or\n // the server sends no validators. HEAD-based change detection cannot apply,\n // so retry a direct full load (a 404 at startup that is published later\n // recovers this way instead of being skipped forever).\n try {\n // eslint-disable-next-line no-await-in-loop -- full-load retry, same pool as the HEAD checks below.\n await this._loadEntry(entry);\n } catch (e) {\n // Persistently failing layer: warn once, retry on the next tick.\n this._warnWatchFailure(entry, `failed to load: ${String((e as { message?: unknown })?.message ?? e)}`);\n }\n continue;\n }\n\n // eslint-disable-next-line no-await-in-loop -- poll pool: each worker checks layers sequentially.\n const response = await fetch(entry.url, { method: \"HEAD\" });\n\n if (response.status === 404) {\n this._warnWatchFailure(entry, \"returned 404.\");\n continue;\n }\n\n if (!response.ok) {\n // Transient failure: ignore for this tick.\n continue;\n }\n\n const etag = response.headers.get(\"etag\");\n const lastModified = response.headers.get(\"last-modified\");\n if (etag === null && lastModified === null) {\n // Change detection is unavailable for this entry (server sends no\n // etag/last-modified); nothing to compare against — skip.\n continue;\n }\n\n if ((etag !== null && etag !== entry.etag) || (lastModified !== null && lastModified !== entry.lastModified)) {\n // eslint-disable-next-line no-await-in-loop -- reload happens after the HEAD check above.\n await this._loadEntryAndReport(entry);\n }\n } catch {\n // Transient fetch failure: ignore for this tick.\n }\n }\n };\n\n const workers: Promise<void>[] = [];\n for (let w = 0; w < DECODE_CONCURRENCY; w++) {\n workers.push(workerAsync());\n }\n await Promise.all(workers);\n this._pollInFlight = false;\n }\n}\n\n/**\n * Blend modes controlling how the layers of a MultiTexture are combined per pixel.\n */\nexport enum MultiBlendMode {\n /**\n * Default. Composites the layers with standard source-over alpha blending: each layer is drawn\n * over the accumulated result, so later layers cover earlier ones and a fully opaque layer\n * (a = 1) completely hides everything below it. With straight-alpha layers (premultiplyAlpha:\n * false) the fold is `outA = layer.a + outA * (1 - layer.a)`; with premultiplied layers it is\n * the premultiplied form `out = layer + out * (1 - layer.a)`. The composite always outputs\n * straight RGBA, so materials see identical pixels regardless of `premultiplyAlpha` (which\n * only controls the layer storage/fold). Zero active layers output transparent black.\n */\n ALPHA_BLEND = 0,\n /** Keeps the sample with the highest alpha among the layers (ties: highest index wins). Zero active layers output transparent black. */\n ALPHA_MAX = 1,\n /** Adds all layers per channel, clamped to 1. */\n ADD = 2,\n /** Multiplies all layers per channel (empty product is 1). */\n MULTIPLY = 3,\n /** Starts from layer 0 and subtracts every following layer, clamped to 0. */\n SUBTRACT = 4,\n /** Screens all layers per channel. */\n SCREEN = 5,\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/addons",
3
- "version": "9.25.0",
3
+ "version": "9.26.1",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "types": "index.d.ts",
@@ -19,7 +19,7 @@
19
19
  "postcompile": "build-tools -c add-js-to-es6"
20
20
  },
21
21
  "devDependencies": {
22
- "@babylonjs/core": "9.25.0",
22
+ "@babylonjs/core": "9.26.1",
23
23
  "@dev/addons": "^1.0.0",
24
24
  "@dev/build-tools": "^1.0.0"
25
25
  },