Interface for shader-art plugins

Usage no npm install needed!

<script type="module">
  import shaderArtPluginBase from 'https://cdn.skypack.dev/@shader-art/plugin-base';


<shader-art> plugin interface

You can build your own plugins by implementing this interface:

export interface ShaderArtPlugin {
  name: string;
    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.