Jump to content

  • Log In with Google      Sign In   
  • Create Account


GL: Portable non power of 2 textures?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 smitty1276   Members   -  Reputation: 560

Like
0Likes
Like

Posted 28 August 2006 - 05:16 AM

So, there are quite a few extensions for non-power of 2 textures, and it appears that they are all supported by either NV or ATI, but usually not both. Am I overlooking one that is widely supported on all video cards? Or do I need to actually pick the best extension for both cards and just check for the correct one to use?

Sponsor:

#2 darkprophet   Members   -  Reputation: 122

Like
0Likes
Like

Posted 28 August 2006 - 05:44 AM

ARB_Texture_Rectangle ?

#3 smitty1276   Members   -  Reputation: 560

Like
0Likes
Like

Posted 28 August 2006 - 06:16 AM

Well, according to this Delphi database of extentions, there is ARB_texture_rectangle, EXT_texture_rectangle, and NV_texture_rectangle. Obviously, the NV is an nvidia one. But the site also only lists NV cards as supporting ARB_texture_rectangle, and the EXT_texture_rectangle only lists ATI cards.

It this information incorrect? I was told that the DB is sometimes a bit outdated. Can ARB be safely used on a wide range of ATI cards as well as the NV cards?


#4 Yann L   Moderators   -  Reputation: 1794

Like
0Likes
Like

Posted 28 August 2006 - 06:17 AM

ARB_texture_rectangle is not widely supported by ATI yet, although it was added in the latest Catalyst drivers. Of course, it is not a real NPOT texture, since it cannot handle mipmapping, all wrapping modes, and uses non-normalized coordinates.

EXT_texture_rectangle is a little different from the ARB counterpart, in that it doesn't support GLSL bindings (ie. rectangle textures are not supported under GLSL, unless the ARB version is available).

ARB_texture_non_power_of_two is the real deal. It's currently only fully supported on newer nVidia cards, though. ATI kind of supports it, but not fully (that's why the extension is not officially advertised in GL_EXTENSION). But as long a you keep it without mipmaps, and with CLAMP_TO_EDGE wrapping, then NPOT textures are also supported on quite a large range of ATI cards (with normalized 0..1 coordinates).

#5 smitty1276   Members   -  Reputation: 560

Like
0Likes
Like

Posted 28 August 2006 - 06:41 AM

Thanks!

Okay, well, I definately need to be able to use it with GLSL. So I guess the ARB_texture_non_power_of_two is my best bet.

Quote:
Original post by Yann L
ARB_texture_non_power_of_two is the real deal. It's currently only fully supported on newer nVidia cards, though. ATI kind of supports it, but not fully (that's why the extension is not officially advertised in GL_EXTENSION). But as long a you keep it without mipmaps, and with CLAMP_TO_EDGE wrapping, then NPOT textures are also supported on quite a large range of ATI cards (with normalized 0..1 coordinates).


Not officially advertised in in GL_EXTENSION? Meaning there is no way to check for it? And how new are we talking about, with the newer NV cards? (I realized that the Delphi DB has the GL cards listed.)

#6 Yann L   Moderators   -  Reputation: 1794

Like
0Likes
Like

Posted 28 August 2006 - 06:51 AM

Quote:
Original post by smitty1276
Not officially advertised in in GL_EXTENSION? Meaning there is no way to check for it?

Well, NPOT textures are part of the core from OpenGL 2.0 on upwards. It is relatively safe to assume that OGL 2.0 compliant ATI cards (check GL_VERSION) will accept NPOT textures, as long as they respect the same limitations as with EXT_texture_rectangle (except for the fact that their coordinates are normalized, and that they are accessible from GLSL as normal 2D textures).


#7 smitty1276   Members   -  Reputation: 560

Like
0Likes
Like

Posted 28 August 2006 - 06:54 AM

Oh, okay. And, if the card is slightly older (pre OGL 2.0) will this be implemented in software, or is the version something I need to definately make sure of before using them?

#8 Yann L   Moderators   -  Reputation: 1794

Like
0Likes
Like

Posted 28 August 2006 - 07:04 AM

Quote:
Original post by smitty1276
Oh, okay. And, if the card is slightly older (pre OGL 2.0) will this be implemented in software, or is the version something I need to definately make sure of before using them?

If they're not supported, NPOT texture creation will either fail or trigger a fallback to software rendering (implementation and version dependent).

AFAIK, ATI cards have inofficially supported these pseudo-NPOT textures for a long time, since their hardware can inherently handle NPOTs with normalized coordinates (but not with mipmaps & co). Supporting texture rectangles had in fact been a major hassle for them, because they needed to emulate the non-normalized coordinates by inserting additional multiplication opcodes into the shader. So ironically pseudo-NPOTs are probably faster on ATI hardware than EXT_texture_rectangle and friends...

But yes, you should definitely check for either OGL >= 2.0 or ARB_texture_non_power_of_two before using NPOTs. Be careful about the limitations on ATI hardware if ARB_npot is not supported, though. Enabling repeat wrapping, for example, will drop you to software rendering mode (ie. welcome to the happy land of 1 fps)...

Eventually, ARB_texture_non_power_of_two will be fully supported on ATI as well, and make texture rectangle totally obsolete (finally).




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS