@shader-art/plugin-pointer-interactions

Pointer interactions for shader-art

Usage no npm install needed!

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

README

<shader-art> PointerInteractionsPlugin

Installation

Install via NPM:

npm i shader-art @shader-art/plugin-pointer-interactions

Or use directly via skypack:

import { PointerInteractionsPlugin } from 'https://cdn.skypack.dev/@shader-art/plugin-pointer-interactions';

Usage

ShaderArt.register([() => new PointerInteractionsPlugin()]);

Inside your glsl shader code (which is placed inside a <script type="vert|frag"> tag), you can access one pointer (currently this is single-touch) via uniform variables:

uniform vec2 pointerStart;
uniform vec2 pointer;
uniform int dragging;