PDA

View Full Version : FBO vs back-buffer?



ugluk
01-01-2010, 10:31 AM
I've seen/read that some apps render into the back-buffer and then transfer the back-buffer contents into a texture for rendering-into-a-texture approach. Are there any cons to doing this?

zeoverlord
01-01-2010, 12:06 PM
Yea what your describing is basically the old method of doing render-to-texture, while FBO allows you to do it directly without the transfer stage (which often meant stalling the CPU), hence FBOs are faster.

overlay
01-01-2010, 12:16 PM
Also using the back-buffer is not reliable as if the window is partially covered by another window, the pixel ownership test fails and you get garbage in the covered area. On FBOs, the pixel ownership test always passes.

ugluk
01-01-2010, 02:40 PM
Is it possible to disable the pixel ownership test? Maybe then the method would still work?

Alfonse Reinheart
01-01-2010, 03:18 PM
Is it possible to disable the pixel ownership test?

No. The most you could do is create an off-screen pBuffer.


Maybe then the method would still work?

Even if it did, you still have sizable performance penalties compared to the rest.

All D3D 9-capable hardware supports EXT_FBO. According to the Steam Hardware Survey, about 5.66% of Steam users have D3D 8 or below; that means almost 95% of gamers have access to EXT_FBO.

Ketracel White
01-04-2010, 06:21 AM
Yea what your describing is basically the old method of doing render-to-texture, while FBO allows you to do it directly without the transfer stage (which often meant stalling the CPU), hence FBOs are faster.


This is just not correct when you state it this generally.

I have a case where I get reliably better performance with the backbuffer as opposed to FBO. Only when the rendered screen gets larger the FBO becomes faster.

Do not forget that switching from the screen buffer to an external frame buffer is not a cheap operation so the end result very much depends on whether copying from the backbuffer is faster than changing the render state twice. In general FBO is the recommended method though because it's just more flexible and less prone to problems.

zeoverlord
01-04-2010, 05:16 PM
This is just not correct when you state it this generally.

I have a case where I get reliably better performance with the backbuffer as opposed to FBO. Only when the rendered screen gets larger the FBO becomes faster.

Do not forget that switching from the screen buffer to an external frame buffer is not a cheap operation so the end result very much depends on whether copying from the backbuffer is faster than changing the render state twice.

Sure if the size is small enough and the render load is low enough that rendering completes instantly, then switching to a FBO might become slower then copying from the backbuffer, just don't expect that to happen, ever, and if it does then it's not really a problem, unless you use it in a stupid way that is.

Ketracel White
01-05-2010, 04:05 AM
I'm using it for thumbnail textures that rarely get larger than 256x256 and with that size FBO is consistently slower, even with more complex scenes. With 512x512 it's approximately even and sure, anything resembling a full screen is clearly better as FBO.