UNPKG

984 BTypeScriptView Raw
1/// <reference types="webgl2" />
2import { Shader } from "./shader";
3import { Texture } from "./texture";
4export declare enum RenderQueue {
5 Opaque = 0,
6 Blend = 1
7}
8export declare class Material {
9 name: string;
10 shader: Shader;
11 isDirty: boolean;
12 textures: Map<string, Texture>;
13 doubleSided: boolean;
14 queue: RenderQueue;
15 constructor(shader: Shader, name?: any, doubleSided?: boolean);
16 static clone(mat: Material): Material;
17 static useMaterial(mat: Material, ctx: WebGL2RenderingContext): void;
18 static setUniform(mat: Material, key: string, value: any): void;
19 static updateUniform(mat: Material, ctx: WebGL2RenderingContext): void;
20 static bindAllTextures(mat: Material, ctx: WebGL2RenderingContext, force?: boolean): void;
21 static unbindAllTextures(mat: Material, ctx: WebGL2RenderingContext): void;
22 static setTexture(mat: Material, name: string, tex: Texture): void;
23 static SHADER_PATH: string;
24}