Retrieving FBO data in GLSL

Posted by Tom Savage on Stack Overflow See other posts from Stack Overflow or by Tom Savage
Published on 2010-06-06T16:26:55Z Indexed on 2010/06/06 16:32 UTC
Read the original article Hit count: 422

Filed under:
|
|

I'm trying to get MRT working in OpenGL to try out deferred rendering. Here's the situation as I understand it.

  1. Create 3 render buffers (for example). Two RGBA8 and one Depth32.
  2. Create an FBO.
  3. Attach render buffers to FBO. ColorAttachment0/1 for color buffers, DepthAttachment for depth buffer.
  4. Bind the FBO.
  5. Draw geometry.
  6. Send data to different attachments using gl_FragData[] in the frag shader.

At this point I would want to take the data in another pass using GLSL, how can a) retrieve data from the framebuffer color attachments, b) get data from the depth component.

© Stack Overflow or respective owner

Related posts about opengl

Related posts about glsl