PDA

View Full Version : Texture



ramana
10-09-2003, 03:57 AM
Hi,

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

Please give the example.

Bob
10-09-2003, 04: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.

mehdi
10-09-2003, 06:39 AM
Hi,

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.