cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Jotschi
Journeyman III

OpenGL Extentsion - GL_TEXTURE_2D_ARRAY_EXT - CLAMP_TO_BORDER not supported

Hello,

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:

http://www.jotschi.de/download/opengl_texture_array_glsl_example.tgz

You can switch from GL_TEXTURE_2D to GL_TEXTURE_2D_ARRAY by enabling or disbling:

#define NOARRAY

 

Here can you see that the clamping is not applied when texture arrays are used:

http://www.jotschi.de/wp-content/uploads/2009/10/GL_TEXTURE_2D_ARRAY_CLAMP_TO_BORDER-ATI.png

In contrast to clamping when texture_2d's are used:

http://www.jotschi.de/wp-content/uploads/2009/10/GL_TEXTURE_2D_CLAMP_TO_BORDER-ATI.png

 

Is there a way to workaround this issue? When will the opengl implementation be fixed?

Greetings,

Jotschi

 

 

0 Likes
1 Reply
Jotschi
Journeyman III

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;
0 Likes