The difference between the three single-component texture formats, GL_ALPHA, GL_LUMINANCE and GL_INTENSITY, is in the way the four-component RGBA color vector is generated. If the value for a given texel is X, then the RGBA color vector generated is:
* GL_ALPHA: RGBA = (0, 0, 0, X)
* GL_LUMINANCE: RGBA = (X, X, X, 1)
* GL_INTENSITY: RGBA = (X, X, X, X)
In other words, if we interpret the alpha as transparency, GL_ALPHA would represent a completely black texture with varying transparency, GL_LUMINANCE is an opaque texture with varying color (a grayscale image), and GL_INTENSITY is a combination where both the color and alpha channel is varying.
glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, nWidth, nHeight, 0, GL_ALPHA, GL_UNSIGNED_BYTE, data);
查出 之前有一个glPixelStorei是错误根源, 当前的GL_PACK_ALIGNMENT,GL_UNPACK_ALIGNMENT,GL_UNPACK_ROW_LENGTH值会影响外部data最终到达纹理的方式,特别是GL_UNPACK_ROW_LENGTH!!!