Jump to content
  • Advertisement
Sign in to follow this  

Texture Rectangle

This topic is 4346 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 I'm trying to support in my code all hardware-supported forms of nonpow2 texturing, including texture rectangle. The problem is that its invading my code. The difference in binding the texture and the non normalised coordinates are the culprits. Nonpow2 is easy! But I think I want to support texture rectangle. I plan on making everything a texture rectangle if nonpow2 is not supported. Is this a good idea? I'm thinking the solution to my binding problem would be to have a global GLenum OGL_BIND = GL_TEXTURE_2D; glBind( OGL_BIND, ... ); Of course the problem with getting texel width from tex coordinates could probably be wrapped up in a function that does the necessary checking if we are using texture rectangles. If I need to get around the limitations of texture rectangle I would have to use a normal texture and maybe store a variable for each texture saying whether it was a texture rectangle. arg... Otherwise I could skip texture rect altogether and just drop down to pow2, scaling or padding as needed. I'm making a 2D game so it has the possibility of having ~75% of used video memory being wasted (think 257x257 texture).

Share this post


Link to post
Share on other sites
Advertisement
I don't know why you would need NPOT textures for artwork? Now RTT I can see, heightmaps I can see, but tiles, or other textures that one can get by with POT should be used as POT textures. You could use gluBuild2DMipmaps() to rescale the NPOT textures for your IQ won't be as good but probably good enough for what you maybe doing...

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!