UNPKG

threepipe

Version:

A 3D viewer framework built on top of three.js in TypeScript with a focus on quality rendering, modularity and extensibility.

127 lines 5.79 kB
import { UiObjectConfig } from 'uiconfig.js'; import { Color, IUniform, Material, Shader, Vector2, WebGLRenderer } from 'three'; import { SerializationMetaType } from '../../utils'; import { IMaterial, IMaterialEvent, IMaterialEventTypes, IMaterialGenerator, IMaterialParameters, IMaterialTemplate } from '../IMaterial'; import { MaterialExtension } from '../../materials'; import { IObject3D } from '../IObject'; import { LineMaterial, type LineMaterialParameters } from 'three/examples/jsm/lines/LineMaterial.js'; export type LineMaterial2EventTypes = IMaterialEventTypes | ''; export declare class LineMaterial2 extends LineMaterial<IMaterialEvent, LineMaterial2EventTypes> implements IMaterial<IMaterialEvent, LineMaterial2EventTypes> { ['constructor']: typeof LineMaterial2; static readonly TypeSlug = "lmat"; static readonly TYPE = "LineMaterial2"; assetType: "material"; readonly isLineMaterial2 = true; readonly appliedMeshes: Set<IObject3D>; readonly setDirty: (this: IMaterial, options?: import("../IMaterial").IMaterialSetDirtyOptions) => void; dispose(): this; clone(): this; dispatchEvent(event: IMaterialEvent): void; generator?: IMaterialGenerator; constructor({ customMaterialExtensions, ...parameters }?: LineMaterialParameters & IMaterialParameters); materialExtensions: MaterialExtension[]; extraUniformsToUpload: Record<string, IUniform>; registerMaterialExtensions: (this: IMaterial, customMaterialExtensions: MaterialExtension[]) => void; unregisterMaterialExtensions: (this: IMaterial, customMaterialExtensions: MaterialExtension[]) => void; customProgramCacheKey(): string; onBeforeCompile(shader: Shader, renderer: WebGLRenderer): void; onAfterRender: (renderer: WebGLRenderer, scene: import("three").Scene, camera: import("three").Camera, geometry: import("three").BufferGeometry, object: import("three").Object3D) => void; name: string; color: Color; dashed: boolean; dashScale: number; dashSize: number; dashOffset: number; gapSize: number; linewidth: number; resolution: Vector2; alphaToCoverage: boolean; worldUnits: boolean; uiConfig: UiObjectConfig; /** * 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 wont be overwritten if not present in the new material. */ setValues(parameters: Material | (LineMaterialParameters & { type?: string; }), allowInvalidType?: boolean, clearCurrentUserData?: boolean | undefined): 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. * Note: some properties that are not serialized in Material.toJSON when they are default values (like side, alphaTest, blending, maps), they wont be reverted back if not present in JSON * If _internal = true, Textures should be loaded and in meta.textures before calling this method. * @param data * @param meta * @param _internal */ fromJSON(data: any, meta?: SerializationMetaType, _internal?: boolean): this | null; static readonly MaterialProperties: { color: Color; dashed: boolean; dashScale: number; dashSize: number; dashOffset: number; gapSize: number; linewidth: number; resolution: Vector2; alphaToCoverage: boolean; worldUnits: boolean; uniforms: {}; defines: {}; extensions: {}; clipping: boolean; fog: boolean; fragmentShader: string; vertexShader: string; name: string; blending: 1; side: 0; vertexColors: boolean; opacity: number; transparent: boolean; blendSrc: 204; blendDst: 205; blendEquation: 100; blendSrcAlpha: null; blendDstAlpha: null; blendEquationAlpha: null; 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; premultipliedAlpha: boolean; forceSinglePass: boolean; visible: boolean; toneMapped: boolean; userData: {}; alphaTest: number; }; static MaterialTemplate: IMaterialTemplate<LineMaterial2, Partial<typeof LineMaterial2.MaterialProperties>>; } //# sourceMappingURL=LineMaterial2.d.ts.map