mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-11-10 20:45:35 +01:00
17 lines
358 B
GLSL
17 lines
358 B
GLSL
//
|
|
// Simple passthrough fragment shader
|
|
//
|
|
varying vec2 v_vTexcoord;
|
|
varying vec4 v_vColour;
|
|
|
|
uniform int colors;
|
|
uniform float gamma;
|
|
|
|
void main() {
|
|
vec4 _col = texture2D( gm_BaseTexture, v_vTexcoord );
|
|
vec3 c = _col.rgb;
|
|
c = floor(pow(c, vec3(gamma)) * float(colors));
|
|
c = pow(c / float(colors), vec3(1.0 / gamma));
|
|
gl_FragColor = vec4(c, _col.a);
|
|
}
|