Loading power of 2 size textures

Started by
2 comments, last by MARS_999 17 years, 6 months ago
hello, Is there a method to load/use textures in OpenGL that don't have sizes of power of 2 ? (1024x768 for example)
Advertisement
Don't think so. But it shouldn't be that hard to do yourself. Simply load your image, then create a texture which is 1024x1024 and then copy your image to the topleft corner of the texture. Then all you have to do is to align your texture coordinates properly, so instead of setting texcoords to 1.0 you would set it to 1.0/1024*768(0.75).
the extension GL_ARB_texture_non_power_of_two allows textures to be non-pow2. although it had become a core feature in OpenGL 2.0, it's rarely hw accelerated on consumer hardware.

>>> feeding your glTexImage functions w/ non-pow2 textures should succeeds if your extension string contains "GL_ARB_texture_non_power_of_two", but be aware of some noticeable performance losses...

cheers
zimerman
You have a few options

1. scale it yourself with PS or Gimp and load the texture as POT

2. use gluBuild2DMipmaps() it will scale the texture to the nearest POT size.

3. use it as it but be aware only Geforce 6 series and newer and ATI's x1000 I think finally added NPOT support don't quote me on the ATI stuff been awhile since I have had an ATI card.

This topic is closed to new replies.

Advertisement