1.0.1 • Published 8 years ago

gl-normal-material v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

gl-normal-material

NPM version experimental js-standard-style material

Normal material for 3d rendering.

As defined in gl-material, a material is a fragment shader and a set of styles with defaults. This material sets the RGB values of each vertex with the mesh's normal vector, which looks really cool and can also be useful for debugging.

live demo


STYLE PARAMETERS

saturation : float color saturation, 0 is white, 1 is full color, default 0.75

absolute : bool whether or not to take the absolute value, default true

image

install

npm install gl-normal-material

usage

Use with gl-material to generate a compiled shader, given a gl context

var normal = require('gl-normal-material')
var material = require('gl-material')(gl, normal)

Or just get the fragment shader for use elsewhere

var fragment = require('gl-normal-material').fragment