# ChangeLOG

## 1.16.0

1. Features
    - parallelize WebGL splat sorting with WebAssembly SIMD and up to three helper workers on cross-origin isolated pages. The renderer and sorting worker share point centers and sorted indices. Pages without isolation use transferable buffers.
    - support hosting the renderer and its sorting module on a CORS-enabled CDN. The sorting worker and its cross-origin helpers start through Blob URLs, so the host HTML can supply the isolation headers.
2. Changes
    - decode Zstandard streams in ESZ and SPZ v4 files with the bundled libzstd WebAssembly decoder.
3. Fixes
    - release viewport pipeline resources, including shared sort buffers, when destroying a viewport.

## 1.15.0

1. Features
    - sort decoded splats by Morton order by default. Set `mortonSort: false` to preserve file indices and receive sampler chunks in file order. Native `SplatPackType.Sog` keeps its image layout.
    - let `SplatUtils.createSplat(data)` collect streaming data on the CPU. Passing an initialized renderer uploads streaming data to WebGL2 or WebGPU and releases the CPU sampler buffers.
2. Changes
    - stream chunk LOD resources in file order with the default loader and share source textures across nodes that reference the same file. After a renderer reset, reload resources whose only copy was on the previous GPU.
    - reuse WebGL sorting centers across overlapping ranges from the same source and read back only the rows needed for changed ranges.
    - cull fully offscreen Gaussians on WebGL2 before fetching covariance data and projecting the Gaussian.
    - default `Splat.autoFreeResourceOnGpuPacked` to `true` for CPU-backed splats. Direct GPU uploads and LOD nodes set it to `false` to keep their source textures available for repacking.
3. Breaking Changes
    - `SplatLoader.parseSplatData()` now defaults to `stream: true`. Replace `retainData: true` with `stream: false` for editing, serialization, or caching. Rename `chunkBytes` to `streamChunkBytes` (default 16 MiB).
    - `SplatData.collect()` populates the same object and returns `Promise<void>`. Migrate `readChunks()` and `cancel()` to the optional `data.stream.chunks` readable stream. Pass an abort signal to `fetch()` when cancelling a download.
    - remove the parser's `signal` option, `Splat.stream`, and `Splat.readback()`. Retain CPU data before a direct GPU upload or reparse the original asset when CPU access is needed later.
    - direct `Uint8Array` input transfers its backing buffer to the parsing worker. Pass `bytes.slice()` if the caller needs to reuse the original bytes or another view of that buffer.
    - when decoding multiple files in a ZIP, the merged data uses the lowest input spherical-harmonic degree. Load the files separately to preserve each file's higher-order coefficients.

## 1.14.0

1. Features
    - upgrade the bundled Basis Universal transcoder to support XUASTC and XUBC7 KTX2 textures, including matching ASTC block sizes when transcoding XUASTC.
    - prefer BC7 output for XUBC7 textures when supported by the device.
    - accelerate WebGL splat sorting with WebAssembly SIMD, with a JavaScript fallback if initialization fails.
2. Fixes
    - fix initialization of the bundled Basis transcoder WebAssembly module.
    - keep renderer builds compatible with the updated Basis transcoder.
    - improve KTX2 transcoding errors by rejecting zero-byte mip output sizes before transcoding.
    - recompile the affected shaders when changing `Splatting.pack.precalculateEnabled` or `Splatting.pack.repackEnabled` at runtime.
3. Changes
    - align the BC7 output format ID with the transcoder's exported constant.
    - reuse splat center data across camera-only updates to reduce GPU readbacks, and overlap worker sorting with sorted-index texture uploads on WebGL.
4. Breaking Changes
    - remove runtime support for `Splatting.sort.highPrecisionEnabled`; delete it from configuration and presets. WebGL sorting now always uses stable 24-bit depth keys, matching WebGPU.

## 1.13.0

1. Features
    - add `Splatting.sort.radial`, disabled by default, to sort splats by distance from the camera instead of view-direction depth.
    - add `Splatting.pack.repackEnabled`, disabled by default, to repack WebGL rendering textures in sorted order.
2. Fixes
    - improve Gaussian rendering stability and opacity clipping.
3. Changes
    - improve sorting responsiveness for large WebGL splat scenes.
4. Breaking Changes
    - require power-of-two source texture widths when constructing `CompressedSplat` or `SuperCompressedSplat`; invalid widths now throw. Update custom textures and serialized samplers accordingly.

## 1.12.0

1. Features
    - add `retainData`, `chunkBytes`, and `signal` options to `SplatLoader.parseSplatData()`. CPU data is retained by default; `retainData: false` returns metadata and a single-consumer stream with `readChunks()`, `collect()`, and `cancel()`.
    - support streaming uploads through `SplatUtils.createSplat(data, renderer)` to WebGL2 textures or WebGPU source buffers, including image-by-image decoding for native SOG packing.
    - add `Splat.stream` and `Splat.readback()` to restore CPU source data on demand for editing, export, and GPU resource recreation. GPU-only sources must be reloaded after resource release or context/device loss if they have not been read back.
    - add `Splatting.raster.detailCullingAlphaEnabled`, disabled by default, to include Gaussian opacity in detail culling on WebGL and WebGPU.
2. Fixes
    - update the bundled splat worker factory patch for the upstream streaming loader.
    - handle concurrent readback and resources released during readback without restoring stale source data.
    - cancel parsing and release readers, worker tasks, and partially created GPU resources when streaming loads fail or are aborted.
3. Changes
    - read files and URLs in parsing workers and reuse internal encoding buffers to reduce temporary allocations and copies.
    - require `await splat.readback()` before `SplatUtils.createSplatData(splat)` accesses a GPU-only source; existing CPU-backed loading remains the default.
4. Breaking Changes
    - remove `Splatting.raster.normalizedFalloff`; delete it from configuration and presets. Gaussian falloff now always uses the normalized `fastExp` formula.

## 1.11.0

1. Features
    - add `SplatState.DisableSH` to disable view-dependent spherical-harmonic color contributions for individual splats while retaining their base color.
    - add `SplatUtils.LodConfig.pixelLimitEnabled`, enabled by default, to control the viewport-based sampling limit; disabling it allows further refinement within the existing level and point-budget constraints.
2. Fixes
    - preserve TypedArray `byteOffset` and `byteLength` when converting between splat samplers and `SourceTexture`.
    - decode image-backed splat data textures with `createImageBitmap`, with color-space conversion and alpha premultiplication disabled to preserve encoded data.
3. Breaking Changes
    - remove `Splatting.pack.sortedLayoutEnabled`; delete it from renderer configuration and presets.
    - remove the upstream `Splatting.sort.frustumCullingEnabled` and `Splatting.sort.frustumCullingClipScale` settings. `SplatUtils.LodConfig.frustumCullingEnabled` remains available for chunk unloading.
    - move `Splatting.toneMapping.toneMapping` and `Splatting.toneMapping.exposure` to `Splatting.composite.toneMapping` and `Splatting.composite.exposure`.
    - remove `Splatting.toneMapping.enabled`; `Splatting.composite.enabled` now controls both offscreen composition and tone mapping. Set `composite.highPrecisionEnabled: true` explicitly to retain the floating-point intermediate buffer previously used by tone mapping. For composition without a nonlinear tone curve, use `ToneMapping.Linear` with `exposure: 1`.

## 1.10.0

1. Features
    - support loading and merging multiple splat files from ZIP archives through `SplatLoader.parseSplatData()`; `SplatPackType.Sog` remains limited to a single SOG asset.
    - add `extras.includeOtherFormats` to include other independent splat formats from ZIP archives; defaults to `false`, loading only the requested format.
    - support optional voxel-based occlusion downgrading in `SplatUtils.LodSplat` through `LodMeta.voxels` and a `parseVoxel` constructor callback.
    - add `LodConfig.movingMinLevel` to limit new LOD refinement while the camera is moving; defaults to `2`, with `0` representing the finest level.
    - expose `LodSplat.flush()` and add `LodSplat.stop()` for application-managed frame loops, and support an optional render-pixel viewport in `LodSplat.tick(camera, viewport)`.
2. Fixes
    - release LOD GPU resources on destruction and failed resource preparation while preserving textures still shared by active splats.
    - propagate LOD resource loading and replacement failures through `LodSplat.onFinishSchedule()`.
3. Changes
    - reorganize splat-loader utilities and centralize ZIP extraction and resource path resolution for SOG, LCC, and LCC2 assets.
    - allocate LOD detail by projected screen area and splat budget, with a viewport-based sampling limit when a viewport is available.
    - prioritize coarse scene coverage, pace detail updates and node merging, and validate pending LOD replacements before retiring displayed splats.
    - pass an optional `AbortSignal` to custom LOD resource loaders, cancel unused requests, and retain idle resources within a point-count budget.
    - measure `LodConfig.hysteresisTicks` as elapsed time in nominal 60 Hz ticks, independent of how often `LodSplat.tick()` is called.
    - reduce redundant splat repacking and texture reallocations during LOD updates.
4. Breaking Changes
    - change low-level `SplatLoader.SogFile`, `SplatLoader.LccFile`, and `SplatLoader.Lcc2File` readers to consume metadata streams, with a file context for archive resources; use `SplatLoader.parseSplatData()` to load ZIP archives.
    - remove `LodConfig.backgroundPenalty` and `LodConfig.distanceStep`; use `minLevel`, `movingMinLevel`, and `maxBudget` to control LOD detail under the new allocation strategy.

## 1.9.0

1. Features
    - add LCC2 loading through `SplatLoader.SplatFileType.LCC2`, with `parseSplatData()` supporting `extras.lodLevel` to select the LOD level; defaults to `0`.
    - support 2D float and unsigned integer `SourceTexture` inputs in `SplatModifier`, including texture updates through `update()`.
2. Fixes
    - handle asynchronous splat sorting failures and cancel pending work when the renderer is destroyed or its context is lost.
    - detect LCC metadata with any `.lcc` filename inside ZIP archives.

## 1.8.1

1. Fixes
    - fix quaternion decoding in `CompressedSplatData` for compressed splat data.

## 1.8.0

1. Features
    - add and export the `XR` namespace.
    - add `LodSplat.setModifiers()` for applying `SplatModifier` instances to LOD splats.
    - add `LodConfig.frustumCullingEnabled` to control unloading LOD blocks outside the camera frustum; enabled by default.
2. Changes
    - update the default LOD distance step to `{ distance: 10, step: 2 }` and improve scheduling for large scenes.
3. Breaking Changes
    - remove `LodConfig.outsidePenalty`, `behindPenalty`, `behindTolerance`, and `behindDistanceTolerance`.

## 1.7.2

1. Changes
    - update the `SplatModifier` shader block factory callback to receive `language: 'wgsl' | 'glsl'` instead of `isWebgpu: boolean`.

## 1.7.0

1. Features
    - add and export `SplatModifier` for composing custom shader-based splat rendering and animation behavior.
    - add `Splat.setModifiers()` for attaching modifiers and updating their uniform values at runtime.
2. Changes
    - use `SplatModifier` for LOD debug coloring.
3. Breaking Changes
    - remove subgroup transform support, including `Splat.groupTex` and `Splat.groupTransformTex`.

## 1.6.2

1. Fixes
    - fix ESZ and SOG image decoding when the encoded image data uses a sliced buffer.
    - fix Zstandard parsing for small files.
2. Changes
    - set the maximum splat parsing worker count to one fewer than `navigator.hardwareConcurrency`.

## 1.6.1

1. Features
    - add `SplatUtils.LodConfig.mergeNodeEnabled` to control LOD node merging and reduce scheduling peaks.
2. Fixes
    - fix incomplete LOD coverage when the total splat count of the lowest levels exceeds `maxBudget`.

## 1.6.0

1. Features
    - add ESZ v2 splat loading with a Zstandard streaming container and low/high layout support.
    - optimize SPZ v4 loading with streaming parsing to reduce parse time and peak worker memory.
2. Fixes
    - fix `SplatReorderMaterial` mobile compatibility by packing splat reorder ranges into `ivec4` uniforms.
    - fix `SuperCompressedSplatData` SH quantization overflow and second-order SH coefficient offsets.
    - fix worker message cleanup.
3. Changes
    - upgrade bundled EGS packages to standard ESM packaging with limited public package exports.
    - optimize splat stream parsing to reduce intermediate buffers and data copies.
    - ESZ v1 files are no longer supported.

## 1.5.1

1. Fixes
    - fix `lod` scheduling to avoid temporarily creating too many active splats.
2. Changes
    - move splat sorting ownership to `SplatUtils`; `SplatLoader` now only parses files.

## 1.5.0

1. Features
    - add `Splatting.pack.forceUnstableEnabled` to force the complete rendering pipeline.
    - add `Splatting.sort.frustumCullingEnabled` to pre-cull splats for better performance.
        - this can make black borders during camera rotation more visible, so enable it carefully in production scenes.
    - add `Limits` for describing `IRenderer` limits.
        - some `Capabilities` fields are now marked as deprecated.
    - add `lod.proxy` to reduce the number of runtime `Splat` objects.
        - reduces `pack` and `precalculate` GPU cost by 50%-90% in real scenes.
2. Fixes
    - fix `SplatHighlightKernel` highlights being offset when `cameraRelativeEnabled` is enabled.
    - fix `clear` not taking effect correctly when `MRT` is enabled.
    - fix invalid data when using low-precision packing.
    - fix the `LodMeta.version` type definition.
3. Changes
    - optimize texture-size calculation to improve rendering performance for scenes with a single `Splat` object.
    - move sorting to a dedicated worker to avoid long parsing tasks blocking sorting.

## 1.4.1

1. Fixes
    - fix `packCameraRelativeCenterIsDirty` being incorrectly evaluated as `true` when camera-relative center packing is disabled.

## 1.4.0

1. Features
    - add `texture-loader`, now `downloadTexture` is a generic texture load
        - supported types: image types(png, jpg, webp, etc...), ktx2 and dds
    - add grouped `Splatting` config: `pack`, `raster`, `sort`, and `composite`.
    - add high-precision and camera-relative splat packing, plus high-precision sorting.
    - `combineSplatData` target `SplatData` support.
2. Changes
    - adjust splat-related default parameters from the underlying renderer pipeline.

## 1.3.0

1. Features
    - `SplatUtils`add support for `center` and `ellipsoid`
        > **`constructor` has been changed, migrate: `new SplatBVH(operator)` -> `new BVH(SplatCenterPrimitiveSource(operator))`**
2. Fixes
    - `SplatUtils`state texture type change to `r8uint`

## 1.2.9

1. Features
    - use `api-extractor` to rollup dts.
    - add `esz` and `spzV4` format support.
2. Fixes
    - fix typing for `MeshBasicMaterial.setValues`
    - fix typing for `MeshPhongMaterial.setValues`
    - Simplify some material typings
    - fix type only classes
    - cleanup `package.json`

## 1.1.0

1. Features
    - upgrade packages: `typescript@^6.0.3`, `tslib@^2.8.1`
    - sync base packages
    - remove unused module `render-cloud`

## 1.0.0

1. Features
    - First release
