chore: 初始化glTF模型压缩工具包

添加了完整的项目配置、工具函数、纹理压缩与模型优化实现,以及文档说明
This commit is contained in:
2026-05-18 16:51:56 +08:00
commit 18eaaff65f
13 changed files with 4525 additions and 0 deletions

40
README.md Normal file
View File

@@ -0,0 +1,40 @@
# @g1sir8b/gltf-model-compressor
用于:
- 优化 `.gltf` / `.glb`
- 自动补全法线和切线
- 可选纹理压缩
- 输出为 `gltf + buffer.bin``glb`
## 构建
```bash
npm run build
```
## 使用
```ts
import optimizeModel from '@g1sir8b/gltf-model-compressor';
await optimizeModel(
'D:/input/model.glb',
'D:/output',
'medium',
true
);
```
也支持对象参数:
```ts
import { optimizeModelWithOptions } from '@g1sir8b/gltf-model-compressor';
await optimizeModelWithOptions({
input: 'D:/input/model.gltf',
output: 'D:/output',
compressTex: 'off',
toGLB: false
});
```