Search code examples
opengljoglantialiasingopengl-4multisampling

Pure SSAA vs per-sample multisampling


What's the difference between a pure Super Sampling Anti Aliasing (SSAA) and multisampling with a per-sample shading via

gl4.glMinSampleShading(1.0f);

using GL_ARB_sample_shading?

I like much more the latter because compared to SSAA, it does not need bigger textures and it offers a lot of flexibility.. i.e: you may even switch it, during runtime, between SS and pure multisample..

Any drawback I am not aware of?


Solution

  • What's the difference between a pure Super Sampling Anti Aliasing (SSAA) and multisampling with a per-sample shading

    I assume by "pure Super Sampling Anti Aliasing (SSAA)", you mean that you would implement it yourself. I say this because multisampling with a per-sample shader is super sampling.

    So the question is what's the difference between using specialized hardware and doing it yourself. The differences are:

    1. Implementations will often have specialized hardware built around multisample resolve operations. So odds are good doing a multisample resolve will be faster than if you wrote a shader to do it. Or at the very least, it won't be slower.

    2. Implementations will often have specialized hardware for dealing with sample locations in multisampling. Sometimes it changes sample locations per-frame, which at a reasonable framerate can help reduce aliasing artifacts more. Or whatever. You can't get that effect yourself. Indeed, you can't even use a rotated grid of samples yourself.

    I like much more the latter because compared to SSAA, it does not need bigger textures and it offers a lot of flexibility.

    You are fooling yourself if you believe that a 4x multisample texture is not (at least) 4x bigger than a non-multisample texture of the same size.