I'm a little confused after running png gauntlet on some png texture assets. Previously all of them were either PNG_COLOR_TYPE_RGB
or PNG_COLOR_TYPE_RGBA
and therefore mapping them to the appropriate GL color format was simple enough. Full disclosure, I'm not a graphics master.
After running png gauntlet to optimize the textures, calling png_get_IHDR()
returns color type PNG_COLOR_MASK_ALPHA
and I'm a little confused as to whether or not this can map directly to a color format that I use when passing to glTexImage2D()
.
The particular texture image that behaves this way is a sprite mostly composed of whites and grays with varying alpha values. My best guess here is that the optimization determined it was some kind of gray scale with alpha and therefore I need to detect this in my texture loading code.
I would think that perhaps the appropriate color type would be GL_LUMINANCE_ALPHA
, since it's the one that uses the luminance value as the R,G, and B components, which would essentially be gray scale with an alpha channel.