Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hughsk/gl-shader-hook
Instruments WebGL shaders to keep track of updates and modify existing shaders on the fly.
https://github.com/hughsk/gl-shader-hook
Last synced: 12 days ago
JSON representation
Instruments WebGL shaders to keep track of updates and modify existing shaders on the fly.
- Host: GitHub
- URL: https://github.com/hughsk/gl-shader-hook
- Owner: hughsk
- License: mit
- Created: 2013-11-13T10:42:30.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2013-11-13T11:20:03.000Z (almost 11 years ago)
- Last Synced: 2024-10-17T16:40:38.077Z (22 days ago)
- Language: JavaScript
- Size: 109 KB
- Stars: 9
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# gl-shader-hook [![experimental](http://hughsk.github.io/stability-badges/dist/experimental.svg)](http://github.com/hughsk/stability-badges) #
Instruments WebGL shaders to keep track of updates and modify existing shaders
on the fly.## Usage ##
[![gl-shader-hook](https://nodei.co/npm/gl-shader-hook.png?mini=true)](https://nodei.co/npm/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](http://github.com/hughsk/gl-shader-hook/blob/master/LICENSE.md) for details.