1
0
Fork 0
forked from fte/fteqw
fteqw/engine/shaders/glsl/colourtint.glsl
Spoike 5b4756f3d9 Lazy GLSL loading, for faster load times.
Fixed some xim issues, for proper keyboard input under x11.
Cmake project can now work for cross compiling win32 targets.
Some other fun-but-pointless stuff.



git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5344 fc73d0e0-1445-4013-8a0c-d673dee63da5
2018-11-27 16:48:19 +00:00

21 lines
523 B
GLSL

!!samps 2
//this glsl shader is useful for cubemapped post processing effects (see csaddon for an example)
varying vec4 tf;
#ifdef VERTEX_SHADER
void main ()
{
gl_Position = tf = vec4(v_position.xy,-1.0, 1.0);
}
#endif
#ifdef FRAGMENT_SHADER
void main()
{
vec2 fc;
fc = tf.xy / tf.w;
vec3 raw = texture2D(s_t0, (1.0 + fc) / 2.0).rgb;
#define LUTSIZE 16.0
vec3 scale = vec3((LUTSIZE-1.0)/LUTSIZE);
vec3 bias = vec3(1.0/(2.0*LUTSIZE));
gl_FragColor = texture3D(s_t1, raw * scale + bias);
}
#endif