PDA

View Full Version : Render to L16F & LA16F texture using FBO on ATI



SKoder
05-29-2006, 02:05 PM
Hello,
I've encountered problems with this formats on my Radeon9800pro card.

In D3D it is possible to render to R16F and RG16F format render targets. The analog in OGL seems to be INTENSITY_FLOAT16_ATI & LUMINANCE_ALPHA_FLOAT16_ATI texture formats.

But when I attach this type of texture to FBO, I get GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT error.

Is this an driver problem, or I'm forgetting something?
Any ideas?

ebray99
05-29-2006, 02:17 PM
Single and double channel render targets are currently not supported in OpenGL via FBO. This is an unfortunate weakness in the current spec. NVidia have support for some of them via GL_NV_float_buffer, but that requires the using a texture rectangle (integer texture addressing). I've heard that the ARB is working to fix this limitation. Anyone associated w/ GL care to verify?

Kevin B

gybe
05-30-2006, 08:15 AM
I cannot understand why it's so long to support those formats with the current extension. I think the extension is fine, they just need to implement rendering to those formats.

yalmar
05-30-2006, 08:57 AM
In ATI cards, GL_TEXTURE_2D with GL_RGBA_FLOAT16_ATI or GL_RGBA_FLOAT32_ATI may be used, it should be attached to FBO, see the next code:

// initialize textures
glBindTexture(GL_TEXTURE_2D, tex[i]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA_FLOAT32_ATI, vImageWidth, vImageHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);

// bind the FBO to attach the textures
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);

// attach the color buffer 0
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, tex[i], 0);

NOTE: It does not work as NV_TEXTURE_RECTANGLE, but on OpenGL 2.0 NPOT textures are supported. Then in this case, NV_TEXTURE_RECTANGLE can be replaced by some MxM texture. For more information see the next reference
http://www.mathematik.uni-dortmund.de/~goeddeke/gpgpu/tutorial.html#arrays3

Humus
05-30-2006, 03:53 PM
We have single and dual channel support working. You should have this in public driver within a few months.

SKoder
06-04-2006, 03:49 AM
yalmar
This won't help me.
See post #1

Humus
Good, but it will be too late for me

Thanks!

flamz
06-07-2006, 09:23 AM
While we are on the ATI subject :)

When are they going to support PBOs!