NPOT Texture: Difference between revisions
m Categorizing. |
Article rewrite. |
||
Line 1: | Line 1: | ||
{{infobox feature | |||
| name = Non-Power-Of-Two Textures | |||
= | | core = 2.0 | ||
| arb_extension = [http://www.opengl.org/registry/specs/ARB/texture_non_power_of_two.txt GL_ARB_texture_non_power_of_two] | |||
}} | |||
http://www.opengl. | |||
'''NPOT Textures''' are textures whose dimensions are not powers of 2 ('''N'''on-'''P'''ower-'''O'''f-'''Two'''). In earlier hardware, there was a requirement that the dimensions of a texture were a power of two in size. NPOT textures are textures that are not restricted to powers of two. | |||
== Usage == | |||
Using this is easy; simply pass arbitrary sizes to the various <code>glTexImage*</code> functions. These will work for any kind of texture, from cubemaps to array textures. | |||
While modern hardware no longer has the power-of-two limitation on texture dimensions, it is generally not a good idea to use it unless you specifically ''need'' it. Mip-mapping with such textures can have slightly unintended consequences, compared to the power-of-two case. | |||
Render targets are a common format where you want to have a specific, arbitrary size for your textures. | |||
=== Compression === | |||
Most of the non-generic [[Image Formats#Compressed formats|compressed texture formats]] are based around 4x4 blocks of pixels. While it is possible to have arbitrary sizes of these textures, you generally should keep them at a multiple of four in size. | |||
=== Older hardware === | |||
The R300 and R400-based cards (Radeon 9500+ and X500+) are incapable of generic NPOT usage. You can use NPOTs, but only if the texture has no mipmaps. | |||
NV30-based cards (GeForce FX of any kind) are incapable of NOPTs at all, despite implementing OpenGL 2.0 (which requires NPOT). It will do software rendering if you try to use it. | |||
All newer hardware can handle NPOTs of any kind perfectly. | |||
== Rectangle Textures == | |||
{{main|Rectangle Textures}} | |||
Rectangle textures have never had a power-of-two restriction. However, they take texture coordinates in texture space rather than normalized texture coordinates like other kinds of textures. These have their uses, but they have fallen out of disfavor with the advent of generic NPOT textures. | |||
[[Category:Textures]] | [[Category:Textures]] |
Revision as of 21:12, 15 September 2009
Core in version | 4.6 | |
---|---|---|
Core since version | 2.0 | |
ARB extension | GL_ARB_texture_non_power_of_two |
NPOT Textures are textures whose dimensions are not powers of 2 (Non-Power-Of-Two). In earlier hardware, there was a requirement that the dimensions of a texture were a power of two in size. NPOT textures are textures that are not restricted to powers of two.
Usage
Using this is easy; simply pass arbitrary sizes to the various glTexImage*
functions. These will work for any kind of texture, from cubemaps to array textures.
While modern hardware no longer has the power-of-two limitation on texture dimensions, it is generally not a good idea to use it unless you specifically need it. Mip-mapping with such textures can have slightly unintended consequences, compared to the power-of-two case.
Render targets are a common format where you want to have a specific, arbitrary size for your textures.
Compression
Most of the non-generic compressed texture formats are based around 4x4 blocks of pixels. While it is possible to have arbitrary sizes of these textures, you generally should keep them at a multiple of four in size.
Older hardware
The R300 and R400-based cards (Radeon 9500+ and X500+) are incapable of generic NPOT usage. You can use NPOTs, but only if the texture has no mipmaps.
NV30-based cards (GeForce FX of any kind) are incapable of NOPTs at all, despite implementing OpenGL 2.0 (which requires NPOT). It will do software rendering if you try to use it.
All newer hardware can handle NPOTs of any kind perfectly.
Rectangle Textures
Rectangle textures have never had a power-of-two restriction. However, they take texture coordinates in texture space rather than normalized texture coordinates like other kinds of textures. These have their uses, but they have fallen out of disfavor with the advent of generic NPOT textures.