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.
65 lines • 2.79 kB
TypeScript
import { Vector2, Vector2Tuple, Vector3, Vector3Tuple, Vector4, Vector4Tuple } from 'three';
import { AViewerPluginSync, ThreeViewer } from '../../viewer';
import { IMaterial, IMaterialUserData } from '../../core';
import { MaterialExtension } from '../../materials';
import { GLTFWriter2 } from '../../assetmanager';
import { GLTFLoaderPlugin, GLTFParser } from 'three/examples/jsm/loaders/GLTFLoader.js';
/**
* NoiseBump Materials Extension
* Adds a material extension to PhysicalMaterial to add support for sparkle bump / noise bump by creating procedural bump map from noise to simulate sparkle flakes.
* It uses voronoise function from blender along with several additions to generate the noise for the generation.
* It also adds a UI to the material to edit the settings.
* It uses WEBGI_materials_noise_bump glTF extension to save the settings in glTF files.
* @category Plugins
*/
export declare class NoiseBumpMaterialPlugin extends AViewerPluginSync {
static readonly PluginType = "NoiseBumpMaterialPlugin";
enabled: boolean;
private _uniforms;
static AddNoiseBumpMaterial(material: IMaterial, params?: IMaterialUserData['_noiseBumpMat']): boolean;
readonly materialExtension: MaterialExtension;
setDirty: () => void;
constructor();
onAdded(v: ThreeViewer): void;
onRemove(v: ThreeViewer): void;
/**
* @deprecated - use {@link noiseBumpMaterialGLTFExtension}
*/
static readonly NOISE_BUMP_MATERIAL_GLTF_EXTENSION = "WEBGI_materials_noise_bump";
}
declare module '../../core/IMaterial' {
interface IMaterialUserData {
_noiseBumpMat?: {
hasBump?: boolean;
bumpNoiseParams?: Vector2Tuple | Vector2;
bumpScale?: number;
flakeScale?: number;
flakeClamp?: number;
flakeRadius?: number;
useColorFlakes?: boolean;
flakeParams?: Vector4Tuple | Vector4;
flakeFallOffParams?: Vector3Tuple | Vector3;
};
}
}
/**
* FragmentClipping Materials Extension
*
* Specification: https://threepipe.org/docs/gltf-extensions/WEBGI_materials_fragment_clipping_extension.html (todo - fix link)
*/
declare class GLTFMaterialsNoiseBumpMaterialImport implements GLTFLoaderPlugin {
name: string;
parser: GLTFParser;
constructor(parser: GLTFParser);
extendMaterialParams(materialIndex: number, materialParams: any): Promise<void>;
}
export declare const noiseBumpMaterialGLTFExtension: {
name: string;
import: (p: GLTFParser) => GLTFMaterialsNoiseBumpMaterialImport;
export: (w: GLTFWriter2) => {
writeMaterial: (material: any, materialDef: any) => void;
};
textures: undefined;
};
export {};
//# sourceMappingURL=../../src/plugins/material/NoiseBumpMaterialPlugin.d.ts.map