/** * Fullscreen-triangle vertex shader. Draws a single triangle covering the * viewport; `gl_VertexID ∈ {0,1,2}` derives clip-space positions without * any attribute buffers. Used by both transitions and effects for their * fragment-only passes. */ export declare const FULLSCREEN_VERTEX_SHADER = "#version 300 es\nout vec2 vUv;\nvoid main() {\n vec2 pos = vec2(float((gl_VertexID << 1) & 2), float(gl_VertexID & 2));\n vUv = pos;\n gl_Position = vec4(pos * 2.0 - 1.0, 0.0, 1.0);\n}\n"; /** * Compile a single GLSL shader stage. Throws an `Error` with the GL info * log appended (and the source in the error message) when compilation * fails — much more useful than the silent failure mode you get from * raw WebGL. * * @param gl A WebGL2 context. * @param type `gl.VERTEX_SHADER` or `gl.FRAGMENT_SHADER`. * @param source GLSL source code. * @throws Error if `gl.createShader` returns null or compilation fails. */ export declare function compileShader(gl: WebGL2RenderingContext, type: number, source: string): WebGLShader; /** * Link a vertex + fragment pair into a `WebGLProgram`. Caller still owns * the input shaders — `buildProgram()` deletes them for you, this lower- * level call does not. * * @throws Error if `gl.createProgram` returns null or linking fails. */ export declare function linkProgram(gl: WebGL2RenderingContext, vs: WebGLShader, fs: WebGLShader): WebGLProgram; /** * One-shot: compile a fragment + vertex shader, link them, delete the * intermediate shader objects, return the linked program. The vertex * shader defaults to `FULLSCREEN_VERTEX_SHADER`, which is what you want * for filter / transition passes that draw a single screen-covering * triangle. * * @throws Error if compilation or linking fails (see `compileShader` / * `linkProgram` for details). */ export declare function buildProgram(gl: WebGL2RenderingContext, fragmentSource: string, vertexSource?: string): WebGLProgram; //# sourceMappingURL=shader.d.ts.map