@pixiv/three-vrm
    Preparing search index...

    Module three-vrm-materials-mtoon

    @pixiv/three-vrm-materials-mtoon

    MToon (toon material) module for @pixiv/three-vrm

    GitHub Repository

    Examples

    API Reference

    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';

    // ... Setup renderer, camera, scene ...

    // Create a GLTFLoader
    const loader = new GLTFLoader();

    // Register a MToonMaterialLoaderPlugin with MToonNodeMaterial
    loader.register((parser) => {

    // create a WebGPU compatible MToonMaterialLoaderPlugin
    return new MToonMaterialLoaderPlugin(parser, {

    // set the material type to MToonNodeMaterial
    materialType: MToonNodeMaterial,

    });

    });

    // ... Load the VRM and perform the render loop ...

    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

    Classes

    MToonMaterial
    MToonMaterialLoaderPlugin

    Interfaces

    MToonMaterialLoaderPluginOptions
    MToonMaterialParameters

    Type Aliases

    MToonMaterialDebugMode
    MToonMaterialOutlineWidthMode

    Variables

    MToonMaterialDebugMode
    MToonMaterialOutlineWidthMode