Does OGL ES 2.0 supports non-power-of-two texture?

1,375 views
Skip to first unread message

arhold

unread,
Apr 2, 2010, 6:02:41 PM4/2/10
to android-ndk
I thought the non-power-of-two texture is supported byOGL ES 2.0.
Please correct me if I'm wrong.

So I used the NDK r3 to build a opengl es 2.0 test app, which simply
tried to render a non-power-of-two texture. However, it doesn't work
for me. The same test app works fine if I change to a power-of-two
texture. I tested on Motorola Droid with Android 2.0.1.

Any idea? Thanks in advance.

Best,
Ronghua

Robert Green

unread,
Apr 2, 2010, 6:11:30 PM4/2/10
to android-ndk
It's not GL that would have an issue with it but the hardware.

arhold

unread,
Apr 2, 2010, 6:15:46 PM4/2/10
to android-ndk
Thanks for the reply.

So any way to confirm the hardware's capability of rendering a non-
power-of-two texture?

And any phone in the market supports this?

Tristan Miller

unread,
Apr 2, 2010, 6:28:46 PM4/2/10
to andro...@googlegroups.com

It'll should be in the list of extensions.  For instance the Droid supports it with the GL_IMG_texture_npot extension.  Not sure about the others; I don't have that hardware in front of me.

Tristan Miller

On Apr 2, 2010 6:15 PM, "arhold" <arh...@gmail.com> wrote:

Thanks for the reply.

So any way to confirm the hardware's capability of rendering a non-
power-of-two texture?

And any phone in the market supports this?


On Apr 2, 3:11 pm, Robert Green <rbgrn....@gmail.com> wrote:

> It's not GL that would have an issue...

arhold

unread,
Apr 2, 2010, 6:49:10 PM4/2/10
to android-ndk
Yes, I'm using Droid too. I do have the "GL_IMG_texture_npot" in the
list. So maybe something wrong with my test app. Anything I should
enable/config before I can use this feature?


GL Extensions = GL_OES_rgb8_rgba8 GL_OES_depth24
GL_OES_vertex_half_float GL_OES_texture_float
GL_OES_texture_half_float GL_OES_element_index_uint GL_OES_mapbuffer
GL_OES_fragment_precision_high GL_OES_compressed_ETC1_RGB8_texture
GL_OES_EGL_image GL_OES_required_internalformat GL_OES_depth_texture
GL_OES_get_program_binary GL_OES_packed_depth_stencil
GL_OES_standard_derivatives GL_EXT_multi_draw_arrays
GL_EXT_texture_format_BGRA8888 GL_IMG_shader_binary
GL_IMG_texture_compression_pvrtc GL_IMG_texture_stream2
GL_IMG_texture_npot GL_IMG_texture_format_BGRA8888 GL_IMG_read_format
GL_IMG_program_binary GL_IMG_vertex_array_object

arhold

unread,
Apr 2, 2010, 7:35:05 PM4/2/10
to android-ndk
http://www.khronos.org/registry/gles/extensions/OES/OES_texture_npot.txt
There were specific rules added for non-power of two textures i.e. if
the texture wrap mode is not CLAMP_TO_EDGE or minification filter is
not NEAREST or LINEAR and the texture is a non-power of two texture,
then the texture would be marked as incomplete.

After add below two lines, the npot texture is working for me on Droid
now. Thanks all for replying.

glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
GL_NEAREST );
glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,
GL_NEAREST );
+ glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,
GL_CLAMP_TO_EDGE);
+ glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T,
GL_CLAMP_TO_EDGE);

Reply all
Reply to author
Forward
0 new messages