2015-09-02 03:44:16 +03:00
|
|
|
#version 330
|
|
|
|
|
|
|
|
in vec2 fragTexCoord;
|
|
|
|
|
|
|
|
out vec4 fragColor;
|
|
|
|
|
|
|
|
uniform sampler2D texture0;
|
2016-01-13 19:13:28 +03:00
|
|
|
uniform vec4 fragTintColor;
|
2015-09-02 03:44:16 +03:00
|
|
|
|
|
|
|
// NOTE: Add here your custom variables
|
|
|
|
|
2016-01-16 14:53:48 +03:00
|
|
|
float gamma = 0.6;
|
|
|
|
float numColors = 8.0;
|
2015-09-02 03:44:16 +03:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2016-01-16 14:53:48 +03:00
|
|
|
vec3 color = texture(texture0, fragTexCoord.xy).rgb;
|
2015-09-02 03:44:16 +03:00
|
|
|
|
|
|
|
color = pow(color, vec3(gamma, gamma, gamma));
|
|
|
|
color = color*numColors;
|
|
|
|
color = floor(color);
|
|
|
|
color = color/numColors;
|
|
|
|
color = pow(color, vec3(1.0/gamma));
|
|
|
|
|
|
|
|
fragColor = vec4(color, 1.0);
|
|
|
|
}
|