Jump to content
  • Advertisement
Sign in to follow this  
Mikhael

OpenGL Loading power of 2 size textures

This topic is 4324 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hello, Is there a method to load/use textures in OpenGL that don't have sizes of power of 2 ? (1024x768 for example)

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!