FBO + GL_LUMINANCE

Hi, I have an FBO setup with a color attachment of type GL_LUMINANCE - GL_UNSIGNED_BYTE. I setup the texture this way:



glTexImage2D(GL_TEXTURE_RECTANGLE_ARB,0,GL_LUMINANCE, 100 , 200, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, NULL);


Then setup a renderbuffer with GL_DEPTH_COMPONENT24.

This FBO setup fails (missing color/buffer attachment).

Works fine if I change everything to GL_RGBA, GL_UNSIGNED_BYTE.

Any ideas?

The problem is that luminance textures aren’t color-renderable, so the FBO is not complete.

  • The following base internal formats from table 3.15 are
    “color-renderable”: RGB, RGBA, FLOAT_R_NV, FLOAT_RG_NV,
    FLOAT_RGB_NV, and FLOAT_RGBA_NV. The sized internal formats
    from table 3.16 that have a color-renderable base internal
    format are also color-renderable. No other formats, including
    compressed internal formats, are color-renderable.

on a geforce 6/7 rendering to GL_LUMINANCE or GL_LUMINANCE_ALPHA did not work

on a geforce 8 it does, it takes the red component for luminance

no idea about other cards

I would not bet on the specification. On ATI, the FBO is complete when one of these formats is attached to it: http://www.fi.muni.cz/~xolsak/fbo_atix1700.txt
I’ve tried a few of them (LUMINANCE16F, LUMINANCE_ALPHA16F, LUMINANCE32F, LUMINANCE_ALPHA32F) and it worked. It takes the red component for luminance too.

On nv30 and nv40 luminance formats are not supported to be render targets.

FYI, you can download a small program here that generates a list of supported FBO formats.