A simple example of modular shaders in ThreeJS with glslify. Uses glsl-halftone, glsl-hash-blur, and glsl-checker.
To run:
# clone repo
git clone https://github.com/mattdesl/three-glslify-example.git
cd three-glslify-example
# install deps
npm install
# start dev server
npm run start
Now open http://localhost:9966/ and start making changes to index.js, frag.glsl or vert.glsl to see changes reloaded in the browser.
To build the production release:
npm run build
This will create a bundle.js
for your static site.
See the scripts
field of package.json to integrate this into your own workflow. This is also specifying browserify transforms with a "browserify"
field (not recommended for modules, but useful for applications), and Babelify configuration with a .babelrc file.
MIT, see LICENSE.md for details.