Вопрос

I'm trying to bind a texture that I want to interpret as either Alpha, Luminance or Intensity. I'm using OpenGL 4.0. I can bind them as GL_RED OK with no problems, i.e. :

glTexImage2D(   GL_TEXTURE_2D,
                i,
                GL_RED,
                mipSizeX,
                mipSizeY,
                0,
                GL_RED, 
                GL_UNSIGNED_BYTE, 
                nullptr);

However whenever I try to bind as GL_ALPHA, GL_LUMINANCE or GL_INTENSITY, I get an error 1280. Are those formats deprecated with GL 4.0, or am I doing something wrong? E.g. this fails:

glTexImage2D(   GL_TEXTURE_2D,
                i,
                GL_ALPHA8
                mipSizeX,
                mipSizeY,
                0,
                GL_ALPHA, 
                GL_UNSIGNED_BYTE, 
                nullptr);

EDIT: Ok as these formats are deprecated, this page contains tables showing what the valid formats actually are.

Это было полезно?

Решение

Are those formats deprecated with GL 4.0

Yes, they are.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top