Why does this OpenGL shader use texture coordinates beyond 1.0?

I'm trying to get to know shaders in opengl. Here is an example of the code I found (working with openframeworks). The code simply blurs the image in two passes, first horizontally, then vertically. Here is the code from the horizontal shader. My only confusion is the texture coordinates. They exceed 1.

void main( void )
{
    vec2 st = gl_TexCoord[0].st;
    //horizontal blur
    //from http://www.gamerendering.com/2008/10/11/gaussian-blur-filter-shader/

    vec4 color;

    color += 1.0 * texture2DRect(src_tex_unit0, st + vec2(blurAmnt * -4.0, 0));
    color += 2.0 * texture2DRect(src_tex_unit0, st + vec2(blurAmnt * -3.0, 0));
    color += 3.0 * texture2DRect(src_tex_unit0, st + vec2(blurAmnt * -2.0, 0));
    color += 4.0 * texture2DRect(src_tex_unit0, st + vec2(blurAmnt * -1.0, 0));

    color += 5.0 * texture2DRect(src_tex_unit0, st + vec2(blurAmnt , 0));

    color += 4.0 * texture2DRect(src_tex_unit0, st + vec2(blurAmnt * 1.0, 0));
    color += 3.0 * texture2DRect(src_tex_unit0, st + vec2(blurAmnt * 2.0, 0));
    color += 2.0 * texture2DRect(src_tex_unit0, st + vec2(blurAmnt * 3.0, 0));
    color += 1.0 * texture2DRect(src_tex_unit0, st + vec2(blurAmnt * 4.0, 0));

    color /= 5.0;
    gl_FragColor = color;
}

I cannot make heads or tails from this code. The texture coordinates should be between 0 and 1, and I read a little about what happens when they are greater than 1, but this is not the behavior that I see (or I do not see the connection). blurAmnt varies between 0.0 and 6.4, so s can go from 0 to 25.6. The image only blurred more or less depending on the value, I do not see repeating patterns.

: , texture2DRect 1? ?

+5
2

[0, 1] GL_TEXTURE_2D. texture2DRect ( samplerRect), GL_TEXTURE_RECTANGLE_ARB, [0, ] x [0, ].

"" . , .

+8

. -

glTexParameteri (GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP);

s , IIRC. t.

-1

All Articles