Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7727203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:24:04+00:00 2026-06-01T05:24:04+00:00

I have frame buffer, with depth component and 4 color attachments with 4 textures

  • 0

I have frame buffer, with depth component and 4 color attachments with 4 textures

I draw some stuff into it and unbind the buffer after, using 4 textures for fragment shader (deferred lighting).
Later i want to draw some more stuff on the screen, using the depth buffer from my framebuffer, is it possible?

I tried binding the framebuffer again and specifying glDrawBuffer(GL_FRONT), but it does not work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T05:24:05+00:00Added an answer on June 1, 2026 at 5:24 am

    Like Nicol already said, you cannot use an FBOs depth buffer as the default framebuffer’s depth buffer directly.

    But you can copy the FBO’s depth buffer over to the default framebuffer using the EXT_framebuffer_blit extension (which should be core since GL 3):

    glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo);
    glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
    glBlitFramebuffer(0, 0, width, height, 0, 0, width, height, 
                      GL_DEPTH_BUFFER_BIT, GL_NEAREST);
    

    If this extension is not supported (which I doubt when you already have FBOs), you can use a depth texture for the FBO’s depth attachment and render this to the default framebuffer using a textured quad and a simple pass through fragment shader that writes into gl_FragDepth. Though this might be slower than just blitting it over.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using a framebuffer object with a color buffer attachment to do some per-pixel
I have data frame with some numerical variables and some categorical factor variables. The
I have one frame in which one TestArea is there. When I append some
I have some code that creates a batch using the pyglet library. The whole
I have an FBO object with a color and depth attachment which I render
I have a simple game that renders 2D graphics to a frame buffer (not
Is there any faster way to access the frame buffer than using glReadPixels? I
I've run into some nasty problem with my recorder. Some people are still using
Here's the situation: I have a texture containing some depth values. I want to
I want to display a video frame buffer on a OpenGLES texture. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.