Skip to content

v3.0.0: WebGPU Support!

Compare
Choose a tag to compare
@0b5vr 0b5vr released this 01 Aug 08:48
· 189 commits to dev since this release

v2.1.3...v3.0.0
Milestone


@pixiv/three-vrm v3 supports WebGPURenderer by using MToonNodeMaterial, the MToon material based on the new NodeMaterial system.

To use @pixiv/three-vrm 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 { VRMLoaderPlugin } from '@pixiv/three-vrm';
import { MToonNodeMaterial } from '@pixiv/three-vrm/nodes';

// ...

// Register a VRMLoaderPlugin
loader.register((parser) => {

  // create a WebGPU compatible MToonMaterialLoaderPlugin
  const mtoonMaterialPlugin = new MToonMaterialLoaderPlugin(parser, {

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

  });

  return new VRMLoaderPlugin(parser, {

    // Specify the MToonMaterialLoaderPlugin to use in the VRMLoaderPlugin instance
    mtoonMaterialPlugin,

  });

});

See the example webgpu-dnd.html for the complete example.


🚨 BREAKING CHANGES 🚨

  • #1302: Remove downlevel-dts
    • If you are still using TypeScript 3.9 or earlier, you have to update your TypeScript.
  • #1384: gltf.userData.vrmMToonMaterials might have materials other than MToonMaterial (namely, MToonNodeMaterial)
    • This should not affect many users since the interface of MToonNodeMaterial is almost identical to MToonMaterial.
  • #1415: needThumbnailImage is now false by default
    • If you are using meta.thumbnailImage, you have to set plugin.metaPlugin.needThumbnailImage to true.

✨ New features

πŸ’‘ Behavior changes

  • #1415, #1426: needThumbnailImage is now false by default

πŸ“„ Docs

  • #1437: Improve README.md "How to Use" section

🧹 Chores

  • #1302: Remove downlevel-dts
  • #1411, #1413, #1416: Migrate build system to esbuild
  • #1428, #1445: Specify more appropriate Three.js versions in peerDependencies
    • If you're using npm, you no longer have to specify --legacy-peer-deps πŸ‘

πŸ“¦ Deps

  • #1406: Bump TypeScript to v5 + other related bumps
  • #1446: Bump Three.js to r167