Efficiency / proper usage of multiple cameras

I’m targetting tablets for this game (later gen IPads and maybe Android tablets). It’s a 2.5D game - 3d objects locked on the Z axis. The cameras are static.
I can post more details about my usage of these cameras and/or my game if it would help to clarify the questions.

I’m looking at having at least four cameras (from back to front):

  • background camera for drawing background image underneath the world camera
  • world camera for drawing the actual gameplay objects, with a cropped viewport to be in the middle of the screen
  • map camera for drawing a radar map thing at the side of the screen
  • GUI camera for drawing touch detection feedback (GUITextures of transparent rectangles and squares) and other GUI stuff overlaying the whole screen

It seems to me like having separate cameras would be by far the easiest way to write the code - but I’m worried about doing things like having an entire whole-screen camera for just the GUI being inefficient.

So, the major question is: is this too many cameras - am I abusing the way the camera system is supposed to be used?

On efficiency:

  • will I be paying a lot of overhead for all this camera usage? Or should I be writing a whole bunch of code to somehow compose all these different views onto a single camera?
  • and changing the viewport of the world camera - does that have any performance implications? I am kind of guessing/hoping that this would actually be a good thing (less pixels to draw).

Thanks for your time.

As long as you keep a handle on your fill rate my hunch is that you won’t have a problem. I haven’t checked out the overhead per camera of rendering, but on mobile devices you’re typically fill bound rather than CPU bound.

So, as long as each camera is only rendering pixels where it needs to (ie: don’t render things with a lot of transparency) I don’t think that just having a couple of extra cameras will be an issue.

Using a separate camera for the GUI is pretty much standard practice for Unity games, though, so I wouldn’t worry about that at all.