View Full Version : Texture

10-09-2003, 04:57 AM

How to map texture to the polygon if the Texture width and heights are not in powers of 2.

Please give the example.

10-09-2003, 05:20 AM
Three options.
Scale the image to a power of two. Upload the image as a part of a larger texture (glTexSubImage) and adjust texture coordinates. Use an extensions that allows non-power of two textures, if present that is.

10-09-2003, 07:39 AM

there is at least two possibilities:

-use the OGL routine "gluBuild2DMipmaps
" which scale the image to become DimensionsPowerOf2, it build all image mipmaps(image levels), this make the operation most slow(because it build all the image levels)but u dont take in consideration the nature of the image dims.

-the other possibility is to scale the image for transforming dims to become PowerOf2(using "gluScaleImage" routine)then call "glTexImage2D" to build the texture of the desired level.