Retrieving FBO data in GLSL
- by Tom Savage
I'm trying to get MRT working in OpenGL to try out deferred rendering. Here's the situation as I understand it.
Create 3 render buffers (for example). Two RGBA8 and one Depth32.
Create an FBO.
Attach render buffers to FBO. ColorAttachment0/1 for color buffers, DepthAttachment for depth buffer.
Bind the FBO.
Draw geometry.
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.