Jump to content
  • Advertisement
Sign in to follow this  
O-san

OpenGL npot textures

This topic is 3512 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

How do OpenGL deal with textures which are in npot-format when the graphic card lacks support for it? Does the texture become all corrupt or does it rely on some sort of mip-maps instead?

Share this post


Link to post
Share on other sites
Advertisement
OpenGL will raise an error, and texturing will be disabled on the affected unit (all accesses to it will result in a white colour).

Share this post


Link to post
Share on other sites
NPoT - Sin.

Yes, some hardware supports it, but I spend a lot of my week at work whipping artists for putting silly sized textures into game. I hate them with a passion, that is NPoT textures, not the artists [smile].

In a previous game (hobbyist one) I worked on we had a few NPoT textures as I just chose to not care out of ease, and on cards that didn't support it (partially due to poor error handling), they were just all white and didn't show correctly. Not to say this is the default behaviour of all cards, probably more to my renderer's pipeline than anything else.

Share this post


Link to post
Share on other sites
consider using texture rectangles "GL_ARB_texture_rectangle" it was intruduced earlier than NPOT textures, so older hardware may have support for that kind of extension.

Share this post


Link to post
Share on other sites
Okay, here's what i've found yesterday, using:

glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

...u can load textures of any size, if you're OpenGL support it.
No more crash! No code change...

Share this post


Link to post
Share on other sites
Hmm, I guess the default value for UNPACK_ALIGNMENT of 4 has caused a lot of grief over the years...

Does anyone know if the word alignment actually provides better performance in practice with modern hardware or is just historical/theoretical? I once tried a few quick benchmarks but could never show that aligning data to word boundaries was faster.

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!