Unity Terrain Performance


We are currently in the pre-production of our next game that will be developed using Unity3D and I'm wondering what performance implications using the built-in Unity terrain has (http://unity3d.com/unity/features/terrains).

Our game is developed for the web player and should run with a minimum of constant >15fps on low-end laptops (not netbooks, but with a dual core cpu and an integrated graphics card). This means we have to keep the number of draw calls and, more importantly, the polygon count low since integrated gpus use the cpu for vertex transformations.

Unfortunately I can't find much information about the internal workings of the Unity terrain, so I can't judge how well it performs against terrain modeled in Maya and imported as FBX:

  1. Is the created terrain a single vertex buffer that is always rendered as a whole, even when just parts of the terrain are visible?
  2. How does Texture Painting on the terrain work? Are drawn features baked into a single texture or are they rendered using multitexturing, needing multiple draw calls?
  3. Does Unity employ any terrain rendering/LOD techniques such as ROAM, Clipmaps or Persistent Grid Mapping to enhance rendering performance?

In our game we use an isometric camera (can be moved, but the view direction will stay the same inside a level). This means that only a small part of the terrain is visible at once, so it is necessary that the rest of the terrain is culled away as early as possible to avoid many vertex transformations. A technique such as Persistent Grid Mapping would be suited fine for this scenario, I guess. Another possibility would be to model terrain manually in Maya and import it as multiple meshes to enable view frustum culling.

I would be very thankful for any information about Unity terrain performance and how it may perform against hand-modeled terrain in our case.

You should be fine using it as many people have... Why not do some tests for yourself?

As for culling, that's a pro feature, it comes with the iOS I believe...

Texture painting works well... And I think it'd be a single texture (You can see the height map is only one).

And yes, it has billboarding, which you can control at what distance it starts (For trees and foliage)...

It'd be best to use it for yourself, actually see how it works, personal opinion, but maybe someone else will post more info... Unity is very easy to use for tests, so perhaps you can just do your own...

But yeah, said what I think/know... Hope it helped a little...

Some tests on my non-pro version show terrain has got the basic optimizations (somewhat variable mesh size, LOD, viewport culling):

o Mesh has 1/2 the verts on "flat" areas (set wireframe and look.)

o Drawn in blocks of about 8x8(?) (replace the FirstPass terrain shader and you'll see the "draw blocks." Adjustable distance with the terrain gear.)

o Viewport culling (set Stats while running, walk to the edge of the world and count draw calls.)

o Far blocks drawn with 1/2 the verts (simple stitching) (this is the terrain popping you see as you use height tools), using a single low-res texture pre-built from all of the terrain splats (it uses the Diffuse shader, which takes 1 texture.)

o Near terrain (using the splats) uses one draw call (on each terrain block) per 4 splats. Could write your own "8-splats in one pass" shader, but no way to ask Unity for all terrain splats and two control textures in one pass.