Igor Yarmolyk
Igor Yarmolyk

Reputation: 77

glTexStorage2D for alpha texture in OpenGL ES 3.0?

In OpenGL ES 2.0 when GL_EXT_texture_storage extension is available i use glTexStorage2DEXT(GL_TEXTURE_2D, 1, ALPHA8_EXT, width, height) to specify immutable storage for alpha mask textures. In OpenGL ES 3.0 glTexStorage2D is incorporated into the core specification, so no extension is needed. But it looks like there's no sized internal alpha format in OpenGL ES 3.0. How to do this in new version of OpenGL?

Upvotes: 0

Views: 466

Answers (1)

solidpixel
solidpixel

Reputation: 12139

An alpha texture is just an 8-bit unorm, so upload using GL_R8. This will load via the "red" channel in the shader, but I assume your shader logic can cope with that.

Upvotes: 1

Related Questions