Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@shader-art/plugin-base

shader-art77MIT0.3.0TypeScript support: included

Interface for shader-art plugins

webgl, glsl, creative-coding

readme

<shader-art> plugin interface

You can build your own plugins by implementing this interface:

export interface ShaderArtPlugin {
  name: string;
  setup(
    hostElement: HTMLElement,
    gl: WebGLRenderingContext | WebGL2RenderingContext,
    program: WebGLProgram,
    canvas: HTMLCanvasElement
  ): void | Promise<void>;
  dispose(): void;
}

If the setup method returns a promise, the shader-art component will wait until the promise resolves.