Multisampling Anti Aliasing (MSAA): How does it influence the performance?

Started by
4 comments, last by Papalqi 5 years, 3 months ago

Hello!

After all these months I learned a lot about OpenGL and graphics and here I am now learning about MSAATutorial Source

From what I understand, MSAA only increases the memory of the colour buffer so it does not actually affect the performance right? Since each fragment run's only once no matter the number of samples. Probably I'm wrong this is why I'm asking, since as a video gamer I remember rumours that anti aliasing cost's in fps. 

Also an off topic question. In video games when you set the option of anti-aliasing to x1, x2, x3, x4, x8  etc, you actually specifying the number of samples?


void life()
{
  while (!succeed())
    try_again();

  die_happily();
}

 

Advertisement

Yep 2x, 4x, etc are the number of samples. 

There's two performance impacts.

At some point in time, you need to "resolve" the MSAA image into a regular image for display. This will have a similar cost to copying a full screen image...

Secondly, memory usage IS a massive performance concern -- not just memory usage total, but bytes per second. Memory is one of the slowest parts of any processor (computations are fast, moving data is slow!) so one of the most common ways to optimise a game isn't to reduce the number of computations done, but to rearrange the memory access patterns... 

If MSAA makes your buffers 2x, 4x, 8x larger, that means it's going to take 2x, 4x, 8x longer for all the pixels to be written out to memory. The latest GPUs actually have some fancy optimizations here though, where they'll actually perform lossless compression on pixels or groups of pixels before writing them to memory, so in areas of the screen where the colors are all the same, less data has to be written to memory. 

If someone can point me to places where I can read more I'd be in your depth ? 

15 hours ago, Hodgman said:

Yep 2x, 4x, etc are the number of samples. 

There's two performance impacts.

At some point in time, you need to "resolve" the MSAA image into a regular image for display. This will have a similar cost to copying a full screen image...


Rendering to a multisampled framebuffer object goes automatically. 
Whenever we draw anything while the framebuffer object is bound, the rasterizer 
will take care of all the multisample operations. We then end up with a multisampled 
color buffer and/or depth and stencil buffer. Because a multisampled buffer is a bit 
special we can't directly use their buffer images for other operations like sampling them in a shader.

A multisampled image contains much more information than a normal image so what 
we need to do is downscale or resolve the image. Resolving a multisampled 
framebuffer is generally done via glBlitFramebuffer that copies a region 
from one framebuffer to the other while also resolving any multisampled buffers.

This is the reason for the first performance impact?


void life()
{
  while (!succeed())
    try_again();

  die_happily();
}

 

On 1/26/2019 at 12:36 AM, babaliaris said:

This is the reason for the first performance impact?

Yep ?

coverage sample、depth and stencil is x1, x2, x3, x4, x8  etc

This topic is closed to new replies.

Advertisement