1uniform sampler2D m_Texture; // this should hold the texture rendered by the horizontal blur pass
2uniform float m_Size;
3uniform float m_Scale;
4varying vec2 texCoord;
5
6
7
8void main(void)
9{  float blurSize = m_Scale/m_Size;
10   vec4 sum = vec4(0.0);
11
12   // blur in y (vertical)
13   // take nine samples, with the distance blurSize between them
14   sum += texture2D(m_Texture, vec2(texCoord.x, texCoord.y - 4.0*blurSize)) * 0.05;
15   sum += texture2D(m_Texture, vec2(texCoord.x, texCoord.y - 3.0*blurSize)) * 0.09;
16   sum += texture2D(m_Texture, vec2(texCoord.x, texCoord.y - 2.0*blurSize)) * 0.12;
17   sum += texture2D(m_Texture, vec2(texCoord.x, texCoord.y - blurSize)) * 0.15;
18   sum += texture2D(m_Texture, vec2(texCoord.x, texCoord.y)) * 0.16;
19   sum += texture2D(m_Texture, vec2(texCoord.x, texCoord.y + blurSize)) * 0.15;
20   sum += texture2D(m_Texture, vec2(texCoord.x, texCoord.y + 2.0*blurSize)) * 0.12;
21   sum += texture2D(m_Texture, vec2(texCoord.x, texCoord.y + 3.0*blurSize)) * 0.09;
22   sum += texture2D(m_Texture, vec2(texCoord.x, texCoord.y + 4.0*blurSize)) * 0.05;
23
24   gl_FragColor = sum;
25}