Crappy textures

Started by
3 comments, last by scorpion007 17 years, 4 months ago
Well, I just can't get my damn textures to load correctly :X Click for screenshot As you can see, M$ crap paint shows it a little better... Any ideas? glGenTextures(1, &this->texture); glBindTexture(GL_TEXTURE_2D, this->texture); glTexImage2D(GL_TEXTURE_2D, 0, 4, bmp_width, bmp_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
www.zezenia.com
Advertisement
For one you aren't using mipmapping, two change the internal format to GL_RGBA8. So check into mipmapping. BTW what are the texture dimensions? POT is needed on older hardware if you are not going to use gluBuild2DMipmaps() or resize them yourself and load them as a POT. Unless you have a new GL2.0 compliant card you can use NPOT textures.

HTH
It also seems very stretched which is going to distort it. When you're texturing you want the polygon to have the same relative dimensions of the texture itself so there is no stretching. From your screenshot it appears that the poly to which you have it mapped is too long along the vertical axis.

-me
Quote:Original post by Palidine
It also seems very stretched which is going to distort it. When you're texturing you want the polygon to have the same relative dimensions of the texture itself so there is no stretching. From your screenshot it appears that the poly to which you have it mapped is too long along the vertical axis.

-me


Same problem with same size also.


And MARS_999, I have tried to use gluBuild2DMipmaps(), but it didn't work. I'll check what this GL_RGBA8 does though.

Edit: It seems to be something wrong with my hardware, works for a friend:
http://mitglied.lycos.de/warriorsofhonour/screenzo.PNG

[Edited by - D-Slicer on December 16, 2006 9:08:23 AM]
www.zezenia.com
What exactly is wrong with how Opengl is drawing your texture? The only (minor) thing I can notice is a lack of bitdepth in your pixels.

Other than that, looks fine.

This topic is closed to new replies.

Advertisement