Jump to content
  • Advertisement
Sign in to follow this  
WizardOfOzzz

OpenGL Using GL_BACK buffer in an FBO etc. ?

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

Hi All, I'm originally a D3D guy, but recently I've brushed up on all the latest and greatest in OpenGL. What I would like to do is use OpenGL's standard depth/stencil buffer together with an FBO. That is, I would like to make the color attachment some texture, and the depth/stencil attachment just be the depth/stencil that is created anyway for normal rendering. It will always be the same size since these are screen-sized textures. What might have me confused is that I use GLUT and therefore don't know when or where the back buffer and depth/stencil are actually created and how they are resized. My guess is that is platform specific and hence why I use glut. Another issue is the requirement that all FBO attachments be the same size. Does this include the depth/stencil? I believe in D3D you can use any Depth/stencil as long as it is larger than your texture. Thanks in advance! Eric PS. I would also like to attach the color back buffer as one of the color attachments of an FBO. Similar problem I imagine.

Share this post


Link to post
Share on other sites
Advertisement
I've read the FBO spec and to clarify what I'm asking:

Can you mix and match the color and depth/stencil from the "window-system-provided" framebuffer and use them in "application-created" frame buffer objects (FBOs).

Share this post


Link to post
Share on other sites
"What might have me confused is that I use GLUT and therefore don't know when or where the back buffer and depth/stencil are actually created and how they are resized. My guess is that is platform specific and hence why I use glut."

When wglCreateContext is called, I think it's at this point that it is created. GLUT will call that for you. Of course, wgl is Windows only. *nux have their own glX functions.

No, you can't use the framebuffer depth/stencil with your FBO. It's a limitation and GL_EXT_framebuffer2 was suppose to relax those limitations, but it didn't come into existance for some reason.

Quote:
Another issue is the requirement that all FBO attachments be the same size. Does this include the depth/stencil? I believe in D3D you can use any Depth/stencil as long as it is larger than your texture.


Yes, another limitation of GL_EXT_framebuffer

There was lots of discussion between forum members at www.opengl.org and ARB guys to decide on GL_EXT_framebuffer features. ARB wanted to create something simple since GL_EXT_framebuffer was really complicated already. 1 year or less later, there was discussion of GL_EXT_framebuffer2 but they didn't make it official. Actually, it was called GL_EXT_render_target and GL_EXT_render_target2 at the time.

Share this post


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

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!