fteqw/engine/shaders/glsl/menutint.glsl
Spoike 685404250f added cmake file.
reduced input latency.
reworked how internal texture formats work,.
added support for LIGHTING_E5BGR9 bspx lump for HDR lighting.
updated support for srgb, no longer looks quite so weird. works on glx
vid_srgb 3 attempts to use half-float swapchains, where possible.
gl: use glTextureStorage where available.
d3d11: gave up on using dxgi for fullscreen, was just too buggy.
glx: updated gl context creation on linux.
server: fix svc_updatefrags not being passed though (fixes frikbot scores)
fs: spanned pk3s now work (fragmented files/directory will fail to open, so this needs a custom tool to be fully useful).
fixed restart_ents command (restarts the map, but preserving the players as they are)
tw: removed 'QWSKINS' featureset from tw config

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5217 fc73d0e0-1445-4013-8a0c-d673dee63da5
2018-03-04 14:41:16 +00:00

31 lines
No EOL
915 B
GLSL

!!cvari r_menutint_inverse
!!cvard_srgb r_menutint
#ifdef VERTEX_SHADER
attribute vec2 v_texcoord;
varying vec2 texcoord;
uniform vec4 e_rendertexturescale;
void main(void)
{
texcoord.x = v_texcoord.x*e_rendertexturescale.x;
texcoord.y = (1.0-v_texcoord.y)*e_rendertexturescale.y;
gl_Position = ftetransform();
}
#endif
#ifdef FRAGMENT_SHADER
varying vec2 texcoord;
uniform sampler2D s_t0;
uniform int cvar_r_menutint_inverse;
const vec3 lumfactors = vec3(0.299, 0.587, 0.114);
const vec3 invertvec = vec3(1.0, 1.0, 1.0);
void main(void)
{
vec3 texcolor = texture2D(s_t0, texcoord).rgb;
float luminance = dot(lumfactors, texcolor);
texcolor = vec3(luminance, luminance, luminance);
texcolor *= r_menutint;
texcolor = (cvar_r_menutint_inverse > 0) ? (invertvec - texcolor) : texcolor;
gl_FragColor = vec4(texcolor, 1.0);
}
#endif