Quick setup for single-pass GLSL post-processing with gl-now
Quick setup for single-pass GLSL post-processing with gl-now.
Takes the game-shell returned
gl-now, in addition to a
fragment shader which takes the following
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.xyfor precise pixel coordinates.
Instead of listening to
gl-render, listen to
pp-render to draw to the
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 :)
MIT. See LICENSE.md for details.