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