12d3e48785
Added some explicit IMGFMT_ constants for qc. Apply contrast after gamma, instead of before, should give a slightly more colourful result. Version command now lists supported image formats (separately from extensions). More BIH fixes. Add patchDefWS parsing in .map files, for rgba vertex colours. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5444 fc73d0e0-1445-4013-8a0c-d673dee63da5
25 lines
581 B
GLSL
25 lines
581 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)*t + 1);
|
|
gl_FragColor = vec4(pow(t, vec3(vc.r))*vc.g + vc.b, 1.0);
|
|
}
|
|
#endif
|