@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 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)