Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So, I'm starting work on a project soon that will require me to create realistic environments that can preferably run on PC's besides high quality ones. The goal is to get as real an environment as possible while still being easy(ish) to run.

The only problem is I've NEVER done anything with 3D environments, making trees sway, grass move, lighting, etc. Can anyone give me any help? Perhaps describe how it's done? Link me to articles? I'm just looking to be pointed in the right direction, not for you to write the code for me.

Any help at all would be greatly appreciated, I'm using Unity3D and C# as my language.



share|improve this question
up vote 0 down vote accepted

3D environments

You can sculpt the basic ground terrain with Unity's Terrain tool, but beyond that you need to model complex objects in a 3D modelling program, then import them into Unity and place them within a scene. How to do 3D modelling is beyond the scope of a question like this. Alternatively you can sometimes buy the models pre-made from the Unity Asset Store.

making trees sway, grass move

Unity can do this for you, if you place trees and grass with the Unity terrain editor. There are various parameters to let you specify how much you want things to sway. This requires you to place 'wind zones' in the level.


Lighting is as complex or as difficult as you want. To get started you can make sure all objects have shadows turned on, then add one directional light for the sun (make it yellowy-white) and then add an ambient light to lighten the shadows. It won't win any prizes but it's a reasonable starting point. More realistic lighting can use a variety of different tricks, such as multiple directional lights, lightmaps, ambient occlusion, more complex shaders, etc etc - which to use and how would be a question in itself.

share|improve this answer
As for the models, there's a 3D artist working on this project that will do any models we need. - If I had the 3D modeler create the trees in a modelling program, and imported trees in to the game, could I still affect them with wind zones and such? - Thanks for pointing me in the right direction for light, I'll probably look up more on how to get a realistic lighting environment. – Timothy Williams Mar 20 '12 at 15:37
No, you need to create the trees in such a way that they're compatible with the Unity tree engine - because they're effectively animated objects. – Kylotan Mar 20 '12 at 15:46
Hmm, so is there any way at all to create trees with an external program that would be compatible with the Unity tree engine? Can you actually use Unity as a 3D modeling program and create trees with it? Or are all the trees pre-made assets? – Timothy Williams Mar 20 '12 at 17:38
I believe you have to use the tree creator, which is not exactly a 3D modelling program but which lets you define a tree's properties. – Kylotan Mar 20 '12 at 19:37
I read up on it, the tree creator should be usable. And by Unity's Terrain tool you meant the Terrain Toolkit, right? – Timothy Williams Mar 20 '12 at 19:45

One of the easiest performance balance tricks is to limit the visible distance of older machines with fog and use of billboards. If you have a high end PC you can have all the trees be actual 3d objects, but by having a check in your software, such as which shader level is available, on an older machine that is using an older shader API, you can set your engine to that the trees closest to the player(of the older PC) are 3D, the trees in a mid-range area are billboards (two images of the same tree configured in a perpendicular pattern "a cross", to give the illusion of a 3D tree using 2 static images), and the trees in the background could be incorporated into your sky-box texture. Then start using the fog effect on your mid-range billboard trees. It will give the appearance of the engine the high end PC will see but reduce the shadow and light calculation processing that would bog down an older machine. As for movement in trees and grass, remember that those conditions should only occur within the player's line of sight (if the player can't see it - your not required to display or calculate it.)

share|improve this answer
Hmmm, thanks, I'll talk about this with the dev. This could be a useful trick to get it to run on a lot more PC's. – Timothy Williams Mar 25 '12 at 15:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.