Textures

Taking the first steps in OGL-programming I tried some texture binding - and didn’t succeed with my own bmp-file. Binding the bmp of a sample-code brought the wanted result. NeHe claims that not every bitmap-size is allowed. So, what do I have to consider regarding the bitmaps size?

Thanks for your reply!!!

TiX0

Originally posted by TiX0: So, what do I have to consider regarding the bitmaps size?

Your textures’ size must be powers of two: 16,32,64,128,256…

if your bitmap hasn’t got dimensions which are a power of 2, you can use gluScaleImage to resize it.

jimmi

I thought the minimum texture size was 64. In that case 32 and 16 don’t count.

Originally posted by Azdo:
Your textures’ size must be powers of two: 16,32,64,128,256…

The minimum is 1*1, the max is queryable.

Is that with mipmapping or you can load a 1*1 bitmap and create a level 0 texture with it? Chapter 9 of the Redbook in the definition of glTexImage2D() states “Both width and height must have the form 2m+2b, where m is a nonnegative integer (which can have a different value for width than for height) and b is the value of border. The maximum size of a texture map depends on the implementation of OpenGL, but it must be at least 64 × 64 (or 66 × 66 with borders).”

Originally posted by Mazy:
The minimum is 1*1, the max is queryable.

so what is 2^0 furrage? :slight_smile:

Read your quote again, Furrage…

“The maximum size of a texture map depends on the implementation of OpenGL, but it must be at least 64 × 64 (or 66 × 66 with borders).”

Basically it’s saying that the smallest an implementation can use for the MAXIMUM value is 64, not that the minimum must be 64.

In other words, you are guaranteed to at least have support up to 64x64.