UNPKG

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.

187 lines 8 kB
import { UiObjectConfig } from 'uiconfig.js'; import { BufferGeometry, Camera, Color, Euler, Group, IUniform, Material, MeshPhysicalMaterial, MeshPhysicalMaterialParameters, Object3D, Scene, Vector2, WebGLProgramParametersWithUniforms, WebGLRenderer } from 'three'; import { AnimateTime, SerializationMetaType } from '../../utils'; import { IMaterial, IMaterialEventMap, IMaterialParameters, IMaterialUserData } from '../IMaterial'; import { MaterialExtension } from '../../materials'; import { IObject3D } from '../IObject'; import { ITexture } from '../ITexture'; /** * And extension of three.js MeshPhysicalMaterial that can be assigned to objects, and support threepipe features, uiconfig, and serialization. * * @category Materials */ export declare class PhysicalMaterial<TE extends IMaterialEventMap = IMaterialEventMap> extends MeshPhysicalMaterial<TE & IMaterialEventMap> implements IMaterial<TE> { ['constructor']: typeof PhysicalMaterial; static readonly TypeSlug = "pmat"; static readonly TYPE = "PhysicalMaterial"; static readonly TypeAlias: string[]; assetType: "material"; userData: IMaterialUserData; readonly isPhysicalMaterial = true; readonly appliedMeshes: Set<IObject3D>; readonly setDirty: (this: IMaterial, options?: import('../IMaterial').IMaterialSetDirtyOptions) => void; dispose(): this; clone(track?: boolean): this; map: ITexture | null; alphaMap: ITexture | null; roughnessMap: ITexture | null; metalnessMap: ITexture | null; normalMap: ITexture | null; bumpMap: ITexture | null; displacementMap: ITexture | null; constructor({ customMaterialExtensions, ...parameters }?: MeshPhysicalMaterialParameters & 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; onBeforeRender(renderer: WebGLRenderer, scene: Scene, camera: Camera, geometry: BufferGeometry, object: Object3D, group: Group): void; /** * onAfterRender is called after the material is rendered * @ignore */ onAfterRender: (renderer: WebGLRenderer, scene: Scene, camera: Camera, geometry: BufferGeometry, object: Object3D, group: Group) => void; 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. * @param time - optional data to animate(lerp) from current value to the target value. */ setValues(parameters: Material | (MeshPhysicalMaterialParameters & { type?: string; }), allowInvalidType?: boolean, clearCurrentUserData?: boolean | undefined, time?: AnimateTime): void; 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; roughness: number; metalness: number; map: null; lightMap: null; lightMapIntensity: number; aoMap: null; aoMapIntensity: number; emissive: string; emissiveIntensity: number; emissiveMap: null; bumpMap: null; bumpScale: number; normalMap: null; normalMapType: 0; normalScale: Vector2; displacementMap: null; displacementScale: number; displacementBias: number; roughnessMap: null; metalnessMap: null; alphaMap: null; envMap: null; envMapRotation: Euler; envMapIntensity: number; wireframe: boolean; wireframeLinewidth: number; wireframeLinecap: string; wireframeLinejoin: string; flatShading: boolean; fog: boolean; clearcoat: number; clearcoatMap: null; clearcoatRoughness: number; clearcoatRoughnessMap: null; clearcoatNormalScale: Vector2; clearcoatNormalMap: null; dispersion: number; reflectivity: number; iridescence: number; iridescenceMap: null; iridescenceIOR: number; iridescenceThicknessRange: number[]; iridescenceThicknessMap: null; sheen: number; sheenColor: Color; sheenColorMap: null; sheenRoughness: number; sheenRoughnessMap: null; transmission: number; transmissionMap: null; thickness: number; thicknessMap: null; attenuationDistance: number; attenuationColor: Color; specularIntensity: number; specularIntensityMap: null; specularColor: Color; specularColorMap: null; anisotropy: number; anisotropyRotation: number; anisotropyMap: null; 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[]; } export declare class MeshStandardMaterial2 extends PhysicalMaterial { constructor(parameters?: MeshPhysicalMaterialParameters); } //# sourceMappingURL=../../src/core/material/PhysicalMaterial.d.ts.map