Unity 3.2 built-in MSAA and GUI elements

I have a performance problem with my OnGui when I activate the AA.
I suspect that your answer will be, “you can not change that” but I’l ask, maybe someone has a good idea :wink:

The app i’m developing right now has like 4 or 5 Buttons in the OnGUI, over my 3d szene with very few items in, and AA is absolutely no Problem running at 30 frames, and interaction with the 3D elements feels fluent.

But if you choose to open the Menu, it will slide in and show fullscreen just the menu, from there you can open the next menuside and so on. The Performance of all this GUI sites sliding in and everything was very good until activation of AA. With AA it feels annoyingly slow.

Opening the Profiler tells me that I use 90% of the power for the OnGUI function, whats expectable because when a GuiSite slided in and is Fullscreen, all other Elements and Cameras behind are deactivated at this time.
It seams linke AA is also trying to improve my textures in the GUI ^^

Now the Questions:
Is there something I maybe missed to pay attention to improve the performance of GUI stuff drawn by the OnGUI function.
The Profiler don’t tells me realy more to improve, most of the time is spent on GUI.Begin / EndGroup, and GUI.Label / Box / Button, so there is nothing useless left, i think ^^

For the one that don’t like my wall of text, start here: :sunglasses:

  • The more interesting question, is it possible to activate and disable the MSAA at runtime, so I can activate it to show my 3d Szene, and deactivate it as long I’m just showing GUI stuff?
  • If it is possible where can i do?
  • Just change the quality level?
  • Or do I need to change it in Xcode?

I ran into the same issue with EZGui slide function, everything works great except for gui slide.

OnGUI is always very costly on iOS. Even worse if you forget to have useLayout = false; in Awake

Its normally recommended to not touch OnGUI for realtime environments.

Also there is a slight issue in the MSAA implementation, you can raise its performance by checking the corresponding thread where another user put in the code to replace

ok thanks, and thats not what I want to hear, “your interface will always be slow” :frowning:
Problem is that I need the Layout thing for sliding 1 Page over the other, without my nice Array for handling GUI.depth is kind of useles.
I just switch it on and of now, bevor and after sliding pages in and out.
I saw the thread with the MSAA implementation, the GL_READ_FRAMEBUFFER_APPLE: is already changed. The second thing with the “stencil attachment” I have no idea where this should be.

And the Thing with switching MSAA on and off, is that possible, first desicionpoint is the device, on iP4 and iPad on and older devices off, for example. The Second could be Interface On or Off, but that requires changing at Runtime, I don’t know if that is possible.
I’m sry I have no clue of Xcode and objC, I just try to do as much as possible in Unity, even it’s not always the best solution ^^

This kind of sliding and nice design etc is why people tend to use EZGUI and similar.
On the other hand though sliding does not require to use layout, just use a rect you animate accordingly. if you update 1 rect or X isn’t much of a difference for the code :slight_smile: (even more so if you are lazy and use the areas / groups to reduce it to a single rect update)

Doing the selective MSAA is no problem.
Just extend the code on the AppController to detect the device identifier and use MSAA as required :slight_smile:

I assume that you render it always at 480x320 then? otherwise it wouldn’t be a wise idea as the 3GS has more “left over fillrate” to pull of MSAA than the ipad and 4th gen which have the same gpu but 4 / 5.2 times as many pixels