Jump to content
  • Advertisement
Sign in to follow this  
maxphil

NPOT with GL_ARB_texture_npot

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

Hi there, [Smile] I'm trying to load a "npot" bitmap into a GL_ARB_texture_non_power_of_two texture, but it's not working. I'm confused about normalizing "glTexCoord2i" coordinates and some other stuff as you can see in the file below. *MSV 2003 project http://www.inf.ufsc.br/~vilsonhj/tex_map_npot_arb.rar Do i have to "enable" this kind of texture and then bind it? Like: glEnable(GL_ARB_texture_non_power_of_two); glGenTextures(1, &g_texture1); glBindTexture(GL_ARB_texture_non_power_of_two, g_texture1); ? Can somebody help me?

Share this post


Link to post
Share on other sites
Advertisement
You seem to mix up GL_ARB_texture_rectangle and GL_ARB_texture_non_power_of_two.

The latter Extension allows you to use NPOT textures as you know it from POT textures without changing anything in the code. It is just a change of the specifications, no new constants or functions are introduced.

The other one, GL_ARB_texture_rectangle, is much more widly supported, but has restrictions you already spoke about, like unnormalised Texture Coordinates and no mipmaps.

Please let us know if you ment to use the rectangle extension and need more information about it.

Share this post


Link to post
Share on other sites
Quote:
Original post by maxphil
I'm confused about normalizing "glTexCoord2i" coordinates
If I remember correctly, this is not normalized so 2 really means 2 textures away... I'm not sure however, I used it only a few times.

Quote:
Original post by maxphil
Do i have to "enable" this kind of texture and then bind it? Like:

glEnable(GL_ARB_texture_non_power_of_two);
glGenTextures(1, &g_texture1);
glBindTexture(GL_ARB_texture_non_power_of_two, g_texture1);


No. It just takes Bind(TEXTURE_2D, texture1); as normal.
As said, texture rectangles do have their own target, ARB_npot is a drop-in replacement.

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!