@pixiv/three-vrm-materials-mtoon
MToon (toon material) module for @pixiv/three-vrm
GitHub Repository
Examples
Documentation
WebGPU Support
Starting from v3, we provide WebGPURenderer compatibility.
To use MToon with WebGPURenderer, specify the WebGPU-compatible MToonNodeMaterial
for the materialType
option of MToonMaterialLoaderPlugin
.
MToonNodeMaterial
only supports Three.js r167 or later.
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.
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
import { MToonMaterialLoaderPlugin } from '@pixiv/three-vrm-materials-mtoon';
import { MToonNodeMaterial } from '@pixiv/three-vrm-materials-mtoon/nodes';
const loader = new GLTFLoader();
loader.register((parser) => {
return new MToonMaterialLoaderPlugin(parser, {
materialType: MToonNodeMaterial,
});
});
See the example for the complete code: https://github.com/pixiv/three-vrm/blob/release/packages/three-vrm-materials-mtoon/examples/webgpu-loader-plugin.html