What is the performance impact of using multisampled antialiasing on iOS?

I experimented with using multisampling for full-screen anti-aliasing on iPhone and iPad on iOS 4. The general mechanism uses the Apple APPLE_framebuffer_multisample extension ( http://www.khronos.org/registry/gles/extensions/APPLE/APPLE_framebuffer_multisample.txt ) and is described in the answer to this question: How do you activate multisampling in OpenGL ES on iPhone? and documented by Apple in their OpenGL ES programming guide.

It works as described, but the drawing performance of my test application suffers by about 50% when I set the number of samples to 2. I primarily test the iPhone 4 using an application that does not support the retina, I use other performance suggestions offered by Apple in your documentation (using glDiscardFramebufferEXT to discard rendering buffers attached to the framebuffer multisample, using glClear to clear the entire framebuffer at the beginning of the frame, etc.).

The overhead of multisampling performance in this way seems surprisingly large to me. Do you guys see similar results or does it mean that I'm doing something wrong?

+4
source share
2 answers

You mentioned that you use this on iPhone 4. Is your OpenGL level rendering on a full 2X retina zoom screen? That is, you set the contentScaleFactor at the OpenGL ES hosting level to [[UIScreen mainScreen] scale] ? If so, you start with a lot of pixels.

Is fill rate limited to applying multisampled smoothing? To check, use the OpenGL ES tool in Tools against your application and enable usage statistics for Tiler Utilization and Renderer Utilization. If your application shows high performance using Renderer without the permission of the MSAA, from the beginning you restrict the filling. Adding MSAA in addition to this can significantly reduce the number of frames due to this bottleneck.

In the application, which I had with a geometry constraint, but not a fill constraint, I did not see such a slowdown when using 4X MSAA in it on iPhone 4. I assume that the bottleneck in your application is to click pixels on the screen.

+2
source

No wonder your performance suffers by about 50% when you set # samples to 2: you draw samples twice! Multisampling means that you essentially draw your scene with a higher resolution than the screen into a buffer outside the screen, and then use filtering algorithms to reduce the multi-disk buffer with a higher resolution to the screen resolution, hopefully with less anti-aliasing artifacts, because the final picture actually includes more detailed information (filtered image with higher resolution) than the version with one sampling.

This is a very common (if not the most common) performance problem in graphics: the more samples you draw, the slower you go.

+1
source

Source: https://habr.com/ru/post/1335881/


All Articles