|
| 1 | +:warning: **THIS IS EXPERIMENTAL SOFTWARE** :warning: |
| 2 | + |
| 3 | +#  |
| 4 | +[API](doc/API.md) | |
| 5 | +[Example](#example) | |
| 6 | +[Installation](#installation) | |
| 7 | +[Changelog](doc/CHANGELOG.md) | |
| 8 | +[License](#license) (MIT) | |
| 9 | +[Questions?](#questions) |
| 10 | + |
| 11 | +normalmap.js is a library for creating simple interactive lighting effects. |
| 12 | + |
| 13 | +- Built on top of WebGL |
| 14 | +- Simple to use |
| 15 | +- Small (~7kb gzipped) |
| 16 | +- Fast enough to run on modern smartphones |
| 17 | +- There is a tiny jQuery plugin for simple usage |
| 18 | +- Covered by [automated end-to-end tests](https://29a.ch/sandbox/2016/normalmap.js/tests/) |
| 19 | + |
| 20 | +# Demos |
| 21 | +[](https://29a.ch/sandbox/2016/normalmap.js/) |
| 22 | + |
| 23 | +Did you find a cool use for normalmap.js? [Let me know!](https://29a.ch/about) |
| 24 | + |
| 25 | +# Example |
| 26 | +```javascript |
| 27 | +var lights = normalMap({ |
| 28 | + canvas: canvas, |
| 29 | + normalMap: normalMap, |
| 30 | + baseColor: [0.5, 0.4, 0.5] |
| 31 | +}); |
| 32 | + |
| 33 | +lights.clear(); |
| 34 | + |
| 35 | +var position = normalMap.vec3(0.5, 0.5, 1.0); // dead center |
| 36 | +var color = normalMap.vec3(1.0, 1.0, 1.0); // bright white |
| 37 | +lights.addPointLight(position, color); |
| 38 | +``` |
| 39 | + |
| 40 | +# Installation |
| 41 | +With NPM: |
| 42 | +``` |
| 43 | +$ npm install normalmap |
| 44 | +``` |
| 45 | + |
| 46 | +```javascript |
| 47 | +var normalmap = require('normalmap'); |
| 48 | +``` |
| 49 | + |
| 50 | +With Bower: |
| 51 | +```$ bower install normalmap``` |
| 52 | + |
| 53 | +Or just download the latest zip file form the [releases page](https://github.com/jwagner/normalmap.js/releases). |
| 54 | + |
| 55 | +Note that normalmap.js won't work with file:// urls. You will need to serve |
| 56 | +images from a webserver. See Richard Daveys [phaser introduction](http://phaser.io/tutorials/getting-started) for an explanations for this. |
| 57 | + |
| 58 | +# Browser Support |
| 59 | + |
| 60 | +Normalmap.js should work in all browsers that [supports WebGL](http://caniuse.com/#feat=webgl). |
| 61 | + |
| 62 | +# API Documentation |
| 63 | + |
| 64 | +[doc/API.md](doc/API.md) |
| 65 | + |
| 66 | +# Changelog |
| 67 | +[doc/CHANGELOG.md](doc/CHANGELOG.md) |
| 68 | + |
| 69 | +# Creating normal maps |
| 70 | +[NormalMap-Online](http://cpetry.github.io/NormalMap-Online/) |
| 71 | + |
| 72 | +# Questions? |
| 73 | +Create a github issue or tweet to @29a_ch and please be a bit patient. :) |
| 74 | + |
| 75 | +# License |
| 76 | +Copyright © 2016 Jonas Wagner. |
| 77 | + |
| 78 | +The **source code** of this project licensed under the [MIT License](LICENSE) (enclosed). |
| 79 | + |
| 80 | +The images and textures used for demonstration purposes are **not** licensed under the MIT License and belong to their respective owners. |
0 commit comments