<p>Roughly speaking, what the <strong>Supersampling Anti-Aliasing</strong> method does is:  </p>

<ul>
<li>For each pixel in the image to render

<ul>
<li>"Split" the pixel of a target image, usually in 2, 4, 8 or 16.<br>
Actually this step is more: pick the 2, 4, 8 or 16 locations ("samples") inside the pixel  </li>
<li>Compute the color that the image will have at each of those locations (sample or "split part").<br>
So instead of only computing the color that the image will have in that single pixel, we compute 2x, 4x, 8x or 16x times a similar value  </li>
<li>Compute the average of all the 2, 4, 8 or 16 sample colors to decide the final color or the initial pixel</li>
</ul></li>
</ul>

<p>You can see that Super-sampling cost is proportional to the cost of computing one pixel's color in the image. Therefore it depends on the cost of shading.<br>
It also depends on the number of pixels, i.e the resolution of the image.  </p>

<p>In the context of Ray-Tracing applications, this means that 2, 4, 8 or 16 times more rays will have to be computed.  </p>

<p>In the context of GPU-accelerated graphics computation, this means that 2, 4, 8 or 16 times more pixel shaders ("fragment programs") will be executed.  </p>

<hr>

<p>Now roughly speaking, what the <strong>Multisampling Anti-Aliasing</strong> method does is:  </p>

<ul>
<li>For each pixel in the image to render

<ul>
<li>Pick 2, 4, 8 or 16 locations ("samples") inside the pixel     

<ul>
<li>For each primitive (triangle) in the scene (actually, only for those that overlap the pixel):  

<ul>
<li>Determine which of these samples are covered by the current triangle</li>
<li>If there is at least one such sample, compute a single color of the contribution of that triangle to the pixel, and store it for each sample covered<br>
The worse case happens if each sample is overlapped by a different triangle ;  in that case the color must be computed for each triangle</li>
</ul></li>
</ul></li>
<li>Compute the average of all the gathered sample colors to decide the final color or the initial pixel</li>
</ul></li>
</ul>

<p>You can see that evaluating the performance of Multisampling Anti-Aliasing is more complicated than that of Supersampling, since it also depends on the topology of the scene (the size and shape of the triangles).</p>

CC BY-SA 3.0
2018-02-02T09:09:53.810Z
"Multisample Anti-Aliasing method does is ..... " we compute 2x, 4x, 8x or 16x times a similar value"
I think you are describing SSAA, Super Sample AA, not MSAA.  MSAA will only run the pixel shader *up to* the minimum of the sample rate AND the number of objects crossing the pixel.
Simon F
CC BY-SA 3.0
2018-02-02T09:42:24.417Z
You are correct, I updated the answer.
wip
CC BY-SA 3.0
2018-02-02T07:12:44.040Z
2018-02-02T09:40:46.430Z
2018-02-02T09:40:46.430Z
wip
<p>I'm finding myself increasingly interested in rendering techniques utilizing multisampling for anti-aliasing (obviously), out-of-order transparency, volumes etc.</p>

<p>Searching the web for performance numbers of MSAA in the range only gets me to gamer verdicts for this and that game, and even then MSAA is only used for AA, and being compared to screen based post process AA which can hardly be used for anything else than AA.</p>

<p>Is there any rule of thumb (other than memory consumption) of how much it costs having x2, x4, x8, x16 MSAA? Linear? Logarithmic?</p>

CC BY-SA 3.0
2018-01-22T10:27:43.473Z
seems to me like it is cuadratic, since you scale the amount of pixel samples both horizontally and vertically by some constant k. $O(width \times height \times k^2)$
Sebastián Mestre
CC BY-SA 3.0
2018-01-25T16:04:06.747Z
Are you assuming a GPU-accelerated MSAA implementation? Because in that case the GPU absorbs most of the cost.  If your runtime is limited by fragment shader execution time, then the slowdown will be in proportion to the number of pixels where an edge is visible, because this is where you'll execute your shader multiple times.
GroverManheim
<performance>
How does MSAA performance scale?
Andreas
# How does MSAA performance scale?

(Asked by: username_0 on 2018-01-21)

I'm finding myself increasingly interested in rendering techniques utilizing multisampling for anti-aliasing (obviously), out-of-order transparency, volumes etc.

Searching the web for performance numbers of MSAA in the range only gets me to gamer verdicts for this and that game, and even then MSAA is only used for AA, and being compared to screen based post process AA which can hardly be used for anything else than AA.

Is there any rule of thumb (other than memory consumption) of how much it costs having x2, x4, x8, x16 MSAA? Linear? Logarithmic?

**Tags:** performance

> **Comments:**
> **username_1**: seems to me like it is cuadratic, since you scale the amount of pixel samples both horizontally and vertically by some constant k. $O(width \times height \times k^2)$  
> **username_2**: Are you assuming a GPU-accelerated MSAA implementation? Because in that case the GPU absorbs most of the cost.  If your runtime is limited by fragment shader execution time, then the slowdown will be in proportion to the number of pixels where an edge is visible, because this is where you'll execute your shader multiple times.  

---

## 1 answers

### Answer by username_3 on 2018-02-02. Score: 3

Roughly speaking, what the **Supersampling Anti-Aliasing** method does is:

* For each pixel in the image to render
  + "Split" the pixel of a target image, usually in 2, 4, 8 or 16.  
    Actually this step is more: pick the 2, 4, 8 or 16 locations ("samples") inside the pixel
  + Compute the color that the image will have at each of those locations (sample or "split part").  
    So instead of only computing the color that the image will have in that single pixel, we compute 2x, 4x, 8x or 16x times a similar value
  + Compute the average of all the 2, 4, 8 or 16 sample colors to decide the final color or the initial pixel

You can see that Super-sampling cost is proportional to the cost of computing one pixel's color in the image. Therefore it depends on the cost of shading.  
It also depends on the number of pixels, i.e the resolution of the image.

In the context of Ray-Tracing applications, this means that 2, 4, 8 or 16 times more rays will have to be computed.

In the context of GPU-accelerated graphics computation, this means that 2, 4, 8 or 16 times more pixel shaders ("fragment programs") will be executed.

---

Now roughly speaking, what the **Multisampling Anti-Aliasing** method does is:

* For each pixel in the image to render
  + Pick 2, 4, 8 or 16 locations ("samples") inside the pixel
    - For each primitive (triangle) in the scene (actually, only for those that overlap the pixel):
      * Determine which of these samples are covered by the current triangle
      * If there is at least one such sample, compute a single color of the contribution of that triangle to the pixel, and store it for each sample covered  
        The worse case happens if each sample is overlapped by a different triangle ; in that case the color must be computed for each triangle
  + Compute the average of all the gathered sample colors to decide the final color or the initial pixel

You can see that evaluating the performance of Multisampling Anti-Aliasing is more complicated than that of Supersampling, since it also depends on the topology of the scene (the size and shape of the triangles).

> **Comments:**
> **username_4**: "Multisample Anti-Aliasing method does is ..... " we compute 2x, 4x, 8x or 16x times a similar value" I think you are describing SSAA, Super Sample AA, not MSAA.  MSAA will only run the pixel shader *up to* the minimum of the sample rate AND the number of objects crossing the pixel.  
> **username_3**: You are correct, I updated the answer.  

---

