Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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?
share|improve this question
2  
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. –  Sean Middleditch May 12 '13 at 0:30
    
Well, I draw incrementally because drawing takes up to two seconds, so, yes. But I also need profiling. –  ypnos May 12 '13 at 2:00
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
    
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. –  ypnos May 11 '13 at 23:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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