@needle-tools/gltf-progressive 1.2.12 → 1.2.13

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,161 +1,164 @@
1
- # Changelog
2
- All notable changes to this package will be documented in this file.
3
-
4
- The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
- and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
-
7
- ## [1.2.12] - 2024-09-23
8
- - Add: `assignTextureLOD` now also accepts mesh as parameter
9
- - Change: improved `assignTextureLOD` typing
10
-
11
- ## [1.2.11] - 2024-09-11
12
- - Fix: draco and KTX decoder path handling when gstatic can not be reached and user set path
13
-
14
- ## [1.2.10] - 2024-09-10
15
- - Fix: loading and assigning texture LOD for ShaderMaterial and RawShaderMaterial
16
-
17
- ## [1.2.9] - 2024-07-29
18
- - Fix: server side rendering fixes
19
-
20
- ## [1.2.8] - 2023-07-19
21
- - Add: repository url
22
-
23
- ## [1.2.7] - 2023-07-18
24
- - Fix: include `type: module`
25
-
26
- ## [1.2.5] - 2023-07-16
27
- - Remove: Frustum cull check because we're already operating on the latest renderlist
28
-
29
- ## [1.2.5-beta] - 2023-07-09
30
- - Change: Update skinned mesh bounding box every 30 frames using the lowres mesh version
31
-
32
- ## [1.2.4-beta.1] - 2023-07-09
33
- - Add: LODsManager `manual` property which can be used to manually update the LODs in the scene by calling `LODsManager.update(scene, camera)`
34
- - Fix: updating LODs in WebXR
35
-
36
- ## [1.2.4-beta] - 2023-07-05
37
- - Change: `createLoaders` now returns created loaders and decoders to be re-used
38
-
39
- ## [1.2.3-beta] - 2023-07-04
40
- - Add: support for transmissive objects
41
-
42
- ## [1.2.3-alpha.3] - 2023-07-01
43
- - Add: prevent loading highres textures when user has enabled data-save mode
44
-
45
- ## [1.2.3-alpha.2] - 2023-06-27
46
- - Fix: error caused by parser associations containing `undefined` value
47
-
48
- ## [1.2.3-alpha.1] - 2023-06-25
49
- - Internal: rename `setRaycastMesh` to `registerRaycastMesh`
50
-
51
- ## [1.2.3-alpha] - 2023-06-24
52
- - Change: automatically change LOD update interval based on framerate
53
-
54
- ## [1.2.2-alpha.4] - 2023-06-20
55
- - Add: Register version in global "GLTF_PROGRESSIVE_VERSION" variable
56
- - Add: `<model-viewer>` elements added document at any time are now properly registered
57
- - Fix: LOD updates for multiple `<model-viewer>` elements
58
- - Fix: Initial render tick for a few frames for `<model-viewer>` to trigger LOD updates when the model-viewer element is not animated or interacted with
59
- - Change: `<model-viewer>` elements will fetch a slightly higher texture LOD
60
-
61
- ## [1.2.1-alpha.4] - 2023-06-19
62
- - Fix: SkinnedMesh bounds calculation
63
-
64
- ## [1.2.1-alpha.3] - 2023-06-15
65
- - update the README
66
-
67
- ## [1.2.1-alpha.2] - 2023-06-15
68
- - fix: Ortographic camera causing LODs being falsely updated
69
- - fix: regression introduced in 1.2.1-alpha
70
- - fix: error when trying to load a LOD glTF directly
71
- - fix: issues caused by instanceof in local development environments
72
-
73
- ## [1.2.0-alpha.9] - 2023-06-13
74
- - fix: issue where skinned mesh matrix was falsely applied to calculate screen size
75
- - fix: use bounding box from SkinnedMesh object
76
-
77
- ## [1.2.0-alpha.6] - 2023-06-12
78
- - fix: minor bug where opened glTF has `NEEDLE_progressive` extension but no lods array because the glTF is a LOD variant
79
-
80
- ## [1.2.0-alpha.5] - 2023-06-10
81
- - fix: safeguard when `registerMesh` or `registerTexture` are being called with invalid data
82
- - examples: update vanilla threejs example
83
-
84
- ## [1.2.0-alpha.4] - 2023-06-07
85
- - add: `useRaycastMeshes` method:
86
- ```ts
87
- // call to enable raycasting with low poly raycast meshes
88
- // this can be done once in your project
89
- useRaycastMeshes(true);
90
-
91
- // then use the raycaster as usual
92
- const raycaster = new Raycaster();
93
- raycaster.setFromCamera(mouse, camera);
94
- const intersects = raycaster.intersectObjects(scene.children, true);
95
-
96
- // call to disable raycasting with low polwy meshes
97
- useRaycastMeshes(false);
98
- ```
99
-
100
- ## [1.2.0-alpha.3] - 2023-06-06
101
- - add: automatically load the highest LOD first to show a slightly better quality level as soon as possible
102
- - fix: improve Texture LOD selection by taking LOD level height into account
103
- - fix: correctly assign LOD level information to initially loaded texture
104
-
105
- ## [1.1.0-alpha.2] - 2023-06-05
106
- - fix: register LOD information for meshes that don't have associations
107
-
108
- ## [1.1.0-alpha] - 2023-06-03
109
- - add: loading of multiple texture LOD levels
110
- - fix: issue where material LODs where not updated when the material was cloned
111
- - change: clamp screen coverage when near plane intersects with the object bounds
112
- - change: skip CubeCamera setup
113
- - change: handle cases where an object has only texture LODs
114
-
115
- ## [1.0.0-alpha.19] - 2023-05-31
116
- - add `LODsManager.plugins` getter
117
-
118
- ## [1.0.0-alpha.18] - 2023-05-30
119
- - update README
120
-
121
- ## [1.0.0-alpha.16] - 2023-05-29
122
- - fix: LODs manager now clamps to LOD 0 if the near plane is inside the bounds
123
- - change: Ignore certain material in lods update loop
124
-
125
- ## [1.0.0-alpha.15] - 2023-05-25
126
- - add: `getRaycastMesh` method
127
- - add: LODsManager does now expose `targetTriangleDensity`. The target triangle density is the desired max amount of triangles on screen when the mesh is filling the screen.
128
- - change: create LODsManager via `LODsManager.get(renderer)`
129
-
130
- ## [1.0.0-alpha.13] - 2023-05-24
131
- - fix: modelviewer error when trying to access undefined texture extensions
132
-
133
- ## [1.0.0-alpha.13] - 2023-05-24
134
- - add: vanilla three.js example
135
- - fix: texture LODs losing filter setting
136
-
137
- ## [1.0.0-alpha.12] - 2023-05-19
138
- - fix: update LODs when using postprocessing
139
-
140
- ## [1.0.0-alpha.11] - 2023-05-17
141
- - add: expose `setDracoDecoderLocation` and `setKTX2TranscoderLocation`
142
- - fix: allow using draco decoder and ktx2 transcoder from local filepath
143
-
144
- ## [1.0.0-alpha.10] - 2023-05-07
145
- - fix: progressive assets are now only updated during the main canvas render call and not e.g. when rendering to a texture
146
-
147
- ## [1.0.0-alpha.9] - 2023-05-03
148
- - fix: handle loading of ShaderMaterial for VRM progressive textures
149
-
150
- ## [1.0.0-alpha.8] - 2023-05-03
151
- - fix: handle transparent materials
152
-
153
- ## [1.0.0-alpha.7] - 2023-05-01
154
- - fix: Handle modelviewer `src` set as property but not as attribute
155
- - change: Remove sourcemap
156
-
157
- ## [1.0.0-alpha.6] - 2023-05-01
158
- - fix: LOD mesh assignment for multi-material meshes (meshes with multiple primitives)
159
-
160
- ## [1.0.0-alpha.5] - 2023-04-30
1
+ # Changelog
2
+ All notable changes to this package will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
+ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [1.2.13] - 2024-10-06
8
+ - Update README
9
+
10
+ ## [1.2.12] - 2024-09-23
11
+ - Add: `assignTextureLOD` now also accepts mesh as parameter
12
+ - Change: improved `assignTextureLOD` typing
13
+
14
+ ## [1.2.11] - 2024-09-11
15
+ - Fix: draco and KTX decoder path handling when gstatic can not be reached and user set path
16
+
17
+ ## [1.2.10] - 2024-09-10
18
+ - Fix: loading and assigning texture LOD for ShaderMaterial and RawShaderMaterial
19
+
20
+ ## [1.2.9] - 2024-07-29
21
+ - Fix: server side rendering fixes
22
+
23
+ ## [1.2.8] - 2023-07-19
24
+ - Add: repository url
25
+
26
+ ## [1.2.7] - 2023-07-18
27
+ - Fix: include `type: module`
28
+
29
+ ## [1.2.5] - 2023-07-16
30
+ - Remove: Frustum cull check because we're already operating on the latest renderlist
31
+
32
+ ## [1.2.5-beta] - 2023-07-09
33
+ - Change: Update skinned mesh bounding box every 30 frames using the lowres mesh version
34
+
35
+ ## [1.2.4-beta.1] - 2023-07-09
36
+ - Add: LODsManager `manual` property which can be used to manually update the LODs in the scene by calling `LODsManager.update(scene, camera)`
37
+ - Fix: updating LODs in WebXR
38
+
39
+ ## [1.2.4-beta] - 2023-07-05
40
+ - Change: `createLoaders` now returns created loaders and decoders to be re-used
41
+
42
+ ## [1.2.3-beta] - 2023-07-04
43
+ - Add: support for transmissive objects
44
+
45
+ ## [1.2.3-alpha.3] - 2023-07-01
46
+ - Add: prevent loading highres textures when user has enabled data-save mode
47
+
48
+ ## [1.2.3-alpha.2] - 2023-06-27
49
+ - Fix: error caused by parser associations containing `undefined` value
50
+
51
+ ## [1.2.3-alpha.1] - 2023-06-25
52
+ - Internal: rename `setRaycastMesh` to `registerRaycastMesh`
53
+
54
+ ## [1.2.3-alpha] - 2023-06-24
55
+ - Change: automatically change LOD update interval based on framerate
56
+
57
+ ## [1.2.2-alpha.4] - 2023-06-20
58
+ - Add: Register version in global "GLTF_PROGRESSIVE_VERSION" variable
59
+ - Add: `<model-viewer>` elements added document at any time are now properly registered
60
+ - Fix: LOD updates for multiple `<model-viewer>` elements
61
+ - Fix: Initial render tick for a few frames for `<model-viewer>` to trigger LOD updates when the model-viewer element is not animated or interacted with
62
+ - Change: `<model-viewer>` elements will fetch a slightly higher texture LOD
63
+
64
+ ## [1.2.1-alpha.4] - 2023-06-19
65
+ - Fix: SkinnedMesh bounds calculation
66
+
67
+ ## [1.2.1-alpha.3] - 2023-06-15
68
+ - update the README
69
+
70
+ ## [1.2.1-alpha.2] - 2023-06-15
71
+ - fix: Ortographic camera causing LODs being falsely updated
72
+ - fix: regression introduced in 1.2.1-alpha
73
+ - fix: error when trying to load a LOD glTF directly
74
+ - fix: issues caused by instanceof in local development environments
75
+
76
+ ## [1.2.0-alpha.9] - 2023-06-13
77
+ - fix: issue where skinned mesh matrix was falsely applied to calculate screen size
78
+ - fix: use bounding box from SkinnedMesh object
79
+
80
+ ## [1.2.0-alpha.6] - 2023-06-12
81
+ - fix: minor bug where opened glTF has `NEEDLE_progressive` extension but no lods array because the glTF is a LOD variant
82
+
83
+ ## [1.2.0-alpha.5] - 2023-06-10
84
+ - fix: safeguard when `registerMesh` or `registerTexture` are being called with invalid data
85
+ - examples: update vanilla threejs example
86
+
87
+ ## [1.2.0-alpha.4] - 2023-06-07
88
+ - add: `useRaycastMeshes` method:
89
+ ```ts
90
+ // call to enable raycasting with low poly raycast meshes
91
+ // this can be done once in your project
92
+ useRaycastMeshes(true);
93
+
94
+ // then use the raycaster as usual
95
+ const raycaster = new Raycaster();
96
+ raycaster.setFromCamera(mouse, camera);
97
+ const intersects = raycaster.intersectObjects(scene.children, true);
98
+
99
+ // call to disable raycasting with low polwy meshes
100
+ useRaycastMeshes(false);
101
+ ```
102
+
103
+ ## [1.2.0-alpha.3] - 2023-06-06
104
+ - add: automatically load the highest LOD first to show a slightly better quality level as soon as possible
105
+ - fix: improve Texture LOD selection by taking LOD level height into account
106
+ - fix: correctly assign LOD level information to initially loaded texture
107
+
108
+ ## [1.1.0-alpha.2] - 2023-06-05
109
+ - fix: register LOD information for meshes that don't have associations
110
+
111
+ ## [1.1.0-alpha] - 2023-06-03
112
+ - add: loading of multiple texture LOD levels
113
+ - fix: issue where material LODs where not updated when the material was cloned
114
+ - change: clamp screen coverage when near plane intersects with the object bounds
115
+ - change: skip CubeCamera setup
116
+ - change: handle cases where an object has only texture LODs
117
+
118
+ ## [1.0.0-alpha.19] - 2023-05-31
119
+ - add `LODsManager.plugins` getter
120
+
121
+ ## [1.0.0-alpha.18] - 2023-05-30
122
+ - update README
123
+
124
+ ## [1.0.0-alpha.16] - 2023-05-29
125
+ - fix: LODs manager now clamps to LOD 0 if the near plane is inside the bounds
126
+ - change: Ignore certain material in lods update loop
127
+
128
+ ## [1.0.0-alpha.15] - 2023-05-25
129
+ - add: `getRaycastMesh` method
130
+ - add: LODsManager does now expose `targetTriangleDensity`. The target triangle density is the desired max amount of triangles on screen when the mesh is filling the screen.
131
+ - change: create LODsManager via `LODsManager.get(renderer)`
132
+
133
+ ## [1.0.0-alpha.13] - 2023-05-24
134
+ - fix: modelviewer error when trying to access undefined texture extensions
135
+
136
+ ## [1.0.0-alpha.13] - 2023-05-24
137
+ - add: vanilla three.js example
138
+ - fix: texture LODs losing filter setting
139
+
140
+ ## [1.0.0-alpha.12] - 2023-05-19
141
+ - fix: update LODs when using postprocessing
142
+
143
+ ## [1.0.0-alpha.11] - 2023-05-17
144
+ - add: expose `setDracoDecoderLocation` and `setKTX2TranscoderLocation`
145
+ - fix: allow using draco decoder and ktx2 transcoder from local filepath
146
+
147
+ ## [1.0.0-alpha.10] - 2023-05-07
148
+ - fix: progressive assets are now only updated during the main canvas render call and not e.g. when rendering to a texture
149
+
150
+ ## [1.0.0-alpha.9] - 2023-05-03
151
+ - fix: handle loading of ShaderMaterial for VRM progressive textures
152
+
153
+ ## [1.0.0-alpha.8] - 2023-05-03
154
+ - fix: handle transparent materials
155
+
156
+ ## [1.0.0-alpha.7] - 2023-05-01
157
+ - fix: Handle modelviewer `src` set as property but not as attribute
158
+ - change: Remove sourcemap
159
+
160
+ ## [1.0.0-alpha.6] - 2023-05-01
161
+ - fix: LOD mesh assignment for multi-material meshes (meshes with multiple primitives)
162
+
163
+ ## [1.0.0-alpha.5] - 2023-04-30
161
164
  - initial version
package/README.md CHANGED
@@ -1,125 +1,131 @@
1
- # glTF progressive
2
-
3
- Support for loading of glTF or GLB files with progressive mesh or texture data for three.js based engines.
4
-
5
- ## Features
6
- - Automatic loading of mesh and texture LODs.
7
- - High quality LOD levels are loaded on demand based on screen density.
8
- - Use low-poly LOD meshes for raycasting which allows the usage of high-poly meshes with smooth interaction
9
- - Use [cloud.needle.tools](https://cloud.needle.tools) for processing glTF, GLB & VRM assets
10
-
11
- ## Examples
12
-
13
- Examples are in the `/examples` directory. Live versions can be found in the links below.
14
-
15
- - [Vanilla three.js](https://engine.needle.tools/demos/gltf-progressive/threejs/) - multiple models and animations
16
- - [React Three Fiber](https://engine.needle.tools/demos/gltf-progressive/r3f/)
17
- - \<model-viewer\>
18
- - [single \<model-viewer> element](https://engine.needle.tools/demos/gltf-progressive/modelviewer)
19
- - [multiple \<model-viewer> elements](https://engine.needle.tools/demos/gltf-progressive/modelviewer-multiple)
20
- - [Needle Engine](https://stackblitz.com/edit/needle-engine-gltf-progressive?file=src%2Fmain.ts)
21
-
22
- **Interactive Examples**:
23
- - [Stackblitz](https://stackblitz.com/@marwie/collections/gltf-progressive)
24
- - [Codesandbox](https://codesandbox.io/dashboard/sandboxes/gltf-progressive)
25
-
26
-
27
- <br/>
28
- <video width="320" controls autoplay src="https://engine.needle.tools/demos/gltf-progressive/video.mp4">
29
- <source src="https://engine.needle.tools/demos/gltf-progressive/video.mp4" type="video/mp4">
30
- </video>
31
-
32
-
33
- ## Usage
34
-
35
- ### react three fiber
36
-
37
- Full example in `examples/react-three-fiber`
38
-
39
- ```ts
40
- function ChurchModel() {
41
- const { gl } = useThree()
42
- const url = 'https://engine.needle.tools/demos/gltf-progressive/assets/church/model.glb'
43
- const { scene } = useGLTF(url, false, false, (loader) => {
44
- useNeedleProgressive(url, gl, loader as any)
45
- })
46
- return <primitive object={scene} />
47
- }
48
- ```
49
-
50
- ### threejs (CDN, no bundler)
51
-
52
- The full example can be found at `examples/threejs`
53
-
54
- ```html
55
- <head>
56
- <!-- Add the threejs import map to your HTML head section -->
57
- <script type="importmap">
58
- {
59
- "imports": {
60
- "three": "https://cdn.jsdelivr.net/npm/three@latest/build/three.module.js",
61
- "three/addons/": "https://cdn.jsdelivr.net/npm/three@latest/examples/jsm/",
62
- "three/examples/": "https://cdn.jsdelivr.net/npm/three@latest/examples/",
63
- "@needle-engine/gltf-progressive": "https://www.unpkg.com/@needle-tools/gltf-progressive@latest"
64
- }
65
- }
66
- </script>
67
- </head>
68
- ```
69
-
70
- In your script:
71
- ```ts
72
- const gltfLoader = new GLTFLoader();
73
-
74
- const url = "https://engine.needle.tools/demos/gltf-progressive/assets/church/model.glb";
75
-
76
- // register the progressive loader
77
- useNeedleProgressive(url, renderer, gltfLoader)
78
-
79
- // just call the load method as usual
80
- gltfLoader.load(url, gltf => {
81
- console.log(gltf)
82
- scene.add(gltf.scene)
83
- gltf.scene.position.y += .95;
84
- })
85
- ```
86
-
87
-
88
- ### \<model-viewer\>
89
-
90
- The example can be found in `examples/modelviewer.html`
91
-
92
- ```html
93
- <head>
94
- <!-- Include threejs import map -->
95
- <script type="importmap">
96
- {
97
- "imports": {
98
- "three": "https://unpkg.com/three/build/three.module.js",
99
- "three/": "https://unpkg.com/three/"
100
- }
101
- }
102
- </script>
103
- <!-- Include gltf-progressive -->
104
- <script type="module" src="https://www.unpkg.com/@needle-tools/gltf-progressive@latest"></script>
105
- <!-- Include model-viewer -->
106
- <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.4.0/model-viewer.min.js"></script>
107
- </head>
108
- <body>
109
-
110
- <model-viewer src="https://engine.needle.tools/demos/gltf-progressive/assets/church/model.glb" camera-controls auto-rotate></model-viewer>
111
-
112
- </body>
113
- ```
114
-
115
- ### Needle Engine
116
-
117
- [Needle Engine](https://needle.tools) natively supports progressive loading of these glTF files! See [docs.needle.tools](https://docs.needle.tools) for more information.
118
-
119
-
120
- # Contact ✒️
121
- <b>[🌵 needle — tools for creators](https://needle.tools)</b> •
122
- [Twitter](https://twitter.com/NeedleTools) •
123
- [Discord](https://discord.needle.tools)
124
- [Forum](https://forum.needle.tools)
125
-
1
+ # glTF progressive
2
+
3
+ LODs on steroids for glTF, GLB or VRM files with density based loading for meshes or texture for any three.js based project.
4
+
5
+ ## Features
6
+ - One line integration in any three.js based engine/project
7
+ - Mesh LOD support
8
+ - Texture LOD support
9
+ - LOD levels are loaded on demand based on mesh screen density
10
+ - Low poly LOD meshes can easily be used for raycasting for smooth interactions with high-poly meshes
11
+ - Cloud generation and loading support via [cloud.needle.tools](https://cloud.needle.tools) for glTF, GLB & VRM assets
12
+
13
+ ## Examples
14
+
15
+ Examples are in the `/examples` directory. Live versions can be found in the links below.
16
+
17
+ - [Vanilla three.js](https://engine.needle.tools/demos/gltf-progressive/threejs/) - multiple models and animations
18
+ - [React Three Fiber](https://engine.needle.tools/demos/gltf-progressive/r3f/)
19
+ - \<model-viewer\>
20
+ - [single \<model-viewer> element](https://engine.needle.tools/demos/gltf-progressive/modelviewer)
21
+ - [multiple \<model-viewer> elements](https://engine.needle.tools/demos/gltf-progressive/modelviewer-multiple)
22
+ - [Needle Engine](https://stackblitz.com/edit/needle-engine-gltf-progressive?file=src%2Fmain.ts)
23
+ - [Progressive VRM 14 MB to 1 MB](https://cloud.needle.tools/view/91b4450/262927895)
24
+
25
+ **Interactive Examples**:
26
+ - [Stackblitz](https://stackblitz.com/@marwie/collections/gltf-progressive)
27
+ - [Codesandbox](https://codesandbox.io/dashboard/sandboxes/gltf-progressive)
28
+
29
+
30
+ <br/>
31
+ <video width="320" controls autoplay src="https://engine.needle.tools/demos/gltf-progressive/video.mp4">
32
+ <source src="https://engine.needle.tools/demos/gltf-progressive/video.mp4" type="video/mp4">
33
+ </video>
34
+
35
+
36
+ ## Usage
37
+
38
+ ### react three fiber
39
+
40
+ Full example in `examples/react-three-fiber`
41
+
42
+ ```ts
43
+ function ChurchModel() {
44
+ const { gl } = useThree()
45
+ const url = 'https://engine.needle.tools/demos/gltf-progressive/assets/church/model.glb'
46
+ const { scene } = useGLTF(url, false, false, (loader) => {
47
+ useNeedleProgressive(url, gl, loader as any)
48
+ })
49
+ return <primitive object={scene} />
50
+ }
51
+ ```
52
+
53
+ ### threejs (CDN, no bundler)
54
+
55
+ The full example can be found at `examples/threejs`
56
+
57
+ ```html
58
+ <head>
59
+ <!-- Add the threejs import map to your HTML head section -->
60
+ <script type="importmap">
61
+ {
62
+ "imports": {
63
+ "three": "https://cdn.jsdelivr.net/npm/three@latest/build/three.module.js",
64
+ "three/addons/": "https://cdn.jsdelivr.net/npm/three@latest/examples/jsm/",
65
+ "three/examples/": "https://cdn.jsdelivr.net/npm/three@latest/examples/",
66
+ "@needle-engine/gltf-progressive": "https://www.unpkg.com/@needle-tools/gltf-progressive@latest"
67
+ }
68
+ }
69
+ </script>
70
+ </head>
71
+ ```
72
+
73
+ In your script:
74
+ ```ts
75
+ const gltfLoader = new GLTFLoader();
76
+
77
+ const url = "https://engine.needle.tools/demos/gltf-progressive/assets/church/model.glb";
78
+
79
+ // register the progressive loader
80
+ useNeedleProgressive(url, renderer, gltfLoader)
81
+
82
+ // just call the load method as usual
83
+ gltfLoader.load(url, gltf => {
84
+ console.log(gltf)
85
+ scene.add(gltf.scene)
86
+ gltf.scene.position.y += .95;
87
+ })
88
+ ```
89
+
90
+
91
+ ### \<model-viewer\>
92
+
93
+ The example can be found in `examples/modelviewer.html`
94
+
95
+ ```html
96
+ <head>
97
+ <!-- Include threejs import map -->
98
+ <script type="importmap">
99
+ {
100
+ "imports": {
101
+ "three": "https://unpkg.com/three/build/three.module.js",
102
+ "three/": "https://unpkg.com/three/"
103
+ }
104
+ }
105
+ </script>
106
+ <!-- Include gltf-progressive -->
107
+ <script type="module" src="https://www.unpkg.com/@needle-tools/gltf-progressive@latest"></script>
108
+ <!-- Include model-viewer -->
109
+ <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.4.0/model-viewer.min.js"></script>
110
+ </head>
111
+ <body>
112
+
113
+ <model-viewer src="https://engine.needle.tools/demos/gltf-progressive/assets/church/model.glb" camera-controls auto-rotate></model-viewer>
114
+
115
+ </body>
116
+ ```
117
+
118
+ ### Needle Engine
119
+
120
+ [Needle Engine](https://needle.tools) natively supports progressive loading of these glTF files! See [docs.needle.tools](https://docs.needle.tools) for more information.
121
+
122
+
123
+ Use [cloud.needle.tools](https://cloud.needle.tools) to generate LODs for your assets now.
124
+
125
+
126
+ # Contact ✒️
127
+ <b>[🌵 needle — tools for creators](https://needle.tools)</b> •
128
+ [Twitter](https://twitter.com/NeedleTools) •
129
+ [Discord](https://discord.needle.tools) •
130
+ [Forum](https://forum.needle.tools)
131
+