PDA

View Full Version : FBO + GL_LUMINANCE



flamz
04-23-2008, 10:47 AM
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_LUMINAN CE, 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?

-NiCo-
04-23-2008, 10:49 AM
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.

vs987
05-02-2008, 01:54 AM
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

Eosie
05-02-2008, 04:24 AM
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.

Jackis
05-05-2008, 10:44 AM
On nv30 and nv40 luminance formats are not supported to be render targets.

-NiCo-
05-05-2008, 11:13 AM
FYI, you can download a small program here (http://www.vis.uni-stuttgart.de/~klein/fboCheckSupported.tar.gz) that generates a list of supported FBO formats.