Files
Shyotl a579663eb9 Added Gaussian blur post-process shader
Added ability to manually input values in post-process shader menu
2011-02-10 04:03:22 -06:00

29 lines
907 B
GLSL

/**
* @file blurf.glsl
*
* Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
* $License$
*/
uniform sampler2DRect RenderTexture;
uniform float bloomStrength;
varying vec4 gl_TexCoord[gl_MaxTextureCoords];
float blurWeights[4] = float[4](.05,.1,.2,.3);
void main(void)
{
vec3 color = blurWeights[0] * texture2DRect(RenderTexture, gl_TexCoord[0].st).rgb;
color+= blurWeights[1] * texture2DRect(RenderTexture, gl_TexCoord[1].st).rgb;
color+= blurWeights[2] * texture2DRect(RenderTexture, gl_TexCoord[2].st).rgb;
color+= blurWeights[3] * texture2DRect(RenderTexture, gl_TexCoord[3].st).rgb;
color+= blurWeights[2] * texture2DRect(RenderTexture, gl_TexCoord[4].st).rgb;
color+= blurWeights[1] * texture2DRect(RenderTexture, gl_TexCoord[5].st).rgb;
color+= blurWeights[0] * texture2DRect(RenderTexture, gl_TexCoord[6].st).rgb;
color *= bloomStrength;
gl_FragColor = vec4(color, 1.0);
}