uniform sampler2DRect sampler; uniform sampler2DRect weightSampler; void main() { float yOffset = floor(gl_TexCoord[1].x) + 0.5; vec4 weights0 = texture2DRect(weightSampler, vec2(0.5, yOffset)); vec4 weights1 = texture2DRect(weightSampler, vec2(1.5, yOffset)); vec4 weights2 = texture2DRect(weightSampler, vec2(2.5, yOffset)); vec2 point = vec2(weights0.x, gl_TexCoord[0].y); vec4 pixel; pixel = texture2DRect(sampler, point + vec2(0.0, 0.0)) * vec4(weights0.y); pixel += texture2DRect(sampler, point + vec2(1.0, 0.0)) * vec4(weights0.z); pixel += texture2DRect(sampler, point + vec2(2.0, 0.0)) * vec4(weights0.w); pixel += texture2DRect(sampler, point + vec2(3.0, 0.0)) * vec4(weights1.x); pixel += texture2DRect(sampler, point + vec2(4.0, 0.0)) * vec4(weights1.y); pixel += texture2DRect(sampler, point + vec2(5.0, 0.0)) * vec4(weights1.z); pixel += texture2DRect(sampler, point + vec2(6.0, 0.0)) * vec4(weights1.w); pixel += texture2DRect(sampler, point + vec2(7.0, 0.0)) * vec4(weights2.x); pixel += texture2DRect(sampler, point + vec2(8.0, 0.0)) * vec4(weights2.y); gl_FragColor = pixel; }