tags:

views:

33

answers:

1

I wrote an uncompressed TGA texture loader and it works nearly perfect, except for the fact that there's just one TINY little black patch on the upper right and it's driving me mad. I can get rid of it by using a texture border, but somehow I think that's not the practical solution.

Has anyone encountered this kind of problem before and knows -generally- what's going wrong when something like this happens, or should I post the image-loading function code?

Here's a picture, the little black dot is REALLY small.

http://img651.imageshack.us/img651/2230/dasdwx.png

+1  A: 

Ok, I'm assuming that your image loading routine is correct. Do you use texture clamping (where the last pixels at the edges get repeated)? This may be necessary for OpenGL in this case to calculate the smoothed version of the texture. I remember, that it did work for me without that trick on Linux, but not on Windows.

Texture clamping:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);

You may also need to play around with GL_TEXTURE_MAG_FILTER.

Chris Lercher
Well I didn't notice this before, but the texture I was loading was actually 64x64 pixels.Normal 256 x 256 images seem to load and map just fine, but 64x64 is what produces that little block blotch. I'll still try out these suggestions to see if I can fix it in the case of small images.
Whynne