fteqw/engine/shaders/glsl/defaultgammacb.glsl
Spoike 3ee3230f96 Try to fix up FTE's android port.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5445 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-04-15 18:43:42 +00:00

25 lines
585 B
GLSL

!!ver 100-450
!!samps 1
//this shader is applies gamma/contrast/brightness to the source image, and dumps it out.
varying vec2 tc;
varying vec4 vc; //gamma, contrast, brightness, contrastboost
#ifdef VERTEX_SHADER
attribute vec2 v_texcoord;
attribute vec4 v_colour;
void main ()
{
tc = vec2(v_texcoord.s, 1.0-v_texcoord.t);
vc = v_colour;
gl_Position = ftetransform();
}
#endif
#ifdef FRAGMENT_SHADER
void main ()
{
vec3 t = texture2D(s_t0, tc).rgb;
t = vc.a * t/((vc.a-1.0)*t + 1.0);
gl_FragColor = vec4(pow(t, vec3(vc.r))*vc.g + vc.b, 1.0);
}
#endif