title: How to render color and depth in multisample texture?
body: <p>In order to implement "depth-peeling", I render my OpenGL scene in to a series of framebuffers each equipped with a rgba color texture and depth texture. <a href="http://www.alecjacobson.com/weblog/?p=4310" rel="nofollow">This works fine</a> if I don't care about anti-aliasing. If I do, then it seems the correct thing to do is enable <code>GL_MULTISAMPLING</code> and use a <code>GL_TEXTURE_2D_MULTISAMPLE</code> instead of <code>GL_TEXTURE_2D</code>. But I'm confused about which other calls need to be replaced. </p>
  
  <p>In particular, how should I adapt my framebuffer construction to use <code>glTexImage2DMultisample</code> instead of <code>glTexImage2D</code>? </p>
  
  <p>Do I need to change the calls to <code>glFramebufferTexture2D</code> beyond using <code>GL_TEXTURE_2D_MULTISAMPLE</code> instead of <code>GL_TEXTURE_2D</code>?</p>
  
  <p>If I'm rendering both color and depth into textures, do I need to make a call to <code>glRenderbufferStorageMultisample</code>? </p>
  
  <p>Finally, is there some <code>glBlit*</code> that I need to do in addition to setting up textures for the framebuffer to render into?</p>
  
  <p>There are <em>many</em> related questions on this topic, but none of the solutions I found seem to point to a canonical tutorial or clear example putting all these together.</p>