EXT_framebuffer_object usable yet?

Started by
12 comments, last by Nithos 19 years ago
Just curious if anybody has gotten the new EXT_framebuffer_object to work yet? nVidia has said that the drivers for the extension are avalible now in beta form, but I've yet to get my programs to recognize the extension. I'm developing on a geForceFX 5500, and have the lateset beta drivers (71-1.8 or somthing like that...), which I would assume should be more than enough to support the feature. I realize that it's not practical to use it an anything you're planning on distributing (yet), but I simply wanted to toy around with their functionality and compare it with my current pBuffer setup (shudder!) Thanks for any help! [Edited by - Blue*Omega on April 15, 2005 12:58:25 PM]
// Tojiart
Advertisement
people have over on OpenGL.org, check the 'advanced' forum for a couple of threads on it.

ATI's support will apprently appear 'in a couple of months', I'm hoping for June so its in time for my b'day [grin]
Thanks for the advice.

Just FYI, the best thread on the subject I found was

Here

In that thread, they also link to some of the newest beta drivers that expose FBO functionality. Sounds like it's still a bit buggy, but the overall reaction seems good. (And hey, why wouldn't it be? Anything that avoids the hell of pBuffers is reason to get excited!)
// Tojiart
yeah, p-buffers are a pain, i was doing some work on a screen bluring effect with GLSL the other day and reaslised I'd need two pbuffers, so I cried and put away the code to wait until ATI deliver the extension..
One thing I'm wondering about (wish I had a chance to test it myself) is how far back the FBO's will be compatible. I would imagine that they would work on any card that already supports the ARB_render_texture extensions, which would give pretty good backwards compatibility once the "real" drivers are released.

I'm just hoping that a year or so down the line the drivers will be to the point where there's no need to write fallback support to ARB_render_texture. That would be very nice indeed!
// Tojiart
Quote:
The framebuffer object extension is currently available in beta drivers from both NVIDIA and ATI. It will be fully supported on NV30 and R300 and later, and possibly on NV1x and R200 as well.


although, personally, I dont care about cards Pre-R300/NV35 [grin]
Too bad more people don't take that approach. Games would move forward a whole lot faster if we didn't bother writing fallbacks for everything under the sun.

Personally, I'll go out of my way to support NV25 class stuff (don't remeber the ATI equivalent) but I'm not gonna spend a lot of my time there. I'm focusing my current development on NV30+ stuff, so these Framebuffers are sliding nicely into my little niche.
// Tojiart
EXT_Framebuffer_Object is available in the 75.90 and 76.10 Beta forceware drivers, which you can get at guru3d.org. I believe Nvidia will support it all the way back to Geforce 256 cards. I was unable to get FBO funtionality working properly in 75.90, and I have not yet tried it with 76.10, however, this is probably because I am not an expert ogl coder. Anyone else get a working demo yet?
Quote:Original post by Blue*Omega
Too bad more people don't take that approach. Games would move forward a whole lot faster if we didn't bother writing fallbacks for everything under the sun.


Well, I can do it coz (a) I havent got owt produced yet so by the time I do my target hardware will be pretty common and (b) I dont have to sell games [wink]

There is alot of legacy hardware out there and most games dont have the pull to get people to upgrade. Infact, only really 3 companies do atm; iD, Valve and Epic as they are the ones pushing things forward.
I have about three demos coming using FBO one way or another, stay tuned ;)

#include "FrameBufferObject.h"FrameBufferObject::FrameBufferObject(){  stencilBufferIndex  = 0;  frameBufferIndex    = 0;  depthBufferIndex    = 0;  height              = 0;  width               = 0;}bool  FrameBufferObject::initialize(int width_, int height_, int format){  if(!GLEE_EXT_framebuffer_object)    return Logger::writeErrorLog("GL_EXT_framebuffer_object not supported");  if(width_ <= 0 || height_ <= 0)    return Logger::writeErrorLog("Width and height of FBO must be positive");  height = height_;  width  = width_;  glGenFramebuffersEXT(1, &frameBufferIndex);  glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, frameBufferIndex);  GLuint depth = (format & FBO_DEPTH_16) ? GL_DEPTH_COMPONENT16 :                 (format & FBO_DEPTH_24) ? GL_DEPTH_COMPONENT24 :                 (format & FBO_DEPTH_32) ? GL_DEPTH_COMPONENT32 : 0;  if(depth)  {    glGenRenderbuffersEXT(1, &depthBufferIndex);    glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depthBufferIndex);    glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, depth, width, height);    glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,                                  GL_RENDERBUFFER_EXT, depthBufferIndex);  }  if(format & FBO_STENCIL)  {    glGenRenderbuffersEXT(1, &stencilBufferIndex);    glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, stencilBufferIndex);    glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_STENCIL_INDEX, width, height);    glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT,                                 GL_RENDERBUFFER_EXT, stencilBufferIndex);  }  bool result = checkFrameBufferStatus();  glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);  return result;}bool FrameBufferObject::checkFrameBufferStatus(){  GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);   switch(status)  {    case GL_FRAMEBUFFER_COMPLETE_EXT:      Logger::writeInfoLog(String("Successfully created the frame buffer object < ") +                           int(width) + ", " + int(height) + ">");    break;    case GL_FRAMEBUFFER_UNSUPPORTED_EXT:      return Logger::writeErrorLog("Failed to create the frame buffer object, please verify your format");    break;  }  return true;}void FrameBufferObject::switchTarget(GLint target, GLint textureID){  if(frameBufferIndex)    glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,                              target, textureID, 0);  else    Logger::writeErrorLog("Invalid FrameBufferObject index");}void FrameBufferObject::bind(){  if(frameBufferIndex)    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, frameBufferIndex);  else    Logger::writeErrorLog("Invalid FrameBufferObject index");}void FrameBufferObject::stop(){  if(frameBufferIndex)  	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);}GLuint FrameBufferObject::getHeight(){ return height; }GLuint FrameBufferObject::getWidth() { return width;  }FrameBufferObject::~FrameBufferObject(){  if(stencilBufferIndex)    glDeleteRenderbuffersEXT(1, &stencilBufferIndex);  if(depthBufferIndex)    glDeleteRenderbuffersEXT(1, &depthBufferIndex);  if(frameBufferIndex)    glDeleteFramebuffersEXT(1, &frameBufferIndex);}#ifndef FRAME_BUFFER_OBJECT_H#define FRAME_BUFFER_OBJECT_H#include "../GenUtils/Logger.h"#define FBO_DEPTH_16                0x00000001#define FBO_DEPTH_24                0x00000002#define FBO_DEPTH_32                0x00000004#define FBO_STENCIL                 0x00000010class FrameBufferObject{    GLuint width,           height,           frameBufferIndex,           depthBufferIndex,           stencilBufferIndex;     bool  checkFrameBufferStatus();  public:     FrameBufferObject();    ~FrameBufferObject();     bool initialize(int width, int height, int format = 0);     void switchTarget(GLint target, GLint textureID);     void bind();     void stop();     GLuint getHeight();     GLuint getWidth();};#endif

This topic is closed to new replies.

Advertisement