@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
47 lines (46 loc) • 2.17 kB
TypeScript
import { TypedNode } from '../_Base';
import { Material } from 'three';
import { NodeContext } from '../../poly/NodeContext';
import { NodeParamsConfig } from '../utils/params/ParamsConfig';
import { FlagsControllerB } from '../utils/FlagsController';
import { BaseController, MaterialTexturesRecord, SetParamsTextureNodesRecord } from './utils/_BaseController';
/**
*
*
* TypedMatNode is the base class for all nodes that process materials. This inherits from [TypedNode](/docs/api/TypedNode).
*
*/
export declare abstract class TypedMatNode<M extends Material, K extends NodeParamsConfig> extends TypedNode<NodeContext.MAT, K> {
static context(): NodeContext;
initializeBaseNode(): void;
protected _cookWhenDirtyBound: () => Promise<void>;
protected _cookMainWithoutInputsWhenDirty(): Promise<void>;
abstract material(): Promise<M | undefined>;
setMaterial(material: M): void;
}
export declare abstract class PrimitiveMatNode<M extends Material, K extends NodeParamsConfig> extends TypedMatNode<M, K> {
protected _material: M | undefined;
abstract createMaterial(): M;
__materialSync__(): M;
material(): Promise<M>;
initializeBaseNode(): void;
private set_material_name;
setMaterial(material: M): void;
getTextures(material: M, record: MaterialTexturesRecord): void;
setParamsFromMaterial(material: M, record: SetParamsTextureNodesRecord): void;
protected controllersList: Array<BaseController>;
protected controllersPromises(material: M): Array<void | Promise<void>>;
initializeNode(): void;
}
export declare class UpdateMatNode<M extends Material, K extends NodeParamsConfig> extends TypedMatNode<M, K> {
readonly flags: FlagsControllerB;
protected _cookWhenDirtyBound: () => Promise<void>;
protected _cookMainWithoutInputsWhenDirty(): Promise<void>;
material(): Promise<M | undefined>;
initializeBaseNode(): void;
}
export type BaseMatNodeType = TypedMatNode<Material, any>;
export type BasePrimitiveMatNodeType = PrimitiveMatNode<Material, any>;
export declare class BaseMatNodeClass extends TypedMatNode<Material, any> {
material(): Promise<Material | undefined>;
}