UNPKG

1.35 kBTypeScriptView Raw
1import { Runner } from '@pixi/runner';
2import { Program } from './Program';
3import { UniformGroup } from './UniformGroup';
4import type { Dict } from '@pixi/utils';
5/**
6 * A helper class for shaders.
7 * @memberof PIXI
8 */
9export declare class Shader {
10 /** Program that the shader uses. */
11 program: Program;
12 uniformGroup: UniformGroup;
13 /**
14 * Used internally to bind uniform buffer objects.
15 * @ignore
16 */
17 uniformBindCount: number;
18 disposeRunner: Runner;
19 /**
20 * @param program - The program the shader will use.
21 * @param uniforms - Custom uniforms to use to augment the built-in ones.
22 */
23 constructor(program: Program, uniforms?: Dict<any>);
24 checkUniformExists(name: string, group: UniformGroup): boolean;
25 destroy(): void;
26 /**
27 * Shader uniform values, shortcut for `uniformGroup.uniforms`.
28 * @readonly
29 */
30 get uniforms(): Dict<any>;
31 /**
32 * A short hand function to create a shader based of a vertex and fragment shader.
33 * @param vertexSrc - The source of the vertex shader.
34 * @param fragmentSrc - The source of the fragment shader.
35 * @param uniforms - Custom uniforms to use to augment the built-in ones.
36 * @returns A shiny new PixiJS shader!
37 */
38 static from(vertexSrc?: string, fragmentSrc?: string, uniforms?: Dict<any>): Shader;
39}