@pixiv/three-vrm 3.0.0-beta.0 → 3.0.0-beta.2

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
@@ -34,8 +34,8 @@ Code like this:
34
34
  <script type="importmap">
35
35
  {
36
36
  "imports": {
37
- "three": "https://cdn.jsdelivr.net/npm/three@0.164.1/build/three.module.js",
38
- "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.164.1/examples/jsm/",
37
+ "three": "https://cdn.jsdelivr.net/npm/three@0.167.0/build/three.module.js",
38
+ "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.167.0/examples/jsm/",
39
39
  "@pixiv/three-vrm": "three-vrm.module.js"
40
40
  }
41
41
  }
@@ -92,7 +92,7 @@ Code like this:
92
92
 
93
93
  ```javascript
94
94
  import * as THREE from 'three';
95
- import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader';
95
+ import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
96
96
  import { VRMLoaderPlugin } from '@pixiv/three-vrm';
97
97
 
98
98
  const scene = new THREE.Scene();
@@ -131,25 +131,31 @@ loader.load(
131
131
  ### Use with WebGPURenderer
132
132
 
133
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 `MToonNodeMaterialLoaderPlugin` for the `mtoonMaterialPlugin` option of `VRMLoaderPlugin`.
134
+ To use three-vrm with WebGPURenderer, specify the WebGPU-compatible `MToonNodeMaterial` for the `materialType` option of `MToonMaterialLoaderPlugin`.
135
135
 
136
- `MToonNodeMaterial` only supports Three.js r161 or later.
136
+ `MToonNodeMaterial` only supports Three.js r167 or later.
137
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
138
 
139
139
  ```js
140
- import { VRMLoaderPlugin, MToonNodeMaterialLoaderPlugin } from '@pixiv/three-vrm';
140
+ import { VRMLoaderPlugin } from '@pixiv/three-vrm';
141
+ import { MToonNodeMaterial } from '@pixiv/three-vrm/nodes';
141
142
 
142
143
  // ...
143
144
 
144
145
  // Register a VRMLoaderPlugin
145
146
  loader.register((parser) => {
146
147
 
147
- // create a WebGPU compatible MToon loader plugin
148
- const mtoonMaterialPlugin = new MToonNodeMaterialLoaderPlugin(parser);
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
+ });
149
155
 
150
156
  return new VRMLoaderPlugin(parser, {
151
157
 
152
- // Specify the MToon loader plugin to use in the VRMLoaderPlugin instance
158
+ // Specify the MToonMaterialLoaderPlugin to use in the VRMLoaderPlugin instance
153
159
  mtoonMaterialPlugin,
154
160
 
155
161
  });