diff --git a/README.md b/README.md new file mode 100644 index 0000000..c9d2cbb --- /dev/null +++ b/README.md @@ -0,0 +1,88 @@ + +
+ +
+ +**ShaderToyLite.js** is a full featured (but tiny) ShaderToy renderer, in ~400 lines of code. + +## Demo + +[ShaderToyLite-demo.html](https://chipweinberger.github.io/ShaderToyLite.js/ShaderToyLite-demo.html) + +^ This demo renders [Paint Streams](https://www.shadertoy.com/view/WtfyDj) by [Michael Moroz](https://michaelmoroz.github.io/Reintegration-Tracking/) + +## Features +- direcly load *almost* any ShaderToy shaders +- multipass shaders (i.e BufferA, BufferB, BufferC, BufferD) +- shader common code (i.e. 'Common' tab in ShaderToy) +- update shaders at any time +- WebGL 2.0 (only) + +**Not Supported:** +- VR, Sound, Keyboard +- pre-provided textures ('Wood', 'Rock Tiles', etc) + +## Usage + +``` +// initialize +var toy = new ShaderToyLite('myCanvas'); + +// set shaders +toy.setCommon(""); +toy.setBufferA({source: bufferA}); +toy.setImage({source: image, iChannel0: 'A'}); + +// optional callback +toy.setOnDraw((){ + console.log(toy.getTime()); +}) + +// start render loop +toy.play(); + +// pause render loop +toy.pause(); + +// currently playing? +tod.getIsPlaying(); + +// reset time to zero +toy.rewind(); +``` + +## Minimal Example + +``` + + + + +