Class MToonMaterialLoaderPlugin

Implements

  • GLTFLoaderPlugin

Constructors

Properties

_addToMaterialSet: any
_extendMaterialParams: any
_generateOutline: any

Generate outline for the given mesh, if it needs.

Param: mesh

The target mesh

_getMToonExtension: any
_mToonMaterialSet: any

Loaded materials will be stored in this set. Will be transferred into gltf.userData.vrmMToonMaterials in afterRoot.

_parseRenderOrder: any
_removeUnlitExtensionIfMToonExists: any

Delete use of KHR_materials_unlit from its materials if the material is using MToon.

Since GLTFLoader have so many hardcoded procedure related to KHR_materials_unlit we have to delete the extension before we start to parse the glTF.

_setupPrimitive: any

This will do two processes that is required to render MToon properly.

  • Set render order
  • Generate outline

Param: mesh

A target GLTF primitive

Param: materialIndex

The material index of the primitive

Debug mode for the material. You can visualize several components for diagnosis using debug mode.

See: MToonMaterialDebugMode

parser: GLTFParser
renderOrderOffset: number

This value will be added to renderOrder of every meshes who have MaterialsMToon. The final renderOrder will be sum of this renderOrderOffset and renderQueueOffsetNumber for each materials. 0 by default.

v0CompatShade: boolean

There is a line of the shader called "comment out if you want to PBR absolutely" in VRM0.0 MToon. When this is true, the material enables the line to make it compatible with the legacy rendering of VRM. Usually not recommended to turn this on. false by default.

EXTENSION_NAME: string

Accessors

  • get name(): string
  • Returns string

Methods

  • Parameters

    • gltf: GLTF

    Returns Promise<void>

  • Returns Promise<void>

  • Parameters

    Returns null | Promise<any>

  • Parameters

    • materialIndex: number

    Returns null | typeof Material

  • Parameters

    • meshIndex: number

    Returns Promise<Group<Object3DEventMap> | Mesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap> | SkinnedMesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>>