import type { Binding, BindingsByGroup, Device } from '@luma.gl/core'; import type { ShaderModule } from '@luma.gl/shadertools'; import { DynamicTexture } from "../dynamic-texture/dynamic-texture.js"; import { ShaderInputs } from "../shader-inputs.js"; import { MaterialFactory } from "./material-factory.js"; type MaterialModuleProps = Partial>>; type MaterialBindings = Record; type MaterialPropsUpdate = Partial<{ [P in keyof TModuleProps]?: Partial; }>; /** Construction props for one typed {@link Material}. */ export type MaterialProps = { /** Optional application-provided identifier. */ id?: string; /** Factory that owns the material schema. */ factory?: MaterialFactory; /** Optional pre-created shader inputs for the material modules. */ shaderInputs?: ShaderInputs; /** Shader modules used when a factory is not supplied. */ modules?: ShaderModule[]; /** Initial material-owned resource bindings. */ bindings?: Partial; }; /** Structural overrides applied when cloning a {@link Material}. */ export type MaterialCloneProps = { /** Optional identifier for the cloned material. */ id?: string; /** Replacement material-owned resource bindings. */ bindings?: Partial; /** Additional uniform/module props applied to the clone. */ moduleProps?: MaterialPropsUpdate; /** Optional full replacement shader-input store. */ shaderInputs?: ShaderInputs; }; /** * Material owns bind group `3` resources and uniforms for one material instance. * * `setProps()` mutates uniform values in place. Structural resource changes are * expressed through `clone({...})`, which creates a new material identity. */ export declare class Material { /** Application-provided identifier. */ readonly id: string; /** Device that owns the material resources. */ readonly device: Device; /** Factory that defines the material schema. */ readonly factory: MaterialFactory; /** Shader inputs for the material-owned modules. */ readonly shaderInputs: ShaderInputs; /** Internal binding store including uniform buffers and resource bindings. */ readonly bindings: Record; private _uniformStore; private _bindGroupCacheToken; constructor(device: Device, props?: MaterialProps); /** Destroys managed uniform-buffer resources owned by this material. */ destroy(): void; /** Creates a new material variant with optional structural and uniform overrides. */ clone(props?: MaterialCloneProps): Material; /** Returns `true` if this material owns the supplied binding name. */ ownsBinding(bindingName: string): boolean; /** Returns `true` if this material owns the supplied shader module. */ ownsModule(moduleName: string): boolean; /** Updates material uniform/module props in place without changing material identity. */ setProps(props: MaterialPropsUpdate): void; /** Updates managed uniform buffers and shader-input-owned bindings. */ updateShaderInputs(): void; /** Returns the material-owned resource bindings without internal uniform buffers. */ getResourceBindings(): Partial; /** Returns the resolved bindings, including internal uniform buffers and ready textures. */ getBindings(): Partial<{ [K in keyof TBindings]: Binding; }> & Record; /** Packages resolved material bindings into logical bind group `3`. */ getBindingsByGroup(): BindingsByGroup; /** Returns the stable bind-group cache token for the requested bind group. */ getBindGroupCacheKey(group: number): object | null; /** Returns the latest update timestamp across material-owned resources. */ getBindingsUpdateTimestamp(): number; /** Replaces owned resource bindings and invalidates the material cache identity when needed. */ private _replaceOwnedBindings; private _setOwnedBindings; } export {}; //# sourceMappingURL=material.d.ts.map