0.0.3 • Published 9 years ago

compile-shader v0.0.3

Weekly downloads
3
License
Beerware
Repository
github
Last release
9 years ago

Compile-Shader

Used to compile a shader in WebGL.

Usage

npm i compile-shader

var shaderCompiler = require('compile-shader');

var gl = document.createElement('canvas').getContext('webgl');
var type = gl.VERTEX_SHADER; // or gl.FRAGMENT_SHADER
var src = 'void main () { gl_Position = vec4(0.0, 0.0, 0.0, 1.0); }';
var shader = shaderCompiler(gl, type, src);

This module is meant to be incorporated via browserify.

Testing

npm t