import { AViewerPluginSync, GLTF, GLTFLoaderPlugin, GLTFParser, GLTFWriter2, IMaterial, IObject3D, ITexture, MaterialExtension, ThreeViewer } from 'threepipe'; /** * Anisotropy Plugin * Adds a material extension to PhysicalMaterial to support anisotropy maps. * Anisotropy is a directional material property that causes the material to reflect light differently depending on the direction of the surface. This is useful for materials like brushed metal, fabric, etc. * This is a separate implementation than the anisotropy property in three.js which satisfies `KHR_materials_anisotropy` glTF extension. It includes some additional properties like support for both rotation and directional maps(like Blender), noise, interfacing with the progressive plugin etc. * * It also adds a UI to the material to edit the settings. * It uses WEBGI_materials_anisotropy glTF extension to save the settings in glTF files. * @category Plugins */ export declare class AnisotropyPlugin extends AViewerPluginSync { static readonly PluginType = "AnisotropyPlugin"; enabled: boolean; private _defines; private _uniforms; enableAnisotropy(material: IMaterial, map?: ITexture, factor?: number, noise?: number, directionMode?: 'CONSTANT' | 'ROTATION' | 'DIRECTION'): boolean; readonly materialExtension: MaterialExtension; tryComputeTangents(m: IObject3D, mats: IMaterial[]): void; setDirty: () => void; constructor(); onAdded(v: ThreeViewer): void; onRemove(v: ThreeViewer): void; /** * @deprecated use {@link anisotropyGLTFExtension} */ static readonly ANISOTROPY_GLTF_EXTENSION = "WEBGI_materials_anisotropy"; /** * @deprecated - use {@link enableAnisotropy} instead * @param material */ makeAnisotropic(material: IMaterial): boolean; } declare module 'threepipe' { interface IMaterialUserData { /** * Is the material anisotropic */ _isAnisotropic?: boolean; /** * Anisotropy factor */ _anisotropyFactor?: number; /** * Anisotropy noise factor */ _anisotropyNoise?: number; /** * Anisotropy direction mode */ _anisotropyDirectionMode?: 'CONSTANT' | 'ROTATION' | 'DIRECTION'; /** * Anisotropy direction map, when mode is ROTATION or DIRECTION */ _anisotropyDirectionMap?: ITexture | null; /** * Direction when map is not used, when mode is CONSTANT */ _anisotropyDirection?: number; } } /** * Anisotropy Materials Extension * * Specification: https://webgi.xyz/docs/gltf-extensions/WEBGI_materials_anisotropy.html */ declare class GLTFMaterialsAnisotropyExtensionImport implements GLTFLoaderPlugin { name: string; parser: GLTFParser; constructor(parser: GLTFParser); extendMaterialParams(materialIndex: number, materialParams: any): Promise; afterRoot(result: GLTF): Promise | null; } export declare const anisotropyGLTFExtension: { name: string; import: (p: GLTFParser) => GLTFMaterialsAnisotropyExtensionImport; export: (w: GLTFWriter2) => { writeMaterial: (material: any, materialDef: any) => void; }; textures: { anisotropyDirection: string; }; }; export {}; //# sourceMappingURL=AnisotropyPlugin.d.ts.map