• Stars
    star
    176
  • Rank 209,827 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 8 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

normalmap.js is a library for creating simple interactive lighting effects using normal maps.

⚠️ THIS IS EXPERIMENTAL SOFTWARE ⚠️

normalmap.js

API | Example | Installation | Changelog | License (MIT) | Questions?

normalmap.js is a library for creating simple interactive lighting effects.

  • Built on top of WebGL
  • Simple to use
  • Small (~7kb gzipped)
  • Fast enough to run on modern smartphones
  • There is a tiny jQuery plugin for simple usage
  • Covered by automated end-to-end tests

Demos

Golden Dragon

Did you find a cool use for normalmap.js? Let me know!

Example

var lights = normalmap({
    canvas: canvas,
    normalMap: normalMap,
    baseColor: [0.5, 0.4, 0.5]
});

lights.clear();

var position = normalMap.vec3(0.5, 0.5, 1.0); // dead center
var color = normalMap.vec3(1.0, 1.0, 1.0); // bright white
lights.addPointLight(position, color);

Installation

With NPM:

$ npm install normalmap
var normalmap = require('normalmap');

With Bower: $ bower install normalmap

Or just download the latest zip file form the releases page.

Note that normalmap.js won't work with file:// urls. You will need to serve images from a webserver. See Richard Daveys phaser introduction for an explanations for this.

Browser Support

Normalmap.js should work in all browsers that supports WebGL.

API Documentation

doc/API.md

Changelog

doc/CHANGELOG.md

Creating normal maps

NormalMap-Online

Questions?

Create a github issue or tweet to @29a_ch and please be a bit patient. :)

License

Copyright Β© 2016 Jonas Wagner.

The source code of this project licensed under the MIT License (enclosed).

The images and textures used for demonstration purposes are not licensed under the MIT License and belong to their respective owners.

More Repositories

1

smartcrop.js

Content aware image cropping
JavaScript
12,766
star
2

simplex-noise.js

A fast simplex noise implementation in Javascript / Typescript.
TypeScript
1,461
star
3

smartcrop-cli

Command line interface for the smartcrop library to provide content aware image cropping.
JavaScript
316
star
4

analog-film-emulator

A web based analog film emulator/photo editor.
JavaScript
236
star
5

fluidwebgl

WebGL Fluid Simulation
JavaScript
170
star
6

Neonflames

Neon flames is a crazy online HTML5 drawing tool.
JavaScript
142
star
7

dont-crop

A small, dependency free javascript library to fit a gradient to an image or extract it's primary colors.
TypeScript
122
star
8

smartcrop-sharp

Node module for using smartcrop via sharp/libvips
JavaScript
109
star
9

playitslowly

Play it slowly is a software to play back audio files at a different speed or pitch.
Python
98
star
10

box2d2-js

Automatic port of box2dAS 2.0 to javascript
ActionScript
87
star
11

voxelworlds

WebGL Voxel World Generation Demo
JavaScript
73
star
12

terrain

WebGL Terrain, ocean, fog
JavaScript
71
star
13

webglice

A webgl demo, showing of an iceberg featuring hdr rendering water reflections etc.
JavaScript
36
star
14

httpripper

HTTP Ripper is a tool to rip content out of the web.
Python
34
star
15

simplex-noise-demo-synthwave

Just a little demo for simplex-noise.js 4.0
TypeScript
27
star
16

smartcrop-gm

Node module for using smartcrop via image magick
JavaScript
27
star
17

space-break

Space Break is a html5 acrade 'ball and paddle' game implemented in coffee script
CoffeeScript
23
star
18

kinect-experiments

kinect usb rocket launcher controll
Python
18
star
19

Frontendconf-2011

Source code from a live coding talk on canvas particle systems I gave at frontendconf
JavaScript
13
star
20

jquery.textCloud

jQuery plugin to create text clouds
JavaScript
12
star
21

addresscloud

Visualization of 3.7 million swiss addresses using WebGL
JavaScript
12
star
22

fluidcanvas

Fluid simulation experiment using HTML5 Canvas
JavaScript
12
star
23

guitarTrainer

A web based guitar practice tool
JavaScript
10
star
24

lanshark

P2P Filesharing Tool
Python
8
star
25

musicviz-code

Coded during my talk @takeoffconf
JavaScript
6
star
26

littlemetronome

a little metronome written using python, gtk and gstreamer
Python
5
star
27

wildwebgl

Raymarching distance fields with wild results
JavaScript
5
star
28

webrtc-pong

A simple WebRTC multiplayer game example
JavaScript
4
star
29

kalman-ts

A simplistic library for implementing kalman filters using javascript/typescript.
TypeScript
4
star
30

box2dlite

Box2Dlite changed to run on linux
C++
3
star
31

jack-pipe

Pipes a wav file through jack into another wav file.
C
2
star
32

schwermetall

3D Printed Guitar Pedal Enclosure
2
star
33

bluenoise-rs

A bit of fun generating blue noise using void and cluster
Rust
2
star
34

swirly-lens-hoods

A 3D printable lens hood that creates swirly bokeh.
1
star
35

parcel-namer-29a

probably not of interest to anyone
TypeScript
1
star