Original Post
I'm trying to implement the blur fragment shader from the OpenGL Superbible, but I'm confused as to where the tc_offset variable is being set. Here's the code: Is tc_offset automatically set to the texture coordinates of the neighboring texels, like sampler0 is automatically set to the first texture unit?
uniform sampler2D sampler0;
uniform vec2 tc_offset[9];
void main(void)
{
vec4 sample[9];
for( int i = 0; i < 9; i++ )
{
sample = texture2D( sampler0, gl_TexCoord[0].st + tc_offset );
}
// 1 2 1
// 2 1 2 / 13
// 1 2 1
gl_FragColor = sample[1];/*(sample[0] + (2.0*sample[1]) + sample[2] +
(2.0*sample[3]) + sample[4] + (2.0*sample[5]) +
sample[6] + (2.0*sample[7]) + sample[8]) / 13.0;
}