-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathBaseMaterial.d.ts
33 lines (33 loc) · 1.22 KB
/
BaseMaterial.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import GLConfig from 'nanogl-state/config';
import { GLContext } from 'nanogl/types';
import Program from 'nanogl/program';
import ChunkCollection from './ChunkCollection';
import MaterialPass, { MaterialPassId } from './MaterialPass';
import Node from 'nanogl-node';
import Camera from 'nanogl-camera';
import ProgramSource from './ProgramSource';
export declare class PassInstance {
readonly pass: MaterialPass;
readonly material: BaseMaterial;
readonly programSource: ProgramSource;
_program: Program | null;
constructor(material: BaseMaterial, pass: MaterialPass);
prepare(node: Node, camera: Camera): Program;
getProgram(): Program;
}
export default class BaseMaterial {
name: string;
mask: number;
glconfig: GLConfig;
inputs: ChunkCollection;
_passMap: Map<MaterialPassId, PassInstance>;
_passes: PassInstance[];
gl: GLContext;
constructor(gl: GLContext, name?: string);
addPass(pass: MaterialPass, id?: MaterialPassId): PassInstance;
removePass(id: MaterialPassId): void;
getPass(id: MaterialPassId): PassInstance | undefined;
hasPass(id: MaterialPassId): boolean;
getAllPasses(): PassInstance[];
getProgram(passId: MaterialPassId): Program | undefined;
}