@stowkit/three-loader 0.1.4 → 0.1.5
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/README.md +17 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,9 +15,10 @@ import * as THREE from 'three';
|
|
|
15
15
|
import { StowKitLoader } from '@stowkit/three-loader';
|
|
16
16
|
|
|
17
17
|
// Create loader (auto-configured with defaults)
|
|
18
|
+
// Draco decoder is auto-configured to /stowkit/draco/
|
|
18
19
|
const loader = new StowKitLoader();
|
|
19
20
|
|
|
20
|
-
// Optional:
|
|
21
|
+
// Optional: Override default paths if needed
|
|
21
22
|
// loader.setDracoDecoderPath('/custom-draco-path/');
|
|
22
23
|
// loader.setTranscoderPath('/custom-basis-path/');
|
|
23
24
|
|
|
@@ -32,11 +33,13 @@ threeScene.add(scene);
|
|
|
32
33
|
## Features
|
|
33
34
|
|
|
34
35
|
- ✅ **Zero configuration** - Works out of the box with sensible defaults
|
|
36
|
+
- ✅ **Draco mesh compression** - All meshes use Draco compression for smaller file sizes
|
|
35
37
|
- ✅ **Automatic texture loading** - Materials reference textures by ID, loader handles everything
|
|
36
38
|
- ✅ **Material system** - Full support for material schemas, properties, and assignments
|
|
37
39
|
- ✅ **KTX2/Basis Universal** - GPU-compressed textures with automatic transcoding
|
|
38
40
|
- ✅ **Scene hierarchy** - Preserves transforms, parent-child relationships, and node structure
|
|
39
41
|
- ✅ **Multi-material meshes** - Supports meshes with multiple materials/submeshes
|
|
42
|
+
- ✅ **Draco decoder included** - No need to download separately, auto-copied on install
|
|
40
43
|
- ✅ **Type-safe** - Full TypeScript definitions included
|
|
41
44
|
|
|
42
45
|
## API Reference
|
|
@@ -488,19 +491,24 @@ Place these files in your public folder:
|
|
|
488
491
|
|
|
489
492
|
```
|
|
490
493
|
public/
|
|
491
|
-
├── stowkit_reader.wasm # WASM reader module
|
|
494
|
+
├── stowkit_reader.wasm # WASM reader module
|
|
492
495
|
├── basis/ # Basis Universal transcoder (for textures)
|
|
493
496
|
│ ├── basis_transcoder.js
|
|
494
497
|
│ └── basis_transcoder.wasm
|
|
495
|
-
└──
|
|
496
|
-
|
|
497
|
-
|
|
498
|
+
└── stowkit/ # Auto-copied by @stowkit/three-loader
|
|
499
|
+
└── draco/ # Draco decoder (for meshes) - included!
|
|
500
|
+
├── draco_decoder.js
|
|
501
|
+
├── draco_decoder.wasm
|
|
502
|
+
└── draco_wasm_wrapper.js
|
|
498
503
|
```
|
|
499
504
|
|
|
500
|
-
**
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
505
|
+
**Setup:**
|
|
506
|
+
|
|
507
|
+
The package automatically copies Draco decoder files to `public/stowkit/draco/` when you install `@stowkit/three-loader`.
|
|
508
|
+
|
|
509
|
+
You only need to manually add:
|
|
510
|
+
- `stowkit_reader.wasm` - Copy from `node_modules/@stowkit/reader/dist/`
|
|
511
|
+
- Basis transcoder - Download from [three.js examples](https://github.com/mrdoob/three.js/tree/dev/examples/jsm/libs/basis)
|
|
504
512
|
|
|
505
513
|
### Three.js Version
|
|
506
514
|
|