Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hughsk/pp-now
Quick setup for single-pass GLSL post-processing with gl-now
https://github.com/hughsk/pp-now
Last synced: 8 days ago
JSON representation
Quick setup for single-pass GLSL post-processing with gl-now
- Host: GitHub
- URL: https://github.com/hughsk/pp-now
- Owner: hughsk
- License: mit
- Created: 2013-10-12T03:22:24.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-10-28T04:42:36.000Z (about 11 years ago)
- Last Synced: 2024-10-17T16:41:27.516Z (22 days ago)
- Language: JavaScript
- Size: 117 KB
- Stars: 2
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# pp-now [![experimental](http://hughsk.github.io/stability-badges/dist/experimental.svg)](http://github.com/hughsk/stability-badges) #
Quick setup for single-pass GLSL post-processing with
[gl-now](http://github.com/mikolalysenko/gl-now).## Usage ##
[![pp-now](https://nodei.co/npm/pp-now.png?mini=true)](https://nodei.co/npm/pp-now)
### `require('pp-now')(shell, fragment[, vertex])` ###
Takes the [game-shell](http://github.com/mikolalysenko/game-shell) returned
by `gl-now`, in addition to a `fragment` shader which takes the following
required variables:* `uniform sampler2D frame;` - the screen as a 2D texture.
* `uniform sampler2D depth;` - the screen's depth buffer as a 2D texture.
* `uniform vec2 frameSize;` - the width/height of the screen in pixels.
* `varying vec2 uv;` - the coordinates on the screen from 0 to 1.
Alternatively, you can use `gl_FragCoord.xy` for precise pixel coordinates.### `shell.on('pp-render', frame(t))` ###
Instead of listening to `gl-render`, listen to `pp-render` to draw to the
post-processing framebuffer.### `shell.on('pp-uniforms', frame(shader))` ###
Passes the [gl-shader](http://github.com/mikolalysenko/gl-shader) being
used for post-processing so that you can update your own additional uniforms
manually.***
Note that if you're already using framebuffers in your demo it might break -
in which case, you probably won't have much trouble adding post-processing
yourself :)## License ##
MIT. See [LICENSE.md](http://github.com/hughsk/pp-now/blob/master/LICENSE.md) for details.