View Full Version : Issue with glTexImage2D?
Mars_999
2004.10.17, 10:54 PM
I am not sure why but when I use glTexImage2D I get white textures when I use gluBuild2DMipmaps everything is fine?
glTexImage2D(GL_TEXTURE_2D, 0, imageType, imageWidth, imageHeight, 0, imageType, GL_UNSIGNED_BYTE, imageData);
Also my glTexSubImage doesn't work either so I am under the assumption that it only works with glTexSubImage2D and not gluBuild2DMipmaps?
thanks
AnotherJake
2004.10.17, 11:05 PM
Yeah Apple corrected it so that it's *proper* now. You need to specify glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ) or whatever filtering you want to avoid the white textures.
Mars_999
2004.10.17, 11:08 PM
Ugh I forgot I had GL_LINEAR_MIPMAP_LINEAR in as a parameter....
been awhile since I have looked at my texture loading code....
thanks
Mars_999
2004.10.21, 08:30 PM
Now with the images loading correctly I have a new problem with glTexImage2D that I dont' have with gluBuild2DMipmaps. If I use gluBuild2DMipmaps all my textures load correctly and all are shown, I am using multitexturing and have 7 texture units at once. When I use glTexImage2D only the 4th texture unit shows up and the first 3 are not shown? I am using a fragment program and not sure what would be causing this? Thanks
arekkusu
2004.10.21, 09:04 PM
Do your textures have power-of-two dimensions? gluBuild2DMipmaps will always rescale your texture data to POT sizes, so it works with all texture targets. With glTexImage you are free to specify any size, which may or may not work depending which target you are using.
Mars_999
2004.10.21, 09:06 PM
Do your textures have power-of-two dimensions? gluBuild2DMipmaps will always rescale your texture data to POT sizes, so it works with all texture targets. With glTexImage you are free to specify any size, which may or may not work depending which target you are using.
Yes they are POW RGBA textures...
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.