Hello. I am using Unity 3.5.1 for the backend of a robotics simulation. As such, I have multiple Unity cameras on a vehicle pointing in different directions for situational awareness. The problem is that all of these cameras need to be enabled, which means that they’re constantly rendering the scene. This works okay with three cameras (the main camera plus two extra), but as soon as I start adding more the frame rates drop to unacceptable levels.
I assumed this was a graphics device limitation, so I inserted a second video card and tied them together via SLI. The frame rates did not improve. Am I incorrect? What is the limiting factor in having multiple Unity cameras if not the graphics card?
Thank you for your help.
UPDATE:
To duplicate, run the original Bootcamp demo included in Unity (3.5.1). Add four more cameras to the soldier_location object. Remove the audio listeners from all four, leave the other settings as default. Don’t even worry about positioning the cameras. Now, play the game. Notice the drop in frame rates.
To answer the question of what the cameras are used for, they are simulating real-world stereo camera pairs. This means that each camera renders all parts of the 3D scene. For this example, the cameras are completely unused other than simply being enabled. Could the CPU still be the bottleneck?
To answer the question of what the
cameras are used for, they are
simulating real-world stereo camera
pairs. This means that each camera
renders all parts of the 3D scene. For
this example, the cameras are
completely unused other than simply
being enabled. Could the CPU still be
the bottleneck?
In that setup, the CPU will indeed be the bottleneck and no GPU in the world will by you better performance. Even though you’re not rendering through those cameras, they still need to perform a lot of heavy lifting behind the scene: gathering all objects, rejecting them based othe camera’s view frustum etc. Potentially (although doubtful), they even build a framebuffer. I don’t have access to Unity to test anything right now - but generally speaking, whenever you have more than one active cameras in a scene, the CPU will have to do more work.
I just tested 5 cameras on a mac mini (no video card) with 2gb RAM. I’ve added a single particle and tried them both with Clear Flags off and with view port rect. No performance issues at all.
On my PC (8 RAM, quad core, GeForce GT 440, 6.8 windows index rating for graphics) I did a second test using AngryBots and 11 cameras. I’ve attached 10 cameras into the Main one and removed audio source. No performance hit what so ever. Same test on the same mac above: same results. Then I separated them into 11 different rect view ports. You guess it.
What I did noticed is the FPS went down from 250 to 30, but it was 11 cameras. And it’s linear, unlike what you say. If I just hit CTRL/CMD+D to duplicate the extra cameras while on game play, I can see the FPS going down by about 20 fps for each extra camera, which makes sense.
As Drake commented, there are too many things that could be wrong in your case, but hardware resource must not be it.