import { TypeToken } from '@gglib/utils'; import { Device } from './Device'; import { ShaderProgram, ShaderUniformValue } from './resources'; import { ShaderEffect, ShaderEffectOptions } from './ShaderEffect'; /** * @public */ export declare type MaterialParameters = { [key: string]: ShaderUniformValue; }; /** * Constructor options for {@link Material} * * @public */ export interface MaterialOptions { /** * The descriptive name of this effect */ name?: string; /** * The effect instance or constructor options for {@link ShaderEffect} */ effect?: E; /** * The uri of the effect file. * * @remarks * Can not be resolved inside the {@link Material} constructor. * Intended to be used by preprocessing tools e.g. content pipeline. */ effectUri?: string; /** * The technique name of the effect * * @remarks * Is not used inside the {@link Material} constructor. * Intended to be used by preprocessing tools e.g. content pipeline. */ technique?: string; /** * Effect parameters to be applied before rendering */ parameters: MaterialParameters; } /** * Defines a parameter set for a specific {@link ShaderEffect} * * @public * @remarks * A material holds a reference to a {@link ShaderEffect} and a * set of parameters that should be used together when rendering. * This allows a {@link ShaderEffect} instance to be reused across * multiple materials each with a different set of parameters. */ export declare class Material

{ /** * A symbol identifying the Array {@link Material} type. */ static readonly Array: TypeToken[]>; /** * A symbol identifying the {@link MaterialOptions} type. */ static readonly Options: TypeToken>>; /** * A symbol identifying the {@link MaterialOptions} type with effectUri set. */ static readonly OptionsUri: TypeToken>>; /** * A symbol identifying the {@link MaterialOptions} type with effectUri set. */ static readonly OptionsTechnique: TypeToken>>; /** * A symbol identifying the Array {@link MaterialOptions} type. */ static readonly OptionsArray: TypeToken>[]>; /** * A unique id */ uid: string; /** * The graphics device */ readonly device: Device; /** * A user defined name of the material */ name: string; /** * The effect to be used */ get effect(): ShaderEffect; /** * Effect parameters to be applied before rendering */ readonly parameters: P; protected $effect: ShaderEffect; constructor(device: Device, options: MaterialOptions); /** * Draws an object with the current effect */ draw(drawable: { draw: (p: ShaderProgram) => void; }): void; protected onConstructWithoutEffect(): void; } //# sourceMappingURL=Material.d.ts.map