2017-11-14 14:37:04 +00:00
|
|
|
!!ver 100-450
|
2018-11-27 16:48:19 +00:00
|
|
|
!!samps 1
|
2013-05-11 14:02:55 +00:00
|
|
|
//this shader is applies gamma/contrast/brightness to the source image, and dumps it out.
|
|
|
|
|
|
|
|
varying vec2 tc;
|
2019-04-07 16:41:09 +00:00
|
|
|
varying vec4 vc; //gamma, contrast, brightness, contrastboost
|
2013-05-11 14:02:55 +00:00
|
|
|
|
|
|
|
#ifdef VERTEX_SHADER
|
|
|
|
attribute vec2 v_texcoord;
|
|
|
|
attribute vec4 v_colour;
|
|
|
|
void main ()
|
|
|
|
{
|
2018-03-04 14:41:16 +00:00
|
|
|
tc = vec2(v_texcoord.s, 1.0-v_texcoord.t);
|
2013-05-11 14:02:55 +00:00
|
|
|
vc = v_colour;
|
|
|
|
gl_Position = ftetransform();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#ifdef FRAGMENT_SHADER
|
|
|
|
void main ()
|
|
|
|
{
|
2019-04-07 16:41:09 +00:00
|
|
|
vec3 t = texture2D(s_t0, tc).rgb;
|
2019-04-15 18:43:42 +00:00
|
|
|
t = vc.a * t/((vc.a-1.0)*t + 1.0);
|
2019-04-07 16:41:09 +00:00
|
|
|
gl_FragColor = vec4(pow(t, vec3(vc.r))*vc.g + vc.b, 1.0);
|
2013-05-11 14:02:55 +00:00
|
|
|
}
|
|
|
|
#endif
|