GL_ALPHA, GL_LUMINANCE
Asked Answered
L

1

9

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.

Lilla answered 25/3, 2013 at 15:12 Comment(0)
M
8

Are those formats deprecated with GL 4.0

Yes, they are.

Marieann answered 25/3, 2013 at 15:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.