From fceb77d3cba0f218b8736c5897aa6141d184d7b6 Mon Sep 17 00:00:00 2001 From: Spoike Date: Wed, 18 Jan 2012 02:44:50 +0000 Subject: [PATCH] probably I should add some makefile rule instead. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3958 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/gl/r_bishaders.h | 88 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 engine/gl/r_bishaders.h diff --git a/engine/gl/r_bishaders.h b/engine/gl/r_bishaders.h new file mode 100644 index 000000000..32d9c2fba --- /dev/null +++ b/engine/gl/r_bishaders.h @@ -0,0 +1,88 @@ +/* +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