Every gui element takes a draw call?

Hmm… I mistakenly thought that if you placed your entire gui under a single OnGUI call, it would only use 1 draw call. But the following takes 4 draw calls:

function OnGUI(){
	GUI.Label(Rect(0,0,100,50), "one");	
	GUI.Label(Rect(50,0,100,50), "two");	
	GUI.Label(Rect(100,0,100,50), "three");	
	GUI.Label(Rect(150,0,100,50), "four");	
}

I just realized my current game has nearly 100 draw calls! So how could one do a GUI heavy game for iPad/iPhone, and still achieve a reasonable frame rate?

Yeah, the procedural Unity GUI system is expensive in terms of draw calls, and is best suited for opening and pause menus, not runtime HUDs. An upside, however, is its straightforward use and implementation. For uber-performant GUI’s, I recommend checking out EZ GUI – same guys did the Sprite Manager middleware. If you implement your own solution, you will more than likely end up following the patterns of one or both those libraries.

Thread on EZGUI: http://forum.unity3d.com/viewtopic.php?t=53991&sid=da0e7a86626c6d67656bf5276d613c2e

Yeah, I’ve been considering EZGUI. Can it render a ton of GUI elements under a single draw call?

I would hazard a Yes guess on that. How quickly it stitches everything together on iPhone hardware for that one draw call, however, is a question for Brady; he is very responsive to questions on the respective threads, so I’d just post or PM directly with your anticipated usage.

If you haven’t looked at the demo screencast they have on their business website, check that out – pretty slick stuff going on.

I’ll probably buy it myself (EZ Gui) this week. If I don’t see any more chatter on your question by then I’ll crunch some volume through it and post some benchmarks.