Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Instruments WebGL shaders to keep track of updates and modify existing shaders on the fly.
JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
LICENSE.md
README.md
index.js
package.json

README.md

gl-shader-hook experimental

Instruments WebGL shaders to keep track of updates and modify existing shaders on the fly.

Usage

gl-shader-hook

hook = require('gl-shader-hook')(gl)

Takes a WebGL canvas context gl, instrumenting that context and returning an EventEmitter.

hook.shaders

An object listing all of the currently discovered shaders. Each of these are wrapped in a class to provide you with some extra information and functionality. Unless otherwise specified, "shaders" and "programs" in these docs from here on out refer to wrapped shaders and wrapped programs.

hook.programs

An object listing all of the currently discovered programs.

hook.on('shader', callback(shader))

Emitted when a new shader is created.

hook.on('program', callback(program))

Emitted when a new program is created.

hook.on('compiled', callback(shader))

Emitted whenever a shader's source is successfully compiled.

hook.on('linked', callback(program))

Emitted whenever a program is successfully linked.

shader.on('compiled', callback)

Emitted whenever that shader has been successfully compiled.

shader.updateSource(source)

Updates a shader's source and recompiles it.

License

MIT. See LICENSE.md for details.

Something went wrong with that request. Please try again.