PDA

View Full Version : Some Texture problems



Jorge
08-23-2004, 12:32 PM
Hello!!

First at all, im not english so sorry for my wrongs.

I read nehe tutorials and now im trying to get my own programs. But i get a problem. All nehe examples use images that have 128*128, 256*256 pixels. If i try to change images the programs dont show image, all appear black.

In my program i need to get textures from images for diferent pixels....16*16, 24*24, 640*480, 16*32......

Please, can someone say me how get texture from this images, and get my rogram draw the imagen on my screen??

Thank you very much, and sorry for my mistakes, my english dont really good ^^;

ZbuffeR
08-23-2004, 01:05 PM
Your english is not so bad, I understood your question ;)

About GL textures : you need to use 'power of two' sizes in x and y.
Ie you can have a 16*64 texture, but not a 640*480. For such cases either scale your image so that it fits in a 512*512 texture, or fill the lower left corner of a 1024*512 texture, and use adequate texture coordinates.
(this limitation can be removed with some GL extensions, but I will keep it simple for now)

About nehe code, I think it should work for all power of two resolutions. Are you sure you can't make it work with a 16*64 image ?

Jorge
08-23-2004, 01:19 PM
Hello!!

Thank you very much, you answer very fast.

Really i dont try using 16*64....i need another dimensions and dont try it, but thanks.

Another question that i have now.....hoy can a get a texture from a part of image??

For example, i get image 256*256 for multiple sub-images 16*16.....how can i get a texture from a subimage??

From first question i thing i will redimension it to 512*512, and redimension to 640*480 in-time.

Thank you :)