Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In OpenGL what's the difference between the GL_RED and GL_R color formats?

When loading in a single channel 8 byte texture my renderer works only with GL_RED. It took me a while to figure out GL_R doesn't work for me. I couldn't get an explanation of what it is.

like image 971
Zebrafish Avatar asked Jan 04 '23 20:01

Zebrafish


1 Answers

The is no GL_R color format, hence one cannot describe its differences to GL_RED.

The GL_R enum is totally invalid for any use as a color format, and does not mean "red". This enum is part of the four enums GL_S, GL_T, GL_R, GL_Q, which are the symbolic names for the four-dimensional texture coordinates in the GL. Note that this enum was used to specify the old fixed-function texture coordinate generation (see for example glTexGen()), which is deprecated nowadays. As a result, the GL_R enum does not even exist in modern OpenGL at all (so you find it in the legacy gl.h, but for example not in glcorearb.h).

like image 115
derhass Avatar answered Jan 07 '23 09:01

derhass