Skip to content

shader-art/plugin-pointer-interactions

Repository files navigation

<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;

About

Plugin for pointer interactions

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published