threepipe
Version:
A modern 3D viewer framework built on top of three.js, written in TypeScript, designed to make creating high-quality, modular, and extensible 3D experiences on the web simple and enjoyable.
59 lines • 2.36 kB
TypeScript
import { Color } from 'three';
import { AViewerPluginSync, ThreeViewer } from '../../viewer';
import { IMaterialUserData, PhysicalMaterial } from '../../core';
import { MaterialExtension } from '../../materials';
import { GLTFWriter2 } from '../../assetmanager';
import { GLTFLoaderPlugin, GLTFParser } from 'three/examples/jsm/loaders/GLTFLoader.js';
/**
* Clearcoat Tint Plugin
* Adds a material extension to PhysicalMaterial which adds tint and thickness to the built-in clearcoat properties.
* It also adds a UI to the material to edit the settings.
* It uses WEBGI_materials_clearcoat_tint glTF extension to save the settings in glTF files.
* @category Plugins
*/
export declare class ClearcoatTintPlugin extends AViewerPluginSync {
static readonly PluginType = "ClearcoatTintPlugin";
enabled: boolean;
private _uniforms;
static AddClearcoatTint(material: PhysicalMaterial, params?: IMaterialUserData['_clearcoatTint']): IMaterialUserData['_clearcoatTint'] | null;
readonly materialExtension: MaterialExtension;
setDirty: () => void;
constructor();
onAdded(v: ThreeViewer): void;
onRemove(v: ThreeViewer): void;
/**
* @deprecated - use {@link clearCoatTintGLTFExtension}
*/
static readonly CLEARCOAT_TINT_GLTF_EXTENSION = "WEBGI_materials_clearcoat_tint";
}
declare module '../../core/IMaterial' {
interface IMaterialUserData {
_clearcoatTint?: {
enableTint?: boolean;
tintColor?: Color | number | string;
thickness?: number;
ior?: number;
};
}
}
/**
* ClearcoatTint Materials Extension
*
* Specification: https://threepipe.org/docs/gltf-extensions/WEBGI_materials_clearcoat_tint.html (todo - fix link)
*/
declare class GLTFMaterialsClearcoatTintExtensionImport implements GLTFLoaderPlugin {
name: string;
parser: GLTFParser;
constructor(parser: GLTFParser);
extendMaterialParams(materialIndex: number, materialParams: any): Promise<void>;
}
export declare const clearCoatTintGLTFExtension: {
name: string;
import: (p: GLTFParser) => GLTFMaterialsClearcoatTintExtensionImport;
export: (w: GLTFWriter2) => {
writeMaterial: (material: any, materialDef: any) => void;
};
textures: undefined;
};
export {};
//# sourceMappingURL=../../src/plugins/material/ClearcoatTintPlugin.d.ts.map