Implementing MSAA in Vulkan
Multisample anti-aliasing (MSAA) is an anti-aliasing technique used in computer graphics to reduce jagged edges and improve the visual quality of rendered images. Multisampling is a specialized form of supersampling where the fragment shader runs only once per pixel, with only the depth (and stencil) values being supersampled within a pixel. More precisely, with multisampling, the fragment shader only needs to be evaluated once per pixel for each triangle that covers at least one sample point.
Note
Although MSAA is gradually being replaced by more advanced anti-aliasing techniques like temporal anti-aliasing (TAA), it remains relevant on mobile GPUs. When paired with tiled rendering, its performance cost is minimal.
In Vulkan, multiple sample values can later be resolved into non-multisampled color and depth images. Let’s go over how to use MSAA and resolve multisampled attachments in Vulkan.
Getting ready
Be sure...