pico-8-post-processing

Pico-8 Post Processing

Live Example.

Pico-8 exports to HTML via export somename.html

Add this script to the top of that page as in

<script src="https://greggman.github.io/pico-8-post-processing/pico-8-post-processing.js"></script>

Then below it add your GLSL post processing filter.

<script>
pico8Filter.setFilter({
  fragmentShader: `
    void mainImage( out vec4 fragColor, in vec2 fragCoord )
    {
        vec2 uv = fragCoord / iResolution.xy;
        fragColor = texture2D(iChannel0, uv);
    }
  `,
  width: 128,
  height: 128,
});
</script>

Filters are based on the same uniforms as Shadertoy. In particular you’re expected to write a GLSL shader function like this

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
  vec2 uv = fragCoord / iResolution.xy;
  fragColor = texture2D(iChannel0, uv);
}

with access to the same inputs as Shadertoy.

Uniforms

Options

Call pico8Filter.setFilter to set a new filter and pass it an object with the following properties.

Licence

MIT