A generic GLSL post-processing module for applying super-speedy GPU effects to
<video> element. If you're already working with a
3D scene you're better off using
an FBO, but this is useful for cases
where you've already got a 2D canvas/video thing and just want to add some
Takes the following and returns a new post-processing object:
glis a WebGL canvas context.
elementis a canvas element, video or image.
fragis a fragment shader, which may either be specified as a string or as a gl-shader.
vertis a vertex shader, and optional - you'll only need to specify this in special cases.
Your shader is supplied the following uniforms:
float width: the width of the element in pixels.
float height: the height of the element in pixels.
sampler2D map: the
elementyou specified as a texture.
gl, using the shader specified above. You can
optionally pass a
height value to override the defaults,
which are the dimensions of