i just developed an opengl application that uses texture arrays.
I need to clamp my textures to the border so i definded the GL_TEXTURE_WRAP T and S to CLAMP_TO_BORDER.
glTexParameterf(GL_TEXTURE_2D_ARRAY_EXT, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
glTexParameterf(GL_TEXTURE_2D_ARRAY_EXT, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
But this does not work with ati cards/drivers. Nvidia cards/drivers work just fine.
I tested ATI 4850 and 4890.
An example source code file can be downloaded here:
You can switch from GL_TEXTURE_2D to GL_TEXTURE_2D_ARRAY by enabling or disbling:
Here can you see that the clamping is not applied when texture arrays are used:
In contrast to clamping when texture_2d's are used:
Is there a way to workaround this issue? When will the opengl implementation be fixed?
This is my current workaround - i just implemented the clamping myself
vec4 borderColor =vec4(0.1,0.7,0.2,0.1);
if(texCoord.s<1 && texCoord.s >0 && texCoord.t <1 && texCoord.t >0)
borderColor = texture2DArray(base_texture, vec3(texCoord.st,1));
gl_FragColor = borderColor;