/*! * Copyright (c) Microsoft Corporation. * Licensed under the MIT License. */ import { mat4 } from "gl-matrix"; import { Core } from "../../../main.js"; import { Main } from "../main.js"; export declare class Resources { static readonly glsl: { [key: string]: string; }; private _gl; currentProgram: WebGLProgram; currentShader: ShaderBase; ANGLE_instanced_arrays: ANGLE_instanced_arrays; OES_standard_derivatives: OES_standard_derivatives; EXT_frag_depth: EXT_frag_depth; WEBGL_lose_context: WEBGL_lose_context; OES_element_index_uint: OES_element_index_uint; private framebuffer; bindFramebuffer(framebuffer: WebGLFramebuffer): void; initializeContext(gl: WebGLRenderingContext): void; } export declare abstract class ShaderBase { protected _core: Core; protected _main: Main; protected _gl: WebGLRenderingContext; protected _program: WebGLProgram; protected _haveBuffersChanged: boolean; protected _haveTexturesChanged: boolean; protected _vertexBuffer: WebGLBuffer; protected _indexBuffer: WebGLBuffer; protected _mMatrixUniform: WebGLUniformLocation; protected _vMatrixUniform: WebGLUniformLocation; protected _pMatrixUniform: WebGLUniformLocation; protected _inverseMMatrixUniform: WebGLUniformLocation; protected _inverseVMatrixUniform: WebGLUniformLocation; protected _inversePMatrixUniform: WebGLUniformLocation; protected _isLoaded: boolean; protected _vsSource: string; protected _fsSource: string; protected _isInitialized: boolean; mMatrix: mat4; vMatrix: mat4; pMatrix: mat4; inverseVMatrix: mat4; inverseMMatrix: mat4; inversePMatrix: mat4; isPickShader: boolean; get isInitialized(): boolean; get vertexBuffer(): WebGLBuffer; set vertexBuffer(value: WebGLBuffer); get indexBuffer(): WebGLBuffer; set indexBuffer(value: WebGLBuffer); constructor(core: Core, main: Main); initializeContext(gl: WebGLRenderingContext): void; protected _createProgram(vs: WebGLShader, fs: WebGLShader): WebGLProgram; protected _compileShader(source: string, type: number): WebGLShader; protected _removeDirective(shaderSource: string, directive: string): string; prepare(): void; apply(): void; applyModel(): void; applyView(): void; enableProgram(program: WebGLProgram): void; updateBuffers(): void; updateTextures(): void; disableProgram(): void; protected _shaderFromFile(vsName: string, fsName: string, callback: { (vsSource: string, fsSource: string): void; }): void; protected _shaderFromUrl(vsName: string, fsName: string, callback: { (vsSource: string, fsSource: string): void; }): void; private _sourceFromUrl; private _includesFromFile; private _includesFromUrl; }