raylib/shaders/gles100/posterization.fs
raysan5 b1a90a7f91 Added some useful postprocessing shaders
Shaders come in two flavours:
- shaders/gl330: OpenGL 3.3+ (Windows, Linux, OSX)
- shaders/gles100:  OpenGL ES 2.0 (Android, RPI, HTML5)
2015-09-02 02:44:16 +02:00

26 lines
504 B
GLSL

#version 100
precision mediump float;
varying vec2 fragTexCoord;
uniform sampler2D texture0;
uniform vec4 tintColor;
// NOTE: Add here your custom variables
float gamma = 0.6;
float numColors = 8.0;
void main()
{
vec3 color = texture2D(texture0, fragTexCoord.xy).rgb;
color = pow(color, vec3(gamma, gamma, gamma));
color = color*numColors;
color = floor(color);
color = color/numColors;
color = pow(color, vec3(1.0/gamma));
gl_FragColor = vec4(color, 1.0);
}