I'm trying to figure out how to specify a BGR 8 bit texture.
I've tried the following combinations (allowed), but all render with wrong colors:
- Internal format: RGB; Format: RGB; Data Type: UNSIGNED_BYTE_3_3_2;
- Internal format: RGB; Format: RGB; Data Type: UNSIGNED_BYTE_2_3_3_REV;
I've tried the following combinations, all with the INVALID_OPERATION error:
- Internal format: RGB; Format: BGR; Data Type: UNSIGNED_BYTE_3_3_2;
- Internal format: RGB; Format: BGR; Data Type: UNSIGNED_BYTE_2_3_3_REV;
- Internal format: RGB; Format: BGR; Data Type: UNSIGNED_BYTE_3_3_2;
- Internal format: RGB; Format: BGR; Data Type: UNSIGNED_BYTE_2_3_3_REV;
Other not working tries:
- Internal format: R3_G3_B2; Format: RGB; Data Type: UNSIGNED_BYTE_3_3_2; (wrong color)
- Internal format: R3_G3_B2; Format: RGB; Data Type: UNSIGNED_BYTE_2_3_3_REV; (wrong color)
- Internal format: R3_G3_B2; Format: BGR; Data Type: UNSIGNED_BYTE_3_3_2; (invalid op)
- Internal format: R3_G3_B2; Format: BGR; Data Type: UNSIGNED_BYTE_2_3_3_REV; (invalid op)
Is it possible to have a BGR format for a 8 bit color representation?
I think that "Internal format: RGB; Format: RGB; Data Type: UNSIGNED_BYTE_2_3_3_REV;" should work, but actually give the same (wrong) colors than "Internal format: RGB; Format: RGB; Data Type: UNSIGNED_BYTE_3_3_2;"... isn't it strange?
Edit:
The man page of glTexImage2D say:
GL_INVALID_OPERATION is generated if type is one of GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, GL_UNSIGNED_SHORT_5_6_5, or GL_UNSIGNED_SHORT_5_6_5_REV and format is not GL_RGB.
Indeed format should be GL_RGB. But so why GL_UNSIGNED_BYTE_2_3_3_REV doesn't give the correct result?