Jump to content
  • Advertisement
Sign in to follow this  
Amma

Please explain ARB_texture_non_power_of_two

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

Can someone explain how to use ARB_texture_non_power_of_two? I've read the specs. but can't seem to make it work. Where am I supposed to replace my 'GL_TEXTURE_2D', and to what?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
with ARB_npot, no new texture targets where introduced. Instead, you can now use all "old" texture targets with npot-sized images without getting errors.
Please read the specs:
http://oss.sgi.com/projects/ogl-sample/registry/ARB/texture_non_power_of_two.txt

Share this post


Link to post
Share on other sites
Normally in OpenGL your textures need to have sizes of powers of 2 (16, 32, 64, 128, etc) to be used in your game.

With the ARB_texture_non_power_of_two you now have the option to use other dimensions for your texture (as long as it stays rectangular). Meaning you can then have textures with dimensions like 257 or 148, etc. Make sure though that the videocard support the extension before using it.

EDIT: you can still use the GL_TEXTURE_2D as it has to do with the loading of your texture, if I am not mistaken.

Share this post


Link to post
Share on other sites
That's the thing ... Am I supposed to enable something, or should odd sizes work right away?


(I'm running a gf6600 card, ogl 1.5)

Share this post


Link to post
Share on other sites
If the extension is listed in the list of extensions you get from Open GL, it's supported, otherwise you've gotta stick with the old power-of-two textures.

Share this post


Link to post
Share on other sites
Anyone know if it's slower, or anything like that, to use non power of two textures?

Share this post


Link to post
Share on other sites
Well the obvious question is how the hell is mipmapping done without power of 2 textures...I was under the impression power of 2 textures existed because their dimensions are always divisible by 2 for mip mapping...

Share this post


Link to post
Share on other sites
@MrLane:

for mipmapping issues and faster computing. Power of two values are easier to
compute with/handle for processors.

But the question which cames up then for me is:
theoretically it should be a little bit slower - has anyone alread done some
tests on this new extension ?

Share this post


Link to post
Share on other sites
i belive NPOT textures are a bit slower to use, simple because the gfx card cant perform the same optermisations it can apply with a POT texture, however the speed hit shouldnt be that big so if you need 'em use 'em.

Share this post


Link to post
Share on other sites
Quote:
Original post by Mr Lane
Well the obvious question is how the hell is mipmapping done without power of 2 textures...I was under the impression power of 2 textures existed because their dimensions are always divisible by 2 for mip mapping...

Read the specification the AP above posted. Issue 6 answers that question.

Nothing is changed really; mipmaps are halved all the way down to size 1, just like power of two textures. In the case of an odd size, the next size is rounded down. For example, the size 123 gets halved to 61, 30, 15, 7, 3 and finally 1.

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!