import type { IAnimatable } from "@babylonjs/core/Animations/animatable.interface"; import type { Engine } from "@babylonjs/core/Engines/engine"; import { MaterialDefines } from "@babylonjs/core/Materials/materialDefines"; import { MaterialPluginBase } from "@babylonjs/core/Materials/materialPluginBase"; import type { StandardMaterial } from "@babylonjs/core/Materials/standardMaterial"; import type { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture"; import type { Texture } from "@babylonjs/core/Materials/Textures/texture"; import type { UniformBuffer } from "@babylonjs/core/Materials/uniformBuffer"; import { Color4 } from "@babylonjs/core/Maths/math.color"; import type { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh"; import type { Mesh } from "@babylonjs/core/Meshes/mesh"; import type { SubMesh } from "@babylonjs/core/Meshes/subMesh"; import type { Scene } from "@babylonjs/core/scene"; import type { Nullable } from "@babylonjs/core/types"; /** * for convert MMD material to Babylon material * * use StandardMaterial as base class * * propertiy mapping: * * - diffuse[0..2]: diffuseColor * - specular: specularColor * - ambient: ambientColor * - diffuse[3](opaque): alpha * - shininess(reflect): specularPower * - isDoubleSided: backFaceCulling * - enabledToonEdge: (custom implementation) * - edgeColor: (custom implementation) * - edgeSize: (custom implementation) * - texture: diffuseTexture * - sphereTexture: (custom implementation) * - toonTexture: (custom implementation) * * using options: * * useAlphaFromDiffuseTexture * * additinal implementation: * * spherical deformation */ export declare class MmdPluginMererialDefines extends MaterialDefines { SPHERE_TEXTURE: boolean; SPHERE_TEXTURE_BLEND_MODE_MULTIPLY: boolean; SPHERE_TEXTURE_BLEND_MODE_ADD: boolean; TOON_TEXTURE: boolean; IGNORE_DIFFUSE_WHEN_TOON_TEXTURE_DISABLED: boolean; TEXTURE_COLOR: boolean; SPHERE_TEXTURE_COLOR: boolean; TOON_TEXTURE_COLOR: boolean; SDEF: boolean; } export declare enum MmdPluginMaterialSphereTextureBlendMode { Multiply = 1, Add = 2 } export declare class MmdPluginMaterial extends MaterialPluginBase { private _sphereTexture; private _sphereTextureBlendMode; private _toonTexture; private _ignoreDiffuseWhenToonTextureIsNull; textureColor: Color4; sphereTextureColor: Color4; toonTextureColor: Color4; private _useTextureColor; private _useSphereTextureColor; private _useToonTextureColor; private _isEnabled; get isEnabled(): boolean; set isEnabled(value: boolean); get sphereTexture(): Nullable; set sphereTexture(value: Nullable); get sphereTextureBlendMode(): MmdPluginMaterialSphereTextureBlendMode; set sphereTextureBlendMode(value: MmdPluginMaterialSphereTextureBlendMode); get toonTexture(): Nullable; set toonTexture(value: Nullable); get ignoreDiffuseWhenToonTextureIsNull(): boolean; set ignoreDiffuseWhenToonTextureIsNull(value: boolean); get useTextureColor(): boolean; set useTextureColor(value: boolean); get useSphereTextureColor(): boolean; set useSphereTextureColor(value: boolean); get useToonTextureColor(): boolean; set useToonTextureColor(value: boolean); private readonly _internalMarkAllSubMeshesAsTexturesDirty; markAllSubMeshesAsTexturesDirty(): void; constructor(material: StandardMaterial, addtoPluginList?: boolean); isReadyForSubMesh(defines: MaterialDefines, scene: Scene): boolean; bindForSubMesh(uniformBuffer: UniformBuffer, scene: Scene, _engine: Engine, subMesh: SubMesh): void; dispose(forceDisposeTextures?: boolean | undefined): void; getCustomCode(shaderType: string): Nullable<{ [pointName: string]: string; }>; prepareDefines(defines: MmdPluginMererialDefines, scene: Scene, mesh: Mesh): void; hasTexture(texture: BaseTexture): boolean; getActiveTextures(activeTextures: BaseTexture[]): void; getAnimatables(animatables: IAnimatable[]): void; getSamplers(samplers: string[]): void; getAttributes(attributes: string[], _scene: Scene, mesh: AbstractMesh): void; getUniforms(): { ubo: { name: string; size: number; type: string; }[]; fragment: string; }; getClassName(): string; private _escapeRegExp; }