I have made a scene in Maya with a lot of trees (basically copies) that have a lot of resolution (roughly 50000 vertices per tree). Loading the scene in unity like this brings it to its knees… does it make any sense to save a tree as a prefab and place duplicates in unity (or is that performance-wise the same)? does anybody know where I could find low-res trees (no palms)? what’s the average vert.count I can expect to smoothly run on a macbook pro?
The way the terrain engine handles trees is to billboard them a certain distance away - so if there are only 4 trees within 50 units (or whatever distance you set) only those four will be rendered, and the rest will be (effectively free, performance-wise) flat panes. So yes - it will make an enormous performance difference.
You have to use certain shaders and so on for trees to be used in the terrain engine - see the docs for how to do this. (just making a prefab and throwing it in the scene won’t do it; it has to be placed on terrain)
Am I correct in assuming that since it’s all the same mesh, unity calculates how to render the entire thing, every single tree, even behind the camera, if just one part of the entire landscape is in the field of view?
If that’s the case, then you’ll get a performance boost by using multiple objects… and then, promptly, another performance hit for using so many individual objects. It’s a balancing act. Very large outdoor environments are difficult to manage… unless you have unity 2.0… then it’s cake and you just stamp down tress and terrain like it’s KidPix.
Actually, any polygons completely outside the view frustrum aren’t calculated (not by OpenGL anyway, and I’m assuming also Direct3D on Windows). You can see this if you make a very complex mesh with some kind of pixel shader (something that will stress the graphics card), use a fps counter, and slowly move the mesh onto the screen. You’ll see the fps drop as more and more of the mesh is rendered.
Anyway, no, using a prefab won’t make any difference. 50K polygons per tree is insane. With lots of trees, even fairly low-poly ones, you’ll want some kind of LOD system, and you wouldn’t build the scene in your 3D app. (Just the individual trees.) Fortunately Unity has a LOD system built-in…