I have a working OpenGL multipass rendering example, and need to add multisampling.
I tried two approaches. Both approaches do not use depth or stencil buffers, but only render colors.
Multisampling during principal rendering
1. Bind Multisampling Fbo
2. Render geometry
3. Blit / resolve multisampling
4. [1..n] Bind normal Fbo and apply post-process
Multisampling at the end
1. Bind normal Fbo
2. Render geometry
3. [1..n] Bind normal Fbo and apply post-process
4. Bind Multisample Fbo
5. Render result texture onto a quad into the multisample fbo
6. Blit / resolve multisampling
Problem
While both approaches seem to work (complete framebuffers etc), I can clearly see hard edges in the second approach. Only using the first approach I actually get antialiased soft edges.
Is there a conceptual problem with the second approach? Are there some specific prerequisites to multisampling so that it won't work as described?
I would greatly prefer using the second approach.
Your second approach cannot work. Multisampling uses coverage information to write different values for each sample belonging to a pixel. You lose this information when you draw your geometry into a non-multisample buffer. Rendering the non-multisample buffer into the multi-sample buffer can't recover information which is no longer there (the aliasing has already happened).