View Full Version : GL_RGBA32F_ARB and FBOs
Thomahawk
19-Oct-2007, 13:43
Hi,
Are the MRTs of my FBO restricted to 8-bit per channel max, like my window pixel format?
-Thomas
codelogic
20-Oct-2007, 01:06
As long as all the targets have the same dimension and bit depth, you should be good to go. MRT targets don't have to match window pixel format.
Thomahawk
27-Oct-2007, 04:55
I'm not asking for someone to debug my code, just give me advice if you can hear any pitfalls in my explanation:
I use an FBO with 4 RGBA8 render targets for deferred shading - {color, normal, depth, inshadow}. At 8bits, 'depth' doesn't give me enough precision. When I try to change it to a {RGBA8, RGBA8, GL_LUMINANCE32F, RGBA8}, I get a black screen. When I change to {RGBA32F, RGBA32F, RGBA32F, RGBA32F} I get a black screen and 1 fps.
I just can't seem to find any example source of floating point MRTs in opengl. I have my min/max filter set to nearest, and I have my type set to GL_FLOAT. Maybe I'm trying to do something impossible in openGL?
Well, you can't mix different formats with FBOs. This is different from DX where it's OK to mix formats as long as they have the same bitdepth. This restriction might get relaxed in an extension or future OpenGL version, but I haven't kept up to date on this to be honest.
4xRGBA32F should work though. The obvious things to look for is to make sure you disable filtering, blending, don't specify any mipmaps and supply the right type and format to glTexImage2D(). Do you need filtering for that depth btw? If not, you may want to consider just packing it into an RGBA8 FBO and unpacking it when you read from it.
Chris Lux
31-Oct-2007, 09:04
i did some deferred shading tests lately on a G80 platform using OpenGL. i was able to mix different formats of different overall bitdepth in one MRT, so it may be possible that this restriction went away on at least the G80 platform.
In hardware it went away with the DX10 cards, however, the spec has not changed.
The framebuffer object <target> is said to be "framebuffer complete"
if it is the window-system-provided framebuffer, or if all the
following conditons are true:
...
<snip>
...
* All images attached to the attachment points
COLOR_ATTACHMENT0_EXT through COLOR_ATTACHMENTn_EXT must have
the same internal format.
{ FRAMEBUFFER_INCOMPLETE_FORMATS_EXT }
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.