some minor differences between GL and gles standards are often maddening, originally on the PC, a good, a transplant on the messy, texture as the important part of the standard is worth exploring, glteximage2d as a hot interface function almost accompany you for a lifetime, the following to analyze.
The author encounters the following anomalies when drawing textures with GLES2.0:
The correct effect after correction is as follows:
Error tracking after the discovery is glteximage2d throw gl_invalia_operation error, and then the author urgently consult the gles2.0/gl4.5 spec, found the cause of the problem occurred.
gles2.0 Spec:
void Glteximage2d (Glenum target,glint level,glint internalformat,glsizei width,glsizei height,GLint border,GLenum Format,glenum type,const glvoid* data);
For some of the above parameters, the only thing that might be understood is that the Internalformat and Format,spec give a description
Internalformat-This format refers to the texture data format on the internal GPU
Specifies the internal format of the texture.
Must be one of the following symbolic constants:
Gl_alpha, Gl_luminance, Gl_luminance_alpha,gl_rgb, Gl_rgba
Format-This format refers to the form of data that is passed in and must be matched to Internalformat, which must be tested and found to be the same as Internalformat
Specifies the format of the Texel data. Must match Internalformat.
The following symbolic values are Accepted:gl_alpha, Gl_rgb, Gl_rgba,
Gl_luminance,and Gl_luminance_alpha
A clearer explanation is also given-
Two formats must be consistent and not supported for different format conversions during texture processing
Notes
Internalformat must match format.
No Conversion between formats is supported during texture image processing.
Type may being used as a hint to specify what much precision is desired,
But a GL implementation could choose to store the texture array at any internal resolution it chooses. gl4.5 Spec:
Internalformat and format and gles2.0 mean the same thing, just a lot of different formats, and compressed compression format
Support for different format conversions during texture processing, details of each format usage are self-consulted by the spec