mirror of
https://github.com/Q3Rally-Team/q3rally.git
synced 2024-12-02 00:11:58 +00:00
e7405e98df
OpenGL2: Use an OpenGL 3.2 core context if available OpenGL2: Remove GLSL_ValidateProgram() OpenGL2: Don't do MSAA resolve/shadow mask/SSAO on shadow views OpenGL2: "Fix" cg_shadows 4 Fix score bonus for defending the flag carrier in CTF Restore not giving defense score bonus to flag carrier Add score bonus for defending the flag carrier in 1 Flag CTF Move CON_Init ahead of Com_Init to avoid Windows dedicated server crash Make 'globalservers 0' fetch all masters OpenGL2: Don't use initialized arrays in glsl shaders Echo server say/tell/sayto message to console Don't try to remove non-existant command 'shaderstate' Update internal curl to 7.54.0 Silence g_util.c warning about set but not read variable Remove unused imgFlag_t value IMGFLAG_SRGB Make warmup in Team Deathmatch wait for players to join both teams Remove CVAR_PROTECTED from cl_renderer Fix/improve buffer overflow in MSG_ReadBits/MSG_WriteBits Fix friction in AAS_ClientMovementPrediction Fix floating point precision loss in renderer Reject OpenGL contexts w/ software renderer when core context requested
84 lines
4.3 KiB
GLSL
84 lines
4.3 KiB
GLSL
uniform sampler2D u_TextureMap;
|
|
|
|
uniform vec4 u_Color;
|
|
|
|
uniform vec2 u_InvTexRes;
|
|
varying vec2 var_TexCoords;
|
|
|
|
void main()
|
|
{
|
|
vec4 color;
|
|
vec2 tc;
|
|
|
|
#if 0
|
|
float c[7];
|
|
|
|
c[0] = 1.0;
|
|
c[1] = 0.9659258263;
|
|
c[2] = 0.8660254038;
|
|
c[3] = 0.7071067812;
|
|
c[4] = 0.5;
|
|
c[5] = 0.2588190451;
|
|
c[6] = 0.0;
|
|
|
|
tc = var_TexCoords + u_InvTexRes * vec2( c[0], c[6]); color = texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( c[1], c[5]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( c[2], c[4]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( c[3], c[3]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( c[4], c[2]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( c[5], c[1]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( c[6], c[0]); color += texture2D(u_TextureMap, tc);
|
|
|
|
tc = var_TexCoords + u_InvTexRes * vec2( c[1], -c[5]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( c[2], -c[4]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( c[3], -c[3]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( c[4], -c[2]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( c[5], -c[1]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( c[6], -c[0]); color += texture2D(u_TextureMap, tc);
|
|
|
|
tc = var_TexCoords + u_InvTexRes * vec2( -c[0], c[6]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( -c[1], c[5]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( -c[2], c[4]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( -c[3], c[3]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( -c[4], c[2]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( -c[5], c[1]); color += texture2D(u_TextureMap, tc);
|
|
|
|
tc = var_TexCoords + u_InvTexRes * vec2( -c[1], -c[5]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( -c[2], -c[4]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( -c[3], -c[3]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( -c[4], -c[2]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( -c[5], -c[1]); color += texture2D(u_TextureMap, tc);
|
|
|
|
gl_FragColor = color * 0.04166667 * u_Color;
|
|
#endif
|
|
|
|
float c[5];
|
|
|
|
c[0] = 1.0;
|
|
c[1] = 0.9238795325;
|
|
c[2] = 0.7071067812;
|
|
c[3] = 0.3826834324;
|
|
c[4] = 0.0;
|
|
|
|
tc = var_TexCoords + u_InvTexRes * vec2( c[0], c[4]); color = texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( c[1], c[3]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( c[2], c[2]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( c[3], c[1]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( c[4], c[0]); color += texture2D(u_TextureMap, tc);
|
|
|
|
tc = var_TexCoords + u_InvTexRes * vec2( c[1], -c[3]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( c[2], -c[2]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( c[3], -c[1]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( c[4], -c[0]); color += texture2D(u_TextureMap, tc);
|
|
|
|
tc = var_TexCoords + u_InvTexRes * vec2( -c[0], c[4]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( -c[1], c[3]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( -c[2], c[2]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( -c[3], c[1]); color += texture2D(u_TextureMap, tc);
|
|
|
|
tc = var_TexCoords + u_InvTexRes * vec2( -c[1], -c[3]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( -c[2], -c[2]); color += texture2D(u_TextureMap, tc);
|
|
tc = var_TexCoords + u_InvTexRes * vec2( -c[3], -c[1]); color += texture2D(u_TextureMap, tc);
|
|
|
|
gl_FragColor = color * 0.0625 * u_Color;
|
|
}
|