Dealing With Incorrectly Shaped Textures In OpenGL ES

 As you may know, OpenGL ES requires that supplied textures be created in powers of 2. 

It can be a pain to convert many textures, and not wanting to do so programmer Craig Giles decided to look through some of Apple’s own source code and come up with a solution.  The eventual solution is to stretch the texture until it is a power of two, and then perform an affine transform if the texture ends up exceeding the texture size limitations.

Check out OpenGL ES Texture2D:Power of Two for the full post including code snippets and an explanation.

[Source: Journey To XNA]

 

Share and Enjoy:
  • RSS
  • Digg
  • DZone
  • Reddit
  • del.icio.us
  • Facebook
  • Twitter
  • FriendFeed

Leave a Reply

CommentLuv Enabled