I render some lines with alpha values into an FBO. Because I play a lot with alpha, I need the alpha channel to have more detail than RGBA8. For example, RGBA32F works like a charm.

As I have only a Quadro GPU to test. Is there a general advice on which FBO format works best (in terms of speed) on most cards?

  1. Would there be a benefit in using RGBA16F, RGBA16 etc.?
  2. What formats can I expect a GPU to support?
  3. Is RGBA32F a regular feature for a GPU not older than 5 years?
  • 2
    \$\begingroup\$ Do you actually have any performance problems on your target hardware? If not, don't worry. The only way to know for sure about performance is to actually profile your app and gets real metrics on target hardware. In general, though, performance is enhanced by minimizing the fillrate bytes, which means amongst other things using the "smallest" FBO you can get away with. \$\endgroup\$ – Sean Middleditch May 12 '13 at 0:30
  • \$\begingroup\$ Well, I draw incrementally because drawing takes up to two seconds, so, yes. But I also need profiling. \$\endgroup\$ – ypnos May 12 '13 at 2:00

In general, yes, there will often be a performance benefit to using "thinner" (fewer bytes per pixel) FBO formats. It depends on the details of your hardware and how you're using the buffers, but it's quite common for performance to be memory-bandwidth-limited for at least part of the graphics frame (postprocessing, for instance). In that case, a thinner FBO format means a smaller amount of memory to access, which means it'll be faster.

Assuming you only need the extra precision for the alpha channel, but not the color channels, it's also possible on recent GPUs to use multiple render targets (MRT) with an 8-bit format for the RGB and a second, separate render target in single-channel R16F or R32F format for the alpha. (Your shaders would have to be altered to output the alpha to the second render target.) That might be a performance gain too, especially if you need to perform postprocessing operations on the alpha channel alone - it'll be faster to read and write if the alpha is in a buffer by itself.

As for which formats are supported, any GPU supporting Direct3D 10 or 11 (which is probably most of the discrete desktop GPUs sold in the last 5 years, but not integrated or mobile GPUs) should support RGBA16, RGBA16F, and RGBA32F. However, the oldest GPUs within that 5-year time frame might not support bilinear filtering or mipmaps for RGBA32F, although they should support it for RGBA16F.

All in all, RGBA8 is generally going to be the fastest format, but if RGBA8 isn't doing it for you due to precision or range problems then I'd recommend trying out RGBA16F. It has broader support than RGBA32F, is quite possibly faster as well, and probably gives plenty of precision for whatever you're doing.

  • \$\begingroup\$ Thank you very much. Currently I just render thousands of lines from a VBO directly into several FBOs. It sounds RGBA16F is the best choice for me now and in case my rendering gets more sophisticated I should take the chance and also use MRT. \$\endgroup\$ – ypnos May 11 '13 at 23:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.