3 * @brief Writes given fragment color to the rendering buffer. Adds glow if needed.
8 /** After glsl1110 this need to be explicitly declared; used by fixed functionality at the end of the OpenGL pipeline.*/
9 out vec4 gl_FragData[2];
11 /** After glsl1110 this need to be explicitly declared; used by fixed functionality at the end of the OpenGL pipeline.*/
12 out vec4 gl_FragColor;
16uniform float GLOWSCALE;
19uniform sampler2D SAMPLER_GLOWMAP;
21void writeFragment(vec4 color) {
23 gl_FragData[0] = color;
24 if (GLOWSCALE > 0.01) {
25 vec4 glowcolor = texture2D(SAMPLER_GLOWMAP, gl_TexCoord[0].st);
26 gl_FragData[1].rgb = glowcolor.rgb * glowcolor.a * GLOWSCALE;
27 gl_FragData[1].a = 1.0;
29 gl_FragData[1] = vec4(0,0,0,1);
32 if (GLOWSCALE > 0.01) {
33 vec4 glowcolor = texture2D(SAMPLER_GLOWMAP, gl_TexCoord[0].st);
34 color.rgb += glowcolor.rgb * glowcolor.a * GLOWSCALE;