title: OpenGL FBO Multiple textures
body: <p>I have an FBO to which I attach two textures. Then I want to bind the FBO, use the first texture as input (bind) to a shader and write to the second texture, both are attached to the FBO. I tried this using glDrawBuffer to specify GL_COLOR_ATTACHMENT1 as draw buffer, but without success. Is this possible anyway?</p>
  
  <p><strong>Edit</strong>:</p>
  
  <p>Here is how I try to do it:</p>
  
  <pre><code>GLuint tex0, tex1; // they are created elsewhere and bound to the fbo
  glBindFramebuffer( GL_FRAMEBUFFER, fbo );
  
  glActiveTexture( GL_TEXTURE0 );
  glBindTexture( GL_TEXTURE_2D, tex0 );
  
  glDrawBuffer(GL_COLOR_ATTACHMENT1);
  
  // render code
  
  glReadBuffer(GL_COLOR_ATTACHMENT1);
  glReadPixels(...);
  </code></pre>
  
  <p>But the result from glReadPixels is different from what I expected. Can you see any problems here?</p>