my application is runnig fine with arb_texture_rectangle, but to run it on an ATi card i must switch to arb_npot. it is runnig almost perfect, except of the reduction code
i am rendering to 2048x2048 GL_RGBA16F_ARB texture (only to red channel) and after that i want the max value from it. i implemented it through reductions and arb_texture_rectangle code works perfect, but the arb_npot code returns bad values. first 2-3 iterations are ok, but then the max value is smaller and smaller.
here is the shader:
uniform sampler2D tex;
void main() {
vec4 data;
data.x = texture2D(tex, gl_TexCoord[0].st).x;
data.y = texture2D(tex, gl_TexCoord[0].st + vec2(-1.0 / 2048.0, 0.0)).x;
data.z = texture2D(tex, gl_TexCoord[0].st + vec2(-1.0 / 2048.0, -1.0 / 2048.0)).x;
data.w = texture2D(tex, gl_TexCoord[0].st + vec2( 0.0, -1.0 / 2048.0)).x;
gl_FragColor.x = max(max(data.x, data.y), max(data.z, data.w));
}
and here the quad rendering:
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f);
glVertex3f(0.0f, 0.0f, -0.5f);
glTexCoord2f(vWidth / 2048.0f, 0.0f);
glVertex3f((vWidth > 1) ? vWidth >> 1 : vWidth, 0.0f, -0.5f);
glTexCoord2f(vWidth / 2048.0f, vHeight / 2048.0f);
glVertex3f((vWidth > 1) ? vWidth >> 1 : vWidth, (vHeight > 1) ? vHeight >> 1 : vHeight, -0.5f);
glTexCoord2f(0.0f, vHeight / 2048.0f);
glVertex3f(0.0f, (vHeight > 1) ? vHeight >> 1 : vHeight, -0.5f);
glEnd();
the only difference is, that i normalize the texcoords. where could be error? it looks like some rows/columns are skipped
gf6600gt, 81.85, xp sp2
ps: if ATi will implement arb_texture_rectangle extensions, then life will be much easier in gpgpu world. i know, that ATi is only for npot and there is no way they will implement arb_texture_rectangle ((