@pixiv/three-vrm 2.1.2 → 3.0.0-beta.1
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 +36 -11
- package/lib/nodes/index.cjs +510 -0
- package/lib/nodes/index.min.cjs +10 -0
- package/lib/nodes/index.module.js +478 -0
- package/lib/nodes/index.module.min.js +10 -0
- package/lib/three-vrm.cjs +6175 -0
- package/lib/three-vrm.min.cjs +959 -0
- package/lib/three-vrm.module.js +6043 -6794
- package/lib/three-vrm.module.min.js +923 -19
- package/package.json +29 -25
- package/types/VRMUtils/removeUnnecessaryJoints.d.ts +11 -1
- package/types/nodes/index.d.ts +1 -0
- package/lib/three-vrm.js +0 -6974
- package/lib/three-vrm.min.js +0 -54
- package/ts3.4/types/VRM.d.ts +0 -39
- package/ts3.4/types/VRMLoaderPlugin.d.ts +0 -31
- package/ts3.4/types/VRMLoaderPluginOptions.d.ts +0 -32
- package/ts3.4/types/VRMParameters.d.ts +0 -12
- package/ts3.4/types/VRMUtils/deepDispose.d.ts +0 -2
- package/ts3.4/types/VRMUtils/index.d.ts +0 -11
- package/ts3.4/types/VRMUtils/removeUnnecessaryJoints.d.ts +0 -9
- package/ts3.4/types/VRMUtils/removeUnnecessaryVertices.d.ts +0 -12
- package/ts3.4/types/VRMUtils/rotateVRM0.d.ts +0 -7
- package/ts3.4/types/index.d.ts +0 -9
- package/ts3.4/types/utils/Matrix4InverseCache.d.ts +0 -28
- package/ts3.4/types/utils/mat4InvertCompat.d.ts +0 -8
- package/ts3.4/types/utils/math.d.ts +0 -40
- package/ts3.4/types/utils/quatInvertCompat.d.ts +0 -8
package/README.md
CHANGED
|
@@ -14,16 +14,6 @@ Use [VRM](https://vrm.dev/) on [three.js](https://threejs.org/)
|
|
|
14
14
|
|
|
15
15
|
[API Reference](https://pixiv.github.io/three-vrm/packages/three-vrm/docs)
|
|
16
16
|
|
|
17
|
-
## v1
|
|
18
|
-
|
|
19
|
-
**three-vrm v1 has been released!**
|
|
20
|
-
|
|
21
|
-
three-vrm v1 supports [VRM1.0](https://vrm.dev/vrm1/), which is a new version of VRM format (the previous version of VRM is also supported, don't worry!).
|
|
22
|
-
It also adopts the GLTFLoader plugin system which is a relatively new feature of GLTFLoader.
|
|
23
|
-
|
|
24
|
-
There are a lot of breaking changes!
|
|
25
|
-
See [the migration guide](https://github.com/pixiv/three-vrm/blob/dev/docs/migration-guide-1.0.md) for more info.
|
|
26
|
-
|
|
27
17
|
## How to Use
|
|
28
18
|
|
|
29
19
|
### from HTML
|
|
@@ -102,7 +92,7 @@ Code like this:
|
|
|
102
92
|
|
|
103
93
|
```javascript
|
|
104
94
|
import * as THREE from 'three';
|
|
105
|
-
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader';
|
|
95
|
+
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
106
96
|
import { VRMLoaderPlugin } from '@pixiv/three-vrm';
|
|
107
97
|
|
|
108
98
|
const scene = new THREE.Scene();
|
|
@@ -138,6 +128,41 @@ loader.load(
|
|
|
138
128
|
);
|
|
139
129
|
```
|
|
140
130
|
|
|
131
|
+
### Use with WebGPURenderer
|
|
132
|
+
|
|
133
|
+
Starting from v3, we provide [WebGPURenderer](https://github.com/mrdoob/three.js/blob/master/examples/jsm/renderers/webgpu/WebGPURenderer.js) compatibility.
|
|
134
|
+
To use three-vrm with WebGPURenderer, specify the WebGPU-compatible `MToonNodeMaterial` for the `materialType` option of `MToonMaterialLoaderPlugin`.
|
|
135
|
+
|
|
136
|
+
`MToonNodeMaterial` only supports Three.js r161 or later.
|
|
137
|
+
The NodeMaterial system of Three.js is still under development, so we may break compatibility with older versions of Three.js more frequently than other parts of three-vrm.
|
|
138
|
+
|
|
139
|
+
```js
|
|
140
|
+
import { VRMLoaderPlugin } from '@pixiv/three-vrm';
|
|
141
|
+
import { MToonNodeMaterial } from '@pixiv/three-vrm/nodes';
|
|
142
|
+
|
|
143
|
+
// ...
|
|
144
|
+
|
|
145
|
+
// Register a VRMLoaderPlugin
|
|
146
|
+
loader.register((parser) => {
|
|
147
|
+
|
|
148
|
+
// create a WebGPU compatible MToonMaterialLoaderPlugin
|
|
149
|
+
const mtoonMaterialPlugin = new MToonMaterialLoaderPlugin(parser, {
|
|
150
|
+
|
|
151
|
+
// set the material type to MToonNodeMaterial
|
|
152
|
+
materialType: MToonNodeMaterial,
|
|
153
|
+
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
return new VRMLoaderPlugin(parser, {
|
|
157
|
+
|
|
158
|
+
// Specify the MToonMaterialLoaderPlugin to use in the VRMLoaderPlugin instance
|
|
159
|
+
mtoonMaterialPlugin,
|
|
160
|
+
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
});
|
|
164
|
+
```
|
|
165
|
+
|
|
141
166
|
## Contributing
|
|
142
167
|
|
|
143
168
|
See: [CONTRIBUTING.md](CONTRIBUTING.md)
|