@needle-tools/gltf-progressive 3.1.1 → 3.2.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
@@ -4,6 +4,10 @@ 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
+ ## [3.2.0] - 2025-08-11
8
+ - Change: `useNeedleProgressive` hook parameters. It now only requires the GLTFLoader and WebGLRenderer: `useNeedleProgressive(<loader>, <renderer>)` instead of `useNeedleProgressive(<url>, <renderer>, <loader>)`. This simplify usage when using the same GLTFLoader for multiple different model load operations.
9
+ - Internal: Start of web worker for texture and mesh LOD loading. Currently this can only be enabled by appending the `gltf-progressive-worker` query parameter to the URL.
10
+
7
11
  ## [3.1.1] - 2025-08-07
8
12
  - Fix: Issue where compressed texture did loose LOD information ([issue](https://linear.app/needle/issue/NE-6669))
9
13
  - Chore: Warn once if multi-mesh primitive is detected but compressed asset doesnt have densities per primitive, meaning an older compression pipeline version was used in processing this asset that would require an update for correct LOD updates
package/README.md CHANGED
@@ -1,6 +1,17 @@
1
1
  # glTF progressive
2
2
 
3
- Blazingly fast loading with lazy LODs for glTF, GLB or VRM files + smart density based LOD selection for meshes or texture for any three.js based project.
3
+ **Blazingly fast loading for glTF, GLB or VRM files** + smart density based LOD selection for meshes or texture for any three.js based project.
4
+
5
+ ## Installation
6
+ `npm i @needle-tools/gltf-progressive`
7
+
8
+ ```ts
9
+ import { useNeedleProgressive } from "@needle-tools/gltf-progressive";
10
+
11
+ // Before loading with GLTFLoader
12
+ // call 'useNeedleProgressive' once to register the loader plugin
13
+ useNeedleProgressive(gltf_loader, webgl_renderer)
14
+ ```
4
15
 
5
16
  ## Features
6
17
  - [**Single line integration**](#usage) for any three.js project
@@ -49,7 +60,7 @@ const gltfLoader = new GLTFLoader();
49
60
  const url = "https://cloud.needle.tools/-/assets/Z23hmXBZN45qJ-ZN45qJ-world/file";
50
61
 
51
62
  // register the progressive loader plugin
52
- useNeedleProgressive(url, renderer, gltfLoader)
63
+ useNeedleProgressive(gltfLoader, renderer)
53
64
 
54
65
  // just call the load method as usual
55
66
  gltfLoader.load(url, gltf => {
@@ -83,7 +94,7 @@ function MyModel() {
83
94
  const { gl } = useThree()
84
95
  const url = 'https://cloud.needle.tools/-/assets/Z23hmXBZN45qJ-ZN45qJ-world/file'
85
96
  const { scene } = useGLTF(url, false, false, (loader) => {
86
- useNeedleProgressive(url, gl, loader as any)
97
+ useNeedleProgressive(loader as any, gl as any)
87
98
  })
88
99
  return <primitive object={scene} />
89
100
  }
@@ -11,7 +11,7 @@ function MyModel() {
11
11
  const { gl } = useThree()
12
12
  const url = 'https://engine.needle.tools/demos/gltf-progressive/assets/church/model.glb'
13
13
  const { scene } = useGLTF(url, false, false, (loader) => {
14
- useNeedleProgressive(url, gl, loader as any)
14
+ useNeedleProgressive(loader as any, gl as any);
15
15
  })
16
16
  return <primitive object={scene} />
17
17
  }
@@ -89,7 +89,7 @@ function loadScene() {
89
89
  // Create a new GLTFLoader instance
90
90
  const gltfLoader = new GLTFLoader();
91
91
  /** Call this method to register the progressive loader */
92
- useNeedleProgressive(url, renderer, gltfLoader)
92
+ useNeedleProgressive(gltfLoader, renderer)
93
93
 
94
94
  // just call the load method as usual
95
95
  gltfLoader.load(url, gltf => {