开发者

Retrieving FBO data in GLSL

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. Co开发者_StackOverflowlorAttachment0/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.


What are you using as FBO attachments? Renderbuffers? Textures?

You should be using textures as color attachments (and depth attachments), so you can read them in the next pass. There's no way to do the same with a renderbuffer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜