6
votes

I'm new to OpenGL ES in android development. I found two types of texture during my study:

  1. GL_TEXTURE_2D
  2. GL_TEXTURE_EXTERNAL_OES

I was told that they are not compatible with each other.

I have two questions:

  1. What's the difference between them? Are they completely different types of textures?
  2. Does GL_TEXTURE_EXTERNAL_OES texture has to be YUV format? If not, what decides the data format?
1

1 Answers

13
votes

What's the difference between them?

Normal textures are defined, allocated, and managed entirely by OpenGL ES.

External textures are defined and allocated elsewhere, and imported into OpenGL ES in some implementation-defined manner. One common use is for importing YUV video, so external samplers also have to be able to handle color-space conversion and non-standard memory layouts (e.g. multi-plane YUV surfaces).

Does GL_TEXTURE_EXTERNAL_OES texture has to be YUV format?

No. Some external entity in the system defines the format - it's invisible to the application, and color space conversion is magically handled by the driver stack. Exactly what formats are supported is implementation-defined.