import type { State } from 'pixi.js'; import { Shader } from 'pixi.js'; import { Rectangle, Texture } from 'pixi.js'; import type { Plane } from '../../../math'; import { Matrix3 } from '../../../math'; import type { LightData } from '../../core'; import type { BaseMaterialConfig } from './BaseMaterialConfig'; export interface BaseMaterialOptions { /** Fast normals mean the shader will not need to calculate normal matrix. This is a win as long as scale stays uniform on the model */ fastNormals?: boolean; /** The base color of the material */ color?: number; /** The diffuse texture (this can come from a sprite sheet!) */ diffuseMap?: Texture; /** The normal map texture */ normalMap?: Texture; /** tha scale depth of the normal map */ normalScale?: number; /** The amount of light emission */ emissive?: number; /** The colour of light emission */ emissiveColor?: number; /** A texture that is used to add light emission */ emissiveMap?: Texture; /** Opacity of the material 0-1 */ alpha?: number; /** Set to true for vertex skinning animation! */ skinning?: boolean; /** The maximum number of bones to upload to the GPU. Default is StandardMaterial.MAX_BONES (20)*/ maxBones?: number; /** prefer to use a bone texture to store data (unlimited bones!), defaults to `StandardMaterial.PREFER_TEXTURE`(true) */ boneTexture?: boolean; /** Set to true for vertex skinning animation! */ morphTargets?: boolean; /** A texture to apply occlusion (after light calculations) */ occlusionMap?: Texture; /** A value that will make material 100% reflective if 1 and 0% reflective if 0 */ metallic?: number; /** A map that will make material 100% reflective if a pixel is 0xffffff and 0% reflective if pixel is 0x000000 */ metallicMap?: Texture; /** If true, transforms will be instanced * use this if you know what you are doing ?:)*/ instancing?: boolean; multiDraw?: boolean; /** The name of you shader (defaults to base-shader) */ name?: string; /** True if you want shadows to be applied to this material */ receiveShadows?: boolean; /** Add a clipping plane */ clippingPlane?: Plane; /** * use tangents for calculating normals if they are available * pro - slightly faster shader, but requires tangents to be generated if they are not in the model * con - if the tangents are not provided, some lighting may appear ia bit off! */ tangents?: boolean; /** use an alpha test for discarding pixels */ alphaTest?: number; /** * true to use the lights in the scene */ useLights?: boolean; /** * config to override any standard parts of the shader */ config?: Partial; /** * any uniforms to set on the shader.. */ uniforms?: BaseUniforms; /** * an optional pixi state to set when rendering with this material. * If none is provided then the entities state is used */ state?: State; } /** * the possible uniforms that this shader may added to the shader */ export interface BaseUniforms { [key: string]: any; uAlpha?: number; uClippingPlane?: Plane; uMetallicRoughness?: Float32Array; uNormalScale?: number; uNormalMap?: Texture; uNormalMatrix?: Matrix3; uEmissiveMap?: Texture; uEmissiveColor?: Float32Array; uDiffuseMap?: Texture; uMapFrame?: Rectangle; uDiffuseColor?: Float32Array; uAlphaTest?: number; uMorphTargetInfluence?: Float32Array; } export declare const standardShaderTemplate: { name: string; vertex: string; fragment: string; }; export declare class BaseMaterial extends Shader { static MAX_BONES: number; static FAST_NORMALS: boolean; /** * if true, then skinning bone data will be stored on textures rather than uniforms */ static PREFER_TEXTURE: boolean; static PREFER_TANGENTS: boolean; id: number; tangents: boolean; state?: State; readonly instancing: boolean; readonly multiDraw: boolean; readonly config: BaseMaterialConfig; private _hexColor; private _hexEmissiveColor; private _emissiveIntensity; private _built; constructor(options?: BaseMaterialOptions); build(lightData: LightData, fog: boolean, isWebGL2: boolean): void; get uniforms(): T; set diffuseMap(value: Texture); get diffuseMap(): Texture; set color(value: number); get color(): number; set emissiveColor(value: number); get emissiveColor(): number; set emissive(value: number); get emissive(): number; set metallic(value: number); get metallic(): number; set clippingPlane(value: Plane); get clippingPlane(): Plane; get morphTargets(): Float32Array; } //# sourceMappingURL=BaseMaterial.d.ts.map