# webgl-compile-shader

> compiles a WebGL shader

Latest version **2.3.9** (published 2014-07-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install webgl-compile-shader
pnpm add webgl-compile-shader
yarn add webgl-compile-shader
bun add webgl-compile-shader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.3.9 |
| Published | 2014-07-01 |
| First published | 2014-06-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Matt DesLauriers |
| Maintainers | mattdesl |
| Keywords | webgl, glsl, glsles, glslify, compile, shader, program, opengl, link |

## Links

- npm: https://www.npmjs.com/package/webgl-compile-shader
- Repository: https://github.com/mattdesl/webgl-compile-shader
- Issues: https://github.com/mattdesl/webgl-compile-shader/issues
- npm.io page: https://npm.io/package/webgl-compile-shader

## Dependencies (1)

- [webgl-context](https://npm.io/package/webgl-context.md) ~1.2.1

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 2.3.9 (latest) — 2014-07-01
- 2.3.8 — 2014-07-01
- 2.3.7 — 2014-06-16
- 2.3.6 — 2014-06-16
- 2.3.5 — 2014-06-13
- 2.3.4 — 2014-06-13
- 2.3.3 — 2014-06-13
- 2.3.2 — 2014-06-12
- 2.3.1 — 2014-06-12
- 2.3.0 — 2014-06-11
- 2.1.2 — 2014-06-11
- 2.1.0 — 2014-06-11
- 2.0.1 — 2014-06-11
- 2.0.0 — 2014-06-11
- 1.0.0 — 2014-06-07

## README

# webgl-compile-shader 
[![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)

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

```js
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](http://github.com/mattdesl/webgl-compile-shader/blob/master/LICENSE.md) for details.

---
_Source: https://npm.io/package/webgl-compile-shader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
