Draw Calls + General Performance Help

Hi all,
noob here, so bear with me. First off, I’m using Unity 3.3, love this engine. I’m a 3D guy who does pretty much everything from modeling to compositing. I’ve gotten to know it through work for the last couple of weeks. I’m loving using it, and it seems very easy to use.

So I’ve got a project on the go, it’s a small interior scene. I’m looking to optimize preformance. We have three levels of the project to deal with: High (Mid-level Gaming Rigs), Medium (Standard 4-year-old laptops, with nothing special under the hood), and Low (Netbooks and possibly tablet in the future) - all to be deployed on the web.

Now, a bit about my boss, he wants photoreal, or as close as possible (90% photoreal). He also wants it to be a relatively small size for the web build (20 MB maximum).

Now, the scene has been optimized for size, (reused and compressed a lot of textures). but the speed on the Medium computer is not even close to acceptable (it’s at an average of 750 draw calls, what looks like 5 fps, and has a one second delay).

  • I know Shadows kill it a lot, so i’m using 7 pixel lights (no shadows) with one directional light for shadows and forward rendering.
  • It also says there’s 1 Million tris, but in 3D Studio MAX it tells me there’s just under 100K. We have some swappable objects in the scene, but they’re never seen.
  • I am also using some exported lightmaps from max, and Self-Illum Bump Spec shader. I’m using that shader because it seems that the lightmap shaders and the built-in lightmapper seems to get rid of all my specular highlights for some reason.
  • I was also reading how splitting up larger chunks of the scene would help it performance wise. My walls and floor for the entire scene was one piece, so i split it into 17 sections so the camera could cull out the stuff behind it, so there would not be as many draw calls, but it upped the draw calls from 750 to 900!

I guess I’m looking for hints, tips, or tricks from some experienced unity users, but i have a few questions that i think would help me:

  • for optimal performance on my “Medium computer”, How many tris/mesh, and how many meshes should there be?
  • how badly will image effects like bloom, dof, ssao, motion blur, and AA affect performance?
  • why does it say there’s 200k tris in my view when i’m looking into the corner of a room?
  • can scripts affect performance at all? there were some scripters working here that wrote some scripts for view changing, menus, and some other things.

any help or knowledge you could throw at me would be greatly appreciated! Thanks in advance!

Because , most likely , there is objects behind the corner of the room you are looking at , and the camera knows they are there , even though you can t see them. This is usually the case when things are not explicitly occluded from the camera.

of course they can, pending on whats happening in the scripts. Generally moving a camera around is not gonna be a performance hampering script though.

Thanx for the reply, appreciate it

Actually, in the case I’m referring to, there’s no polys behind the wall, it should only be seeing about 100 tris max, and I can’t think of any explanation why it would be seeing 1000x more, even if each image effect and light hitting the scene multiplied the poly count by 5, it still wouldn’t account for that much of an increase. I checked for duplicate geometry and lights, but were none. In this scene there are a few scripts that will change the position of the camera to another area with different areas and lights, but this area is not visible from our location. Any thoughts?