• Advertisement
Sign in to follow this  

EXT_framebuffer_object usable yet?

This topic is 4667 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
Advertisement
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!)

Share this post


Link to post
Share on other sites
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..

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 0x00000010


class 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


Share this post


Link to post
Share on other sites
Quote:
Original post by _the_phantom_
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]


A friend of mine just checked last night and current stable ATI drivers do have the EXT_fb_o entrypoints, but does not expose the extension in the extension string, so I think it will be officially there in not so long time.

-M

Share this post


Link to post
Share on other sites
yeah, i tested the entry points myself yesterday and while they dont crash they dont work, heh

I got my infomation from someone who works at ATI, so it will be longer than a month, a 'couple' implies two months but it could be more (driver pipeline depth and the state of the code base play a huge role in it)... simply adding entry points isnt that hard tbh, all they would need todo is define a couple of functions and put them in the export table of the dll, they dont have todo anything [smile]

Share this post


Link to post
Share on other sites
Quote:
Original post by _the_phantom_
simply adding entry points isnt that hard tbh, all they would need todo is define a couple of functions and put them in the export table of the dll, they dont have todo anything [smile]

True, but that at least means they've started to think about it :P

-M

Share this post


Link to post
Share on other sites
Most of the 2D functionalities are implemented now in the NV beta drivers 76.44, so rendering to multiple buffers, multiple textures, that works pretty well. No ATI equivalent right now (which sux b/c thats what i have and need it for) and unfortunately there is no 3D render to texture support yet.

Here is a demo in this thread by Java Cool Dude, there is 1 or 2 more somewhere earlier in that thread if you want to take a look.

If anyone gets 3D to work on some new drivers, tell me, i'm kind off stuck without it :)

Edit: Java Cool Dude posted the same demo on these forums as well :), just noticed it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement