@needle-tools/gltf-build-pipeline 3.0.1 → 4.0.0-f68c35d

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
@@ -4,6 +4,33 @@ All notable changes to this package will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [4.0.0] - 2026-08-13
8
+
9
+ Gaussian splat compression.
10
+
11
+ ### Added
12
+ - **Splat compression.** The pipeline compresses splat files that a glTF refers to (`.ply`, `.spz`, `.splat`, `.ksplat`, `.sog`, `.lcc`, `.lcc2`) and updates the reference. To run it alone, use `needle-gltf splat <input> [output]`.
13
+ - **RAD output.** Set `config.splat.format` to `'sog'` or `'rad'`. SOG is smaller. RAD contains a LOD tree, so the renderer can stream it. RAD files are about 50% larger than SOG files. The CLI option is `--format`.
14
+ - **Automatic format selection**, which is now the default. `format: 'auto'` selects RAD for scenes with `config.splat.radThreshold` splats or more (default 500,000), and SOG for smaller scenes. The CLI option is `--rad-threshold`.
15
+ - **`build-lod` binaries for Windows and macOS.** RAD output now works without a Rust toolchain. Linux binaries are not included yet.
16
+ - **`--manifest <path>`** writes a JSON file that lists each source file the run replaced. Build tools read it to delete the old files from their own output directory.
17
+ - **`config.splat.flipToYUp`** writes SOG files in Y-up. RAD files are always Y-up.
18
+
19
+ ### Changed
20
+ - The cache now deletes the least recently used files first.
21
+ - The `splat` CLI command now uses the cache.
22
+ - The pipeline deletes a replaced source file only from the output directory, and only after it writes the glTF.
23
+
24
+ ### Fixed
25
+ - Authentication no longer fails when the local license server answers slowly.
26
+ - Splat compression now works when `npx` downloads the tool on Windows.
27
+ - The splat CLI accepts an output file path. The output argument is optional.
28
+ - The pipeline deletes partial output before it starts the CPU fallback.
29
+ - PMREM preread hook registration.
30
+
31
+ ### Notes
32
+ - The binaries add about 3.5 MB to the package.
33
+
7
34
  ## [3.0.0] - 2026-06-23
8
35
 
9
36
  First stable 3.0 release. Summary of the headline changes across the 3.0 alpha/beta cycle.
package/README.md CHANGED
@@ -24,19 +24,26 @@ To load progressively enhanced glTF files in Needle Engine or another three.js b
24
24
  `npx @needle-tools/gltf-build-pipeline@latest`
25
25
 
26
26
  ### Commands
27
+ - `transform <input> [output]` - optimize glTF, GLB and VRM files
28
+ - `splat <input> [output]` - compress Gaussian splat files
29
+ - `pmrem <input>` - convert EXR and Radiance HDR files to KTX2
30
+ - `stats <input> <output>` - write file statistics
31
+ - `clear-caches` - delete all caches
27
32
  - `help` - use help to view options
28
33
 
29
34
  ### Platform support
30
35
 
31
- The bundled `basisu` encoder (used for HDR / EXR → KTX2 HDR) supports:
36
+ Two bundled encoders: `basisu` for HDR / EXR → KTX2 HDR, and `build-lod` for RAD splats.
32
37
 
33
- | OS | Arch | Status |
34
- |---------|-----------------------|--------|
35
- | Linux | x64 | Supported |
36
- | Linux | arm64 | Not supported |
37
- | macOS | arm64 (Apple Silicon) | Supported |
38
- | macOS | x64 (Intel) | Not supported |
39
- | Windows | x64 | Supported |
38
+ | OS | Arch | basisu | build-lod |
39
+ |---------|-----------------------|--------|-----------|
40
+ | Linux | x64 | Supported | Not bundled |
41
+ | Linux | arm64 | Not supported | Not bundled |
42
+ | macOS | arm64 (Apple Silicon) | Supported | Supported |
43
+ | macOS | x64 (Intel) | Not supported | Not supported |
44
+ | Windows | x64 | Supported | Supported |
45
+
46
+ Where `build-lod` is not bundled, splats are written as SOG instead of RAD.
40
47
 
41
48
  ### Configuration
42
49
 
@@ -49,7 +56,8 @@ The pipeline reads an optional `needle.config.json` from the working directory (
49
56
  "textures": { "lods": true },
50
57
  "meshes": { "lods": true },
51
58
  "audio": { "enabled": true, "bitrate": 64 },
52
- "exr": { "enabled": true }
59
+ "exr": { "enabled": true },
60
+ "splat": { "enabled": true, "format": "auto" }
53
61
  }
54
62
  }
55
63
  ```
@@ -64,6 +72,10 @@ The `gltf` value may also be a string shorthand for `usecase` — `"gltf": "prod
64
72
  | `audio.enabled` | `boolean` | `true` | Compress externally referenced lossless audio files (`.wav`, `.flac`, `.aiff`/`.aif`) to Opus in an `.ogg` container, rewriting the URIs in the glTF. Lossy formats (`.mp3`, `.ogg`, `.m4a`, `.aac`) pass through unchanged to avoid compounding compression artifacts. Requires `ffmpeg` with `libopus` on `PATH`; when missing the build logs a warning and leaves the audio files untouched. |
65
73
  | `audio.bitrate` | `number` (kbps) | `128` | Opus encoding bitrate. 96 is near-transparent for most music; 128 matches YouTube's music tier and is the safe "won't sound bad" default. Drop to 48–64 for known mono/UI-only assets. |
66
74
  | `exr.enabled` | `boolean` | `true` | Convert EXR textures to KTX2 HDR via PMREM. When `false`, EXR textures (bundled and externally referenced) are left as-is so a downstream step can handle them. |
75
+ | `splat.enabled` | `boolean` | `true` | Compress externally referenced Gaussian splat files (`.ply`, `.spz`, `.splat`, `.ksplat`, `.sog`), rewriting the URIs in the glTF. |
76
+ | `splat.format` | `"auto" \| "sog" \| "rad"` | `"auto"` | Output container. SOG is smaller and is downloaded whole. RAD contains a LOD tree, so the renderer can stream it, and is about 50% larger. `auto` selects RAD for large scenes and SOG for small ones. |
77
+ | `splat.radThreshold` | `number` | `500000` | Splat count at which `auto` selects RAD. |
78
+ | `splat.flipToYUp` | `boolean` | `false` | Write SOG files in Y-up. Only needed for consumers that do not flip `.sog` themselves. RAD files are always Y-up. |
67
79
 
68
80
  # Contact
69
81