@figliolia/ripples
Version:
WebGL ripples based on the clever work of Pim Schreurs
22 lines (21 loc) • 763 B
TypeScript
import type { Program } from "./types";
export declare class Shaders {
dropProgram: Program;
updateProgram: Program;
renderProgram: Program;
GL: WebGLRenderingContext;
textureDelta: Float32Array;
constructor(GL: WebGLRenderingContext, resolution: number);
drop(position: Float32Array, radius: number, strength: number): void;
render(perturbance: number): void;
private compileDrop;
private compileUpdate;
private compileRender;
private createProgram;
private compileSource;
private static readonly VERTEX_SHADER;
private static readonly DROP_PROGRAM;
private static readonly UPDATE_PROGRAM;
private static readonly RENDER_BACKGROUND_PROGRAM;
private static readonly RENDER_RIPPLE_PROGRAM;
}