Hi,
How to map texture to the polygon if the Texture width and heights are not in powers of 2.
Please give the example.
Hi,
How to map texture to the polygon if the Texture width and heights are not in powers of 2.
Please give the example.
Three options.
[ul][]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.[/ul]
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.