compile-shader

0.0.3 • Public • Published

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

Package Sidebar

Install

npm i compile-shader

Weekly Downloads

5

Version

0.0.3

License

Beerware

Last publish

Collaborators

  • nickdesaulniers