2.3.9 • Published 10 years ago

webgl-compile-shader v2.3.9

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

webgl-compile-shader

experimental

Compiles a WebGL shader program from the given vertex and fragment source. Throws an error on failure, providing clear logging with line numbers and the problematic shader (vertex vs. fragment).

The shaders are not detached/deleted after link, as this was causing issues with Chrome's WebGLInspector.

Usage

var compiler = require('webgl-compile-shader');
var info = compile({
	vertex: vertSource,
	fragment: fragSource,

	//optional args
	gl: gl, //WebGL context; if not specified a new one will be created
	verbose: true, //whether to emit console.warn messages when throwing errors
	attributeLocations: { ... key:index pairs ... },
});

//for dealing with the WebGL object
var program = info.program;
//for dealing with logging/warnings 
var log = info.log;
//vert and frag shader GL objects are also exported
console.log(info.vertex, info.fragment);

License

MIT, see LICENSE.md for details.

2.3.9

10 years ago

2.3.8

10 years ago

2.3.7

10 years ago

2.3.6

10 years ago

2.3.5

10 years ago

2.3.4

10 years ago

2.3.3

10 years ago

2.3.2

10 years ago

2.3.1

10 years ago

2.3.0

10 years ago

2.1.2

10 years ago

2.1.0

10 years ago

2.0.1

10 years ago

2.0.0

10 years ago

1.0.0

10 years ago