Consider the following situation:
- We have an FBO with two identical color attachments
- Bind shader program 1 and render an object to FBO attachment 0
- Bind the texture on attachment 0 for sampling
- Bind shader program 2 and draw a full screen quad. In the fragment shader we sample from the texture on attachment 0 and write it’s value to the texture on attachment 1.
Can framebuffer objects be used in this way? The reason why I’m considering this is to reduce the number of FBOs I create. I’m experimenting to see if I can perform all of my rendering passes with a single FBO equipped with multiple attachments. In my current implementation this setup does not seem to work as expected, I'm trying to determine if there's a problem with my implementation or if this is even possible.
Any insight would be appreciated!