import { ColorTransform, AssetBase } from '@awayjs/core'; import { ImageBase } from '@awayjs/stage'; import { IMaterial, Style, TextureBase } from '@awayjs/renderer'; /** * MaterialBase forms an abstract base class for any material. * A material consists of several passes, each of which constitutes at least one render call. Several passes could * be used for special effects (render lighting for many lights in several passes, render an outline in a separate * pass) or to provide additional render-to-texture passes (rendering diffuse light to texture for texture-space * subsurface scattering, or rendering a depth map for specialized self-shadowing). * * Away3D provides default materials trough SinglePassMaterialBase and TriangleMaterial, which use modular * methods to build the shader code. MaterialBase can be extended to build specific and high-performant custom * shaders, or entire new material frameworks. */ export declare class MaterialBase extends AssetBase implements IMaterial { private _textures; private _colorTransform; private _pUseColorTransform; private _alphaBlending; private _alpha; _pAlphaThreshold: number; _pAnimateUVs: boolean; private _onInvalidatePropertiesDelegate; private _onInvalidateImagesDelegate; private _style; /** * An object to contain any extra data. */ extra: Object; /** * A value that can be used by materials that only work with a given type of renderer. The renderer can test the * classification to choose which render path to use. For example, a deferred material could set this value so * that the deferred renderer knows not to take the forward rendering path. * * @private */ _iClassification: string; _iBaseScreenPassIndex: number; private _bothSides; _pBlendMode: string; private _imageRect; private _curves; private _onTextureInvalidateDelegate; /** * Creates a new MaterialBase object. */ constructor(image?: ImageBase, alpha?: number); constructor(color?: number, alpha?: number); /** * The alpha of the surface. */ get alpha(): number; set alpha(value: number); /** * The ColorTransform object to transform the colour of the material with. Defaults to null. */ get colorTransform(): ColorTransform; set colorTransform(value: ColorTransform); /** * Indicates whether or not the material has transparency. If binary transparency is sufficient, for * example when using textures of foliage, consider using alphaThreshold instead. */ get alphaBlending(): boolean; set alphaBlending(value: boolean); /** * Indicates whether material should use curves. Defaults to false. */ get curves(): boolean; set curves(value: boolean); /** * Indicates whether or not any used textures should use an atlas. Defaults to false. */ get imageRect(): boolean; set imageRect(value: boolean); /** * The style used to render the current TriangleGraphic. If set to null, its parent Sprite's style will be used instead. */ get style(): Style; set style(value: Style); /** * Specifies whether or not the UV coordinates should be animated using a transformation matrix. */ get animateUVs(): boolean; set animateUVs(value: boolean); /** * Specifies whether or not the UV coordinates should be animated using a transformation matrix. */ get useColorTransform(): boolean; set useColorTransform(value: boolean); /** * Defines whether or not the material should cull triangles facing away from the camera. */ get bothSides(): boolean; set bothSides(value: boolean); /** * The blend mode to use when drawing this renderable. The following blend modes are supported: *