mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-14 00:10:46 +00:00
fceb77d3cb
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3958 fc73d0e0-1445-4013-8a0c-d673dee63da5
88 lines
1.8 KiB
C
88 lines
1.8 KiB
C
/*
|
|
WARNING: THIS FILE IS GENERATED BY 'generatebuiltinsl.c'.
|
|
YOU SHOULD NOT EDIT THIS FILE BY HAND
|
|
*/
|
|
|
|
#ifdef GLQUAKE
|
|
{QR_OPENGL, 110, "bloom_blur",
|
|
//apply gaussian filter
|
|
|
|
"varying vec2 tc;\n"
|
|
|
|
"#ifdef VERTEX_SHADER\n"
|
|
"attribute vec2 v_texcoord;\n"
|
|
"void main ()\n"
|
|
"{\n"
|
|
"tc = v_texcoord;\n"
|
|
"gl_Position = ftetransform();\n"
|
|
"}\n"
|
|
"#endif\n"
|
|
"#ifdef FRAGMENT_SHADER\n"
|
|
/*offset should be 1.2 pixels away from the center*/
|
|
"uniform vec3 e_glowmod;\n"
|
|
"uniform sampler2D s_t0;\n"
|
|
"void main ()\n"
|
|
"{\n"
|
|
"gl_FragColor =\n"
|
|
"0.3125 * texture2D(s_t0, tc - e_glowmod.st) +\n"
|
|
"0.375 * texture2D(s_t0, tc) +\n"
|
|
"0.3125 * texture2D(s_t0, tc + e_glowmod.st);\n"
|
|
"}\n"
|
|
"#endif\n"
|
|
},
|
|
#endif
|
|
#ifdef GLQUAKE
|
|
{QR_OPENGL, 110, "bloom_filter",
|
|
//the bloom filter
|
|
//filter out any texels which are not to bloom
|
|
|
|
"varying vec2 tc;\n"
|
|
|
|
"#ifdef VERTEX_SHADER\n"
|
|
"attribute vec2 v_texcoord;\n"
|
|
"void main ()\n"
|
|
"{\n"
|
|
"tc = v_texcoord;\n"
|
|
"gl_Position = ftetransform();\n"
|
|
"}\n"
|
|
"#endif\n"
|
|
"#ifdef FRAGMENT_SHADER\n"
|
|
"uniform sampler2D s_t0;\n"
|
|
"void main ()\n"
|
|
"{\n"
|
|
"gl_FragColor = (texture2D(s_t0, tc) - vec4(0.5, 0.5, 0.5, 0.0)) * vec4(2.0,2.0,2.0,1.0);\n"
|
|
"}\n"
|
|
"#endif\n"
|
|
},
|
|
#endif
|
|
#ifdef GLQUAKE
|
|
{QR_OPENGL, 110, "bloom_final",
|
|
//add them together
|
|
//optionally apply tonemapping
|
|
|
|
"varying vec2 tc;\n"
|
|
|
|
"#ifdef VERTEX_SHADER\n"
|
|
"attribute vec2 v_texcoord;\n"
|
|
"void main ()\n"
|
|
"{\n"
|
|
"tc = v_texcoord;\n"
|
|
"gl_Position = ftetransform();\n"
|
|
"}\n"
|
|
"#endif\n"
|
|
"#ifdef FRAGMENT_SHADER\n"
|
|
"uniform sampler2D s_t0;\n"
|
|
"uniform sampler2D s_t1;\n"
|
|
"uniform sampler2D s_t2;\n"
|
|
"uniform sampler2D s_t3;\n"
|
|
"void main ()\n"
|
|
"{\n"
|
|
"gl_FragColor = \n"
|
|
"texture2D(s_t0, tc) +\n"
|
|
"texture2D(s_t1, tc) +\n"
|
|
"texture2D(s_t2, tc) +\n"
|
|
"texture2D(s_t3, tc) ;\n"
|
|
"}\n"
|
|
"#endif\n"
|
|
},
|
|
#endif
|