For the moment I do a silly thing in order to create FBOs attached to the
current contextID:
I init it at the first drawImplementation call like it:
All vars are pointers in order to be modified inside drawimplementation
Code:
myGeometry::initFBOs{
*_ext=osg::FBOExtensions::instance(contextID,true);
*fbos=new GLuint[2];
(*_ext)->glGenRenderbuffersEXT(2, *fbos);
(*_ext)->glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, (*fbos)[0]);
//Dont know if its needed for my use
//(* _ext)->glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT,
256, 256);
//(* _ext)->glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, (*fbos)[0]);
(*_ext)->glFramebufferTexture2DEXT(GL_DRAW_FRAMEBUFFER_EXT,
GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_RECTANGLE,
_OutTexture2->getTextureObject(contextID)->_id, 0);
(*_ext)->glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
(*_ext)->glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, (*fbos)[1]);
//(*_ext)->glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT,
256, 256);
//(*_ext)->glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT,(*fbos)[ 1]);
(*_ext)->glFramebufferTexture2DEXT(GL_DRAW_FRAMEBUFFER_EXT,
GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_RECTANGLE,
_fimpass->_OutTexture->getTextureObject(contextID)->_id, 0);
(*_ext)->glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
}
Am I wrong?
[quote="Frederic Bouvier"]Hi Julien,
aren't you supposed to attach a texture to the framebuffer ? I don't see a call
to glFramebufferTexture2D or something equivalent in your code.
In OSG term, it's the Camera::attach method that should be called.
-Fred
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=28602#28602
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org