Advertisement

MSAA reasons?

Started by May 24, 2017 10:22 AM
2 comments, last by dpadam450 7 years, 8 months ago

Hi All

I've read OpenGL Wiki and other resources, hope I've understood MSAA technique overview. But I can't figure out what are reasons to use it. If a multisampled context is created, then render itself takes care of AA, so why (or when) need to do same manually? Can you please explain cases when MSAA is better or/and faster?

Thank you

In most modern games, you don't render directly to the context's back-buffer. Instead you're rendering to your own textures which form a "post-processing chain" which eventually leads to an image in the back buffer. Usually only the first texture in that chain needs to be MSAA and the rest are not.
Advertisement
MSAA fills the gap left by mipmapping and aniso filtering. Among the most disurbing things in an image are sampling artefacts due to texture minification (either because textures are too large, or because the face they are on is too much sheered), which is addressed in hardware by mipmapping and anisotropic sampling. The other big thing is jagged edges.

That's what a variety of techniques try to address, MSAA being one of the cheapest "just works" approaches for forward rendering. You could as well supersample and scale down, but then you run the pixel shader N times. Other techniques try to detect edges via a variety of heuristics in a post-process pass (depth, normals, color, whatever) and then try to blur the edge regions in a kinda smart way so edges appear smoother. But what's going on there is really just an educated guess. MSAA on the other hand, knows what amount of coverage a triangle has within a fragment, which is arguably a more "scientific" approach to base the blending decision on, and it ideally only runs the fragment shader once.

MSAA is a form of supersampling. You are rendering more pixels than what is output to the screen. However all of those pixels in the msaa buffer can change every frame (such as thin grass blades at far distances). You can still get aliasing when MSAA downsamples to resolve to your screen resolution. A lot of techniques, which can be combined with msaa, will deal with the screen resolution buffer and try to anti-alias the final rendered images (FXAA does this by detecting edges/high contrast and blurring).

NBA2K, Madden, Maneater, Killing Floor, Sims

This topic is closed to new replies.

Advertisement