Currently, MSAA can only be applied to the main backbuffer. This is only really sufficient for super basic use cases.
I've put off implementing this in the past due to the added complexity (and I may continue to), but I think I have a handle on what needs doing now:
When creating a canvas, if multisampling is requested, create a seperate multisampled RGBA8 renderbuffer in addition to the usual texture.
Use this as the color attachment when rendering.
Before switching canvas, resolve the current canvas to the non-multisampled texture.
This means that once you switch away from a canvas, you will have the anti-aliased version in the associated texture. The multi-sampled texture is effectively an implementation detail.
Summary:
Currently, MSAA can only be applied to the main backbuffer. This is only really sufficient for super basic use cases.
I've put off implementing this in the past due to the added complexity (and I may continue to), but I think I have a handle on what needs doing now:
This means that once you switch away from a canvas, you will have the anti-aliased version in the associated texture. The multi-sampled texture is effectively an implementation detail.
Why is this needed?
@tesselode will be sad otherwise