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.
124 lines • 5.92 kB
TypeScript
import { Color, IUniform, LineBasicMaterial, LineBasicMaterialParameters, Material, WebGLProgramParametersWithUniforms, WebGLRenderer } from 'three';
import { UiObjectConfig } from 'uiconfig.js';
import { IMaterial, IMaterialEventMap, IMaterialParameters, IMaterialUserData } from '../IMaterial';
import { MaterialExtension } from '../../materials';
import { AnimateTime, SerializationMetaType } from '../../utils';
import { IObject3D } from '../IObject';
/**
* And extension of three.js LineBasicMaterial that can be assigned to lines, and support threepipe features, uiconfig, and serialization.
*
* @category Materials
*/
export declare class UnlitLineMaterial<TE extends IMaterialEventMap = IMaterialEventMap> extends LineBasicMaterial<TE & IMaterialEventMap> implements IMaterial<TE> {
['constructor']: typeof UnlitLineMaterial;
static readonly TypeSlug = "blmat";
static readonly TYPE = "UnlitLineMaterial";
static readonly TypeAlias: string[];
assetType: "material";
userData: IMaterialUserData;
readonly isUnlitLineMaterial = true;
readonly appliedMeshes: Set<IObject3D>;
readonly setDirty: (this: IMaterial, options?: import('../IMaterial').IMaterialSetDirtyOptions) => void;
dispose(): this;
clone(track?: boolean): this;
constructor({ customMaterialExtensions, ...parameters }?: LineBasicMaterialParameters & IMaterialParameters);
materialExtensions: MaterialExtension[];
extraUniformsToUpload: Record<string, IUniform>;
registerMaterialExtensions: (this: IMaterial, customMaterialExtensions: MaterialExtension[]) => void;
unregisterMaterialExtensions: (this: IMaterial, customMaterialExtensions: MaterialExtension[]) => void;
customProgramCacheKey(): string;
onBeforeCompile(shader: WebGLProgramParametersWithUniforms, renderer: WebGLRenderer): void;
/** @ignore */
onBeforeRender: (renderer: WebGLRenderer, scene: import('three').Scene, camera: import('three').Camera, geometry: import('three').BufferGeometry, object: import('three').Object3D, group: import('three').Group) => void;
/** @ignore */
onAfterRender: (renderer: WebGLRenderer, scene: import('three').Scene, camera: import('three').Camera, geometry: import('three').BufferGeometry, object: import('three').Object3D, group: import('three').Group) => void;
/**
* Sets the values of this material based on the values of the passed material or an object with material properties
* The input is expected to be a valid material or a deserialized material parameters object(including the deserialized userdata)
* @param parameters - material or material parameters object
* @param allowInvalidType - if true, the type of the oldMaterial is not checked. Objects without type are always allowed.
* @param clearCurrentUserData - if undefined, then depends on material.isMaterial. if true, the current userdata is cleared before setting the new values, because it can have data which won't be overwritten if not present in the new material.
* @param time - optional data to animate(lerp) from current value to the target value.
*/
setValues(parameters: Material | (LineBasicMaterialParameters & {
type?: string;
}), allowInvalidType?: boolean, clearCurrentUserData?: boolean | undefined, time?: AnimateTime): this;
copy(source: Material | any): this;
/**
* Serializes this material to JSON.
* @param meta - metadata for serialization
* @param _internal - Calls only super.toJSON, does internal three.js serialization and `@serialize` tags. Set it to true only if you know what you are doing. This is used in Serialization->serializer->material
*/
toJSON(meta?: SerializationMetaType, _internal?: boolean): any;
/**
* Deserializes the material from JSON.
* Textures should be loaded and in meta.textures before calling this method.
* todo - needs to be tested
* @param data
* @param meta
* @param _internal
*/
fromJSON(data: any, meta?: SerializationMetaType, _internal?: boolean): this | null;
uiConfig: UiObjectConfig;
static readonly MaterialProperties: {
color: Color;
map: null;
linewidth: number;
linecap: string;
linejoin: string;
fog: boolean;
name: string;
blending: 1;
side: 0;
vertexColors: boolean;
opacity: number;
transparent: boolean;
blendSrc: 204;
blendDst: 205;
blendEquation: 100;
blendSrcAlpha: null;
blendDstAlpha: null;
blendEquationAlpha: null;
blendColor: string;
blendAlpha: number;
depthFunc: 3;
depthTest: boolean;
depthWrite: boolean;
stencilWriteMask: number;
stencilFunc: 519;
stencilRef: number;
stencilFuncMask: number;
stencilFail: 7680;
stencilZFail: 7680;
stencilZPass: 7680;
stencilWrite: boolean;
clippingPlanes: null;
clipIntersection: boolean;
clipShadows: boolean;
shadowSide: null;
colorWrite: boolean;
precision: null;
polygonOffset: boolean;
polygonOffsetFactor: number;
polygonOffsetUnits: number;
dithering: boolean;
alphaToCoverage: boolean;
premultipliedAlpha: boolean;
forceSinglePass: boolean;
allowOverride: boolean;
visible: boolean;
toneMapped: boolean;
userData: {};
alphaTest: number;
alphaHash: boolean;
};
static readonly MapProperties: string[];
static readonly InterpolateProperties: string[];
}
/**
* @deprecated Use {@link UnlitLineMaterial} instead.
*/
export declare class LineBasicMaterial2 extends UnlitLineMaterial {
constructor(parameters?: LineBasicMaterialParameters);
}
//# sourceMappingURL=../../src/core/material/UnlitLineMaterial.d.ts.map