OpenGL frame buffer objects patch

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
Post Reply
mandrav
Posts: 117
Joined: Sat Aug 27, 2005 8:29 pm
Contact:

OpenGL frame buffer objects patch

Post by mandrav »

This patch adds support for frame buffer objects (FBO) in the OpenGL driver.
FBOs are the new way for creating off-screen render targets. When you call driver->createRenderTargetTexture() to create a new render target, this patch creates it as a FBO if supported by the target system or else it uses the existing implementation.

Major advantage of using FBOs as render targets (besides a small speed increase) is that you 're no longer limited to the window size for render targets.
As you might already know, using the existing Irrlicht render targets, the maximum render target size can't exceed the size of the render window. So, for example, if your render window is 640x480, the render target can't be more than 256x256 (nearest power-of-two).
FBOs don't have such a limitation :).

Although I 'd like to create a new interface for render targets (e.g. IRenderTarget), it 's not currently necessary. It will be though, if we want to exploit the full power of FBOs (like multiple render targets in the same FBO etc.).
The bottom line is that there are no interface-breaking changes in this patch. Just apply it, compile and go on with your coding life :).

Download here (improved version with stencil buffer).

Enjoy,
Yiannis.
Last edited by mandrav on Fri Oct 20, 2006 7:41 pm, edited 1 time in total.
CuteAlien
Admin
Posts: 9643
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: OpenGL frame buffer objects patch

Post by CuteAlien »

mandrav wrote: EDIT: download removed (seems like no one is interested).
It would be nice if you would add the download again. Not everyone interested does also comment on it or maybe the people interested in it will arrive later on ;-). I thought it interesting - but currently i've just no time yet to really check it out.
mandrav
Posts: 117
Joined: Sat Aug 27, 2005 8:29 pm
Contact:

Post by mandrav »

Updated the download link in the first post. It now contains the improved patch with stencil buffer support.
Post Reply