pp-now
Quick setup for single-pass GLSL post-processing with gl-now
Last updated 7 years ago by hughsk .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install pp-now 
SYNC missed versions from official npm registry.

pp-now experimental

Quick setup for single-pass GLSL post-processing with gl-now.

Usage

pp-now

require('pp-now')(shell, fragment[, vertex])

Takes the 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.
  • 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 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 for details.

Current Tags

  • 0.1.0                                ...           latest (7 years ago)

2 Versions

  • 0.1.0                                ...           7 years ago
  • 0.0.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (5)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |