[Public WebGL] NPOT (non-power-of-two) textures
Thu Jan 14 11:52:07 PST 2010
On Thu, Jan 14, 2010 at 10:48 AM, Chris Marrin <[email protected]> wrote:
> OpenGL supports NPOT textures in two ways. The first is called "Rectangle Textures" (RT), which can be any size, but can't be repeating, mip-mapped or have borders. And rather than using 0-1 texture coordinates, they use 0-w, 0-h. OpenGL Also supports true NPOT textures, which have similar constraints to RT, but which use the normal 0-1 texture coordinates.
> The issue is that some older hardware (and when I say "older" I mean hardware from 2005) only supports RT, not true NPOT. It's not possible to emulate NPOT when you just have RT support because in GLSL you use a different sampler for RT (sampler2DRect vs sampler2D).
> OpenGL ES only supports NPOT, not RT. So does that mean we leave these older cards in the cold? The only options I see are:
> 1) Add optional support (as some sort of queryable extension) for RT (ick!)
> 2) Remove support for any type of NPOT from WebGL (double ick!)
> 3) Leave these older cards in the dust.
> Now, I can say that using NPOT on a Mac with one of these older cards still works, it just uses software rendering and is therefore much slower.
A WebGL implementation can scale up NPOT texture data to the next
highest power of two dimension during texImage2D and texSubImage2D
calls. This wouldn't involve any API changes. O3D does this in some
cases as proof that the technique can work without the end user
knowing. I think it would be a bad idea to expose rectangular textures
in the WebGL API; they are definitely not the path forward.
You are currently subscribe to [email protected]
To unsubscribe, send an email to [email protected] with
the following command in the body of your email:
More information about the public_webgl