androidopengl-esgame-developmentgame-enginegles

Unable to find GL_INT_2_10_10_10_REV define on Android GLES


I'm currently working on an Android project that involves OpenGL ES development. However, I've encountered an issue where I can't seem to find the definition for GL_INT_2_10_10_10_REV when working with GLES on Android.

This definition is particularly useful for normal and tangent vertex storing due to its compact representation.

Is this define supposed to be available on Android GLES? If so, where can I find its definition or documentation? If not, what alternative approach should I consider for achieving the same functionality?

Any insights or guidance on this matter would be greatly appreciated. Thank you!

Checked the GLES headers included in my project, but couldn't locate the definition. Searched through the Android NDK documentation and OpenGL ES specifications but couldn't find any mention of GL_INT_2_10_10_10_REV.


Solution

  • OpenGL ES 2.0 does not support GL_INT_2_10_10_10_REV as vertex attribute data format, the definition of GL_UNSIGNED_INT_2_10_10_10_REV_EXT you found in GLES2/gl2ext.h is defined in extension GL_EXT_texture_type_2_10_10_10_REV and is valid only as texture type for TexImage2D or TexImage3D when this extension is available.

    However, OpenGL ES 2.0 with extension GL_OES_vertex_type_10_10_10_2 supports GL_UNSIGNED_INT_10_10_10_2_OES and GL_INT_10_10_10_2_OES vertex attribute data formats, so it can be used, if you can change packing of values.

    Still, support in OpenGL ES 2.0 requires some work to check extensions and some devices may not support required extensions. Because formats are supported only with extensions, their definitions are found in GLES2/gl2ext.h

    OpenGL ES 3.0 supports GL_INT_2_10_10_10_REV vertex attribute data format (also it's supported as texture data type) in basic specification, so it can be used for any devices with support of OpenGL ES 3.0 and its definition can be found in GLES3/gl3.h in NDK.