Background Scenery (Low Poly Meshes or Skydome)

Im looking to create a sort of future city but create the illusion to the player its larger than the actual playable level. I was just wondering whats the best method to aproach/ do this?
I know you can use a skydome for great sky effects etc but im talking more background scenery, do you use a large number (depending what look is needed) low poly buildings for example, textured? as they are in the background im assuming detail can be mininal, I was just wondering on perfromance issues using a high number of static meshes?

thanks in advanced :slight_smile:

If they all use really minimal textures, it is possible to batch all the ones with the same texture into a single mesh, saving on draw calls. With low-poly meshes, it's actually more efficient to pack them all into one mesh, rather than drawing lots of small meshes- one 1000 face mesh is cheaper than 10 100-face meshes.

It's okay to use 10 x 100 face meshes so long as they share the same material, because unity will automatically batch them into a single draw call. It will also turn off parts of the mesh that are outside the frustum of the camera (which it can't do if its a contiguous mesh).

@JTBentley: Yea, but dynamic batching uses CPU in order to put the meshes together, which costs CPU cycles. With 1 single mesh, there is no need for that CPU overhead, hence 1 big mesh is still more efficient than 10x100 face meshes with dynamic batching.

Your above describes dynamic batching (10x100 meshes with same material which automatically get batched). That's dynamic batching and it costs CPU. Static batching has to be done manually and doesn't happen automatically. Second, static batching of course requires pro version (3000$ vs 400$)

It's 'manual' in that there's a tickbox involved, yes. If you're using a non-pro version, then yes, one big mesh would be the way to go.

3 Answers

3

If it’s background art, you can probably cram most of it onto a single material (or at least share very few textures between them), and statically batch them.

The easiest way I find for this sort of thing is to make a seperate area entirely with its own camera directly in the middle. Put a script on it similiar to this…

var FPSCam : Transform; // You put your player camera in here
var thisTrans : Transform; // We’ll cache this cameras transform to save getcomponent calls

function Start()
{
 thisTrans = transform;
}

function Update()
{
 thisTrans.rotation = FPSCam.rotation; // So the rotation always matches
}

On your main camera, make sure the depth doesn’t clear, and on your background camera, set its depth to be -1 or so… So now your two scenes are totally independant… Make sure that the cameras don’t attempt to render each others scenery though (you’ll need to set layers to do this).

So, so long as you keep all those background objects to share the same material and you tick ‘static’, they should all nicely batch together into a single draw call.

See I would say the best option is a hybrid of the two. Skyboxes are great for providing lots of detail about the background. The problem is that skyboxes are infinitely far away and unreachable. So the effect falls apart for objects that are just outside of the playable area such as nearby buildings that the player expects to get bigger and smaller as they move around.

So I would suggest making background models for everything within a fairly low distance say maybe 2 city blocks. The idea is that there background images so they don’t need very high resolution textures or meshes, but you want the distance and perspective to feel good on them because they feel like they are just out of reach.

Beyond that, I would make everything a skybox(sky dome) to save resources.

You could steal Source's mentality, and allow the skybox camera to move in unison with the main camera, but divide its movement distance by a factor of 8, so that you still get parallax etc :)

The source engine model is the best solution to this I have ever seen- and it's pretty easy to implement!

Awesome thanks for the response on this one :slight_smile: hopefully this will help a few others out with a similar question