Fastest text output on the iPhone - GUIText or 3D Text?

Which is faster for large amounts of text on the iPhone - GUIText, or 3D Text?

My guess would be GUIText since 3D Text uses a quad (two tris) per letter. But I don’t know much about how GUIText operates internally, and I know we’ve been warned about using GUI stuff on the iPhone too much.

…or is there a third option that’s even better that I’ve overlooked?

Brady, interesting question. Mind if I make an educated guess? First- I think that GuiText is different than UnityGui. The warnings about iphone performance hits were for UnityGui especially when using Layout. If you don’t use Layout and you disable your gameobjects with UnityGui when they don’t need to display, then it’s not a problem. In my experience so far, UnityGui works pretty well on iphone. GuiText is probably equivalent or faster than UnityGui but less flexible. 3d text is least performant since it adds lots of vertices to the scene etc. Just speculation though.

Yeah, that was my speculation too. However, I was using a GUIText for fps display and it slowed everything down a LOT when the screen was touched if I didn’t set useGUILayout to false. So apparently GUIText is enough of a GUI component to be a liability if you don’t set that layout flag. Then again, the docs do leave you with the impression that GUIText is apart from UnityGUI.

My speculation is that GUIText does something like a Blit (since it is entirely in screen space) as opposed to actually rendering polys. But I’d like to know for sure if I’m right in that.

GUIText is done exactly the same way as 3D Text. If you look at the stats you can see the number of vertices etc. increase when putting GUIText on the screen. Text using OnGUI is also done that way as well. GUIText predated OnGUI and doesn’t have anything to do with it as far as I know.

–Eric

I see, so in that case, it doesn’t make any difference?

From my experience it’s best to avoid OnGUI at all costs. We have a game that really pushes the engine. Our goal was a steady 15fps+ but we were getting 10-12fps on average. Removing our GUI script bumped performance up to 12-16fps+.

You can replace Unity GUI with GUIText, GUITexture, or 3DText. There appears to be no difference in using GUIText or 3D Text.

Hi Brady. I was reading this old forum posting and was wondering what you had concluded about GUIText on the iphone.

I’m currently using GUIText for my HUD (guilayout OFF) and haven’t noticed any significant problems yet.

Eventually, I’ll probably use SM for my hud, if nothing else to save on drawcalls, not to mention the added benefit of animating text.

But for now, can I expect a performance hit as result of guiText?

scott.

I believe if you have multiple guiTexts you’ll start to see a performance hit. 3D text, on the other hand, will batch so long as it is all from the same material. But it’s in world space rather than screenspace, which, depending on what you’re doing, can be better or worse.

Might be a stupid question: do I have to add a script with useguilayout=false to all guitext and guitexture objects?