phenomenon-px
v1.0.0
Published
The fastest way to create pixel shaders.
Downloads
21
Readme
Phenomenon-px
Phenomenon-px is the fastest way to create pixel shaders. With its simple API and small size all focus is on your code!
Install
$ npm install --save phenomenon-px
Usage
// Import the library
import Phenomenon from 'phenomenon-px';
// Create the pixel shader
Phenomenon(fragment, uniforms, render, canvas);
API
Phenomenon(fragment, uniforms, render, canvas)
Creates a new instance of Phenomenon-px.
fragment
Type: string
The fragment shader that will be applied to all pixels on the canvas.
uniforms
Type: Object
An object with uniforms that can be used in the shader program.
render(uniforms)
Type: function
A function that is called on every frame that can be used to update uniforms.
canvas
Type: HTMLElement
Default: document.querySelector('canvas')
The canvas that will be used to render the shaders on.
Contribute
Are you excited about this library and have interesting ideas on how to improve it? Contribute! 🙌
$ npm install; npm run demo;
License
MIT © Colin van Eenige