Here's a nice simple posterise shader. Pretty useful example for a fullscreen shader:
#ifdef GL_ES
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
#endif
uniform sampler2D texture0;
varying vec2 uvVarying;
uniform float gamma;
uniform float numColors;
void main()
{
vec3 c = texture2D(texture0, uvVarying.xy).rgb;
c = pow(c, vec3(gamma, gamma, gamma));
c = c * numColors;
c = floor(c);
c = c / numColors;
c = pow(c, vec3(1.0/gamma));
gl_FragColor = vec4(c, 1.0);
}
Example image:
Some other superb examples here:
http://www.geeks3d.com/shader-library/
Using AppGameKit V2 Tier 1