The difference between "opengl/es" and the No. 04 glteximage2d usage

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.