Jump to content
  • Advertisement
Sign in to follow this  
angrybob

OpenGL fbo stencil attachment not working

This topic is 4771 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

I'm using an Fx5200 and the latest linux drivers that support framebuffer objects. I can get fbo rendering to work fine using a texture for the color attachment and a renderbuffer for the depth attachement.But when I try attaching a renderbuffer to the stencil attachement it does not work. here is my code:
glGenFramebuffersEXT(1, &mainfb);
glGenRenderbuffersEXT(1, &depthrb);
glGenRenderbuffersEXT(1, &stencilrb);

glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, mainfb);
tex1->attach_to_fbo_color();
opengl::printerror("D");
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, stencilrb);
opengl::printerror("E");
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_STENCIL_INDEX8_EXT, 512, 512);
opengl::printerror("F");
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, stencilrb);
opengl::printerror("G");
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depthrb);
opengl::printerror("H");
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24, 512, 512);
opengl::printerror("I");
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depthrb);
opengl::printerror("J");

opengl::check_fbo();
the opengl::printerror() calls just work out what error was generated if any, by the preceding commands. There are no errors generated by any commands except for the following two lines which both generate an invalid enumeration error: glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_STENCIL_INDEX8_EXT, 512, 512); glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, stencilrb); when I check the fbo for completeness afterwards it does say that it is complete but there is no stencil buffer. Is this a driver bug or am I doing something wrong??

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!