Yea, well since my graphics engine is designed for a multitude of purposes (Games, Offline Renderer, Realtime Broadcast Graphics, etc) it needs to be as flexible as possible.
So, I've just implemented Frame Buffer Objects in the engine. Basically, I have a Camera class (cRenderer) that has an output, up until this point the output has always gone to a screen. This has changed now a Frame Buffer Object.
What this means is that I can assign Shaders on a per-model object for effects/lighting etc on a model-by-model basis. But I can now assign a Shader to the Output FBO of the Camera for full-screen effects (such as SSAO, Depth-of-Field, Motion Blur etc).
This has been exposed a very simple SetEffect() function as a member of the Camera Class.
However, it was not as simple as that. I was following Phantom's Framebuffer 101 example and for the life of me could not get it work.
My code was basically identical to what was in Phamtom's tutorial. Still no joy. A quick trip into the Gamedev IRC channel where I posed the question, and a very helpful Zao showed me his source code.
I then realised that I was not calling glTexParameteri() before glTexImage2D(). After that, everything worked! Hurrah. I post my code below for completeness.
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT32, Width, Height);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, DepthBuffer);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, Width, Height, 0, GL_RGBA, GL_FLOAT, NULL);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, TextureBuffer, 0);
GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);