View Full Version : Texture
10-09-2003, 03: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.
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, 06: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.
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.