import { Asset } from "./asset"; import { mat4 } from "../types/mat4"; import { BufferStructure } from "./array-buffer"; import { DefaultVertexData } from "./mesh"; export declare type AttributeLocations = { [key in keyof VertexStruct]: number; }; export declare type ShaderAttributeNames = { [key in keyof VertexStruct]: string; }; export declare enum DepthTest { Disable = -1, Always, Never, Less, Equal, LEqual, Greater, NotEqual, GEqual } export declare enum Blending { Disable = -1, Zero, One, SrcColor, OneMinusSrcColor, DstColor, OneMinusDstColor, SrcAlpha, OneMinusSrcAlpha, DstAlpha, OneMinusDstAlpha } export declare enum Culling { Disable = -1, Back, Front, Both } export interface StateSettings { depth: DepthTest; blend: boolean; blendRGB: [Blending, Blending]; blendAlpha: [Blending, Blending]; zWrite: boolean; cull: Culling; } export interface ShaderPipelineStateSettinsOptional { depth?: DepthTest; blend?: [Blending, Blending] | boolean | Blending; blendRGB?: [Blending, Blending]; blendAlpha?: [Blending, Blending]; cull?: Culling; zWrite?: boolean; } interface ShaderSettingsOptional extends ShaderPipelineStateSettinsOptional { name?: string; vertexStructure?: VertexData; attributes?: Partial>; } export declare const DefaultShaderAttributeNames: ShaderAttributeNames; export declare class Shader extends Asset { private readonly vertexShaderSource; private readonly fragmentShaderSouce; private readonly options; private vertexStruct; private attributeNames; private initialized; private gl; private program; private vertexShader; private fragmentShader; pipelineStates: Readonly; private builtinUniformLocations; private _compiled; get compiled(): boolean; constructor(vertexShader: string, fragmentShader: string, options?: ShaderSettingsOptional, gl?: WebGL2RenderingContext); uniformLocation(name: string): WebGLUniformLocation | null; use(): void; setupBuiltinUniform(params: { matM: Readonly; matVP: Readonly; matMVP: Readonly; matM_IT: Readonly; matMV_IT: Readonly; }): void; clone(): Shader; private setPipelineStateInternal; _internal(): { options: ShaderSettingsOptional; }; private tryInit; private compile; } export {};