PDA

View Full Version : texturedistortion when using texture borders



henon
12-21-2002, 10:40 AM
hi,
I split up a very big bitmap to a number of textures, but get visible seams between adjacent quads due to filtering (!! textures are diplayed correctly).
to get rid of the seams, i split my image so, that every texturemap has one pixelrow of the neighbouring texture in its border.

when i load this resulting 258x258 textures with border value=1 i get some greyish colors and distorted textures.
Seems, that Opengl takes the borderpixels as texture pixels.

Has anyone any idea whats going wrong with it or should i provide more detailed information what commands i actually use?

im not doing anything special, just:
glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, 1, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data);

thanx for help,

zen
12-22-2002, 03:37 AM
You don't have to use the opengl border mechanism(you could but it probably won't be accelerated).Check out this link to a page with info on this technique when used in terrains.
http://www.fractalscape.org/TextureSeams

This might not be what you're using it for but it should help nevertheless.