import { ContextGLCompareMode, ImageBase } from '@awayjs/stage'; import { AmbientBasicMethod } from './methods/AmbientBasicMethod'; import { DiffuseBasicMethod } from './methods/DiffuseBasicMethod'; import { DiffuseCompositeMethod } from './methods/DiffuseCompositeMethod'; import { MethodBase } from './methods/MethodBase'; import { NormalBasicMethod } from './methods/NormalBasicMethod'; import { ShadowMethodBase } from './methods/ShadowMethodBase'; import { SpecularBasicMethod } from './methods/SpecularBasicMethod'; import { SpecularCompositeMethod } from './methods/SpecularCompositeMethod'; import { LightPickerBase } from './lightpickers/LightPickerBase'; import { MaterialBase } from './MaterialBase'; /** * MethodMaterial forms an abstract base class for the default shaded materials provided by Stage, * using material methods to define their appearance. */ export declare class MethodMaterial extends MaterialBase { static assetType: string; private _effectMethods; private _mode; private _enableLightFallOff; private _specularLightSources; private _diffuseLightSources; private _ambientMethod; private _shadowMethod; private _diffuseMethod; private _normalMethod; private _specularMethod; _pLightPicker: LightPickerBase; private _depthCompareMode; private _onLightChangeDelegate; /** * */ get assetType(): string; /** * Creates a new MethodMaterial object. * * @param texture The texture used for the material's albedo color. * @param smooth Indicates whether the texture should be filtered when sampled. Defaults to true. * @param repeat Indicates whether the texture should be tiled when sampled. Defaults to false. * @param mipmap Indicates whether or not any used textures should use mipmapping. Defaults to false. */ constructor(image?: ImageBase, alpha?: number); constructor(color?: number, alpha?: number); /** * The light picker used by the material to provide lights to the material if it supports lighting. * * @see LightPickerBase * @see StaticLightPicker */ get lightPicker(): LightPickerBase; set lightPicker(value: LightPickerBase); /** * Whether or not to use fallOff and radius properties for lights. This can be used to improve performance and * compatibility for constrained mode. */ get enableLightFallOff(): boolean; set enableLightFallOff(value: boolean); /** * Define which light source types to use for diffuse reflections. This allows choosing between regular lights * and/or light probes for diffuse reflections. * * @see away3d.materials.LightSources */ get diffuseLightSources(): number; set diffuseLightSources(value: number); /** * Define which light source types to use for specular reflections. This allows choosing between regular lights * and/or light probes for specular reflections. * * @see away3d.materials.LightSources */ get specularLightSources(): number; set specularLightSources(value: number); get mode(): string; set mode(value: string); /** * The depth compare mode used to render the renderables using this material. * * @see away.stagegl.ContextGLCompareMode */ get depthCompareMode(): ContextGLCompareMode; set depthCompareMode(value: ContextGLCompareMode); /** * The method that provides the ambient lighting contribution. Defaults to AmbientBasicMethod. */ get ambientMethod(): AmbientBasicMethod; set ambientMethod(value: AmbientBasicMethod); /** * The method used to render shadows cast on this surface, or null if no shadows are to be rendered. Defaults to null. */ get shadowMethod(): ShadowMethodBase; set shadowMethod(value: ShadowMethodBase); /** * The method that provides the diffuse lighting contribution. Defaults to DiffuseBasicMethod. */ get diffuseMethod(): DiffuseBasicMethod | DiffuseCompositeMethod; set diffuseMethod(value: DiffuseBasicMethod | DiffuseCompositeMethod); /** * The method that provides the specular lighting contribution. Defaults to SpecularBasicMethod. */ get specularMethod(): SpecularBasicMethod | SpecularCompositeMethod; set specularMethod(value: SpecularBasicMethod | SpecularCompositeMethod); /** * The method used to generate the per-pixel normals. Defaults to NormalBasicMethod. */ get normalMethod(): NormalBasicMethod; set normalMethod(value: NormalBasicMethod); get numEffectMethods(): number; /** * Appends an "effect" shading method to the shader. Effect methods are those that do not influence the lighting * but modulate the shaded colour, used for fog, outlines, etc. The method will be applied to the result of the * methods added prior. */ addEffectMethod(method: MethodBase): void; /** * Returns the method added at the given index. * @param index The index of the method to retrieve. * @return The method at the given index. */ getEffectMethodAt(index: number): MethodBase; /** * Adds an effect method at the specified index amongst the methods already added to the material. Effect * methods are those that do not influence the lighting but modulate the shaded colour, used for fog, outlines, * etc. The method will be applied to the result of the methods with a lower index. */ addEffectMethodAt(method: MethodBase, index: number): void; /** * Removes an effect method from the material. * @param method The method to be removed. */ removeEffectMethod(method: MethodBase): void; /** * Called when the light picker's configuration changed. */ private onLightsChange; } import { _Render_MaterialBase, _Render_ElementsBase } from '@awayjs/renderer'; /** * CompiledPass forms an abstract base class for the default compiled pass materials provided by Away3D, * using material methods to define their appearance. */ export declare class _Render_MethodMaterial extends _Render_MaterialBase { private _pass; private _casterLightPass; private _nonCasterLightPasses; /** * The maximum total number of lights provided by the light picker. */ private get numLights(); /** * The amount of lights that don't cast shadows. */ private get numNonCasters(); get lightPicker(): LightPickerBase; /** * Whether or not to use fallOff and radius properties for lights. This can be used to improve performance and * compatibility for constrained mode. */ get enableLightFallOff(): boolean; /** * Define which light source types to use for diffuse reflections. This allows choosing between regular lights * and/or light probes for diffuse reflections. * * @see away3d.materials.LightSources */ get diffuseLightSources(): number; /** * Define which light source types to use for specular reflections. This allows choosing between regular lights * and/or light probes for specular reflections. * * @see away3d.materials.LightSources */ get specularLightSources(): number; /** * Creates a new CompiledPass object. * * @param material The material to which this pass belongs. */ init(material: MethodMaterial, renderElements: _Render_ElementsBase): void; /** * @inheritDoc */ _pUpdateRender(): void; /** * Initializes all the passes and their dependent passes. */ private initPasses; /** * Sets up the various blending modes for all screen passes, based on whether or not there are previous passes. */ private setBlendAndCompareModes; private initCasterLightPass; private removeCasterLightPass; private initNonCasterLightPasses; private removeNonCasterLightPasses; private removeEffectPass; private initEffectPass; /** * @inheritDoc */ onClear(): void; } //# sourceMappingURL=MethodMaterial.d.ts.map