tutorial

making terrains

part 3, lighting, atmosphere and others
It's time for the final installment of this tutorial series on creating terrain. First I showed you a technique for modeling terrain. Next I showed you a few techniques useful to texture your model. Now we'll complete the process by setting up lights, atmosphere and taking care of other minor details.

a note
One of the things I talked about in the first tutorial was terrain mesh resolution. To work quickly on this scene I jumped down the terrain's modifier stack to the base Grid object's parameters and set the segments to a much lower value. This way you'll get better feedback in your viewports and faster render times.

atmosphere
image1
viewport
gradient
image2
image3
image4
The first really simple yet very critical step is adding fog for depth cueing. Go outside and look into the distance. One thing you'll see is that the farther things are away, the less saturated and more washed out they seem. Light waves are attenutated by the air molecules. This depth cueing is one effect that Centropolis really nailed in the Independence Day movie. Was I the only one who noticed how believably those saucer ships faded into the distance? To do this with your scene in MAX, just add Fog. Two things to keep in mind. One, make the color of your fog closely match the color of your background. If you are doing a blue sky, go with a very light, almost white blue. Two, the scale of your scene will greatly effect the fog in your scene. Start with the default settings of 0 for Near and 100 for Far, then start moving the Far setting lower to reach the proper result. I usually use fog background too, but if the fog color is similar to the background color then you don't really need it.

skydome
We need build the sky in a couple of stages. Start with a sphere primitive and drag it out so that it encompasses your entire scene. Next, set the Hemisphere value to 0.5 so that you flatten out the bottom of the sphere and line it up below your terrain slightly. I also suggest squashing the sphere down a bit so that it doesn't have so much altitude. Think of your terrain as a section of the planet and you need to build a sky layer with a slight curvature. Finally, flip the normals of the hemisphere with the normal modifier. This will let us shine light into the environment from the outside.

Creating the texture for the skydome is pretty simple. I created a 100% self-illuminated material with a gradient in the diffuse map slot. The gradient tool lets you blend three colors to create a single texture. Digimation also makes a freeware gradient map that gives you more control, but the standard one will do for now. The colors of the gradient aren't important, it's up to you. I wanted a dusty worn look so I went with shades of brown and orange. Once you assign it to the skydome mesh, you need to apply mapping coordinates. Use a cylindrical UVW map and scale the gizmo up a bit so that the top overlaps the top of the mesh. The reason for this is that we want to map the gradient from the top to bottom, but also want it to wrap around the mesh. If your gizmo lines up with the mesh perfectly, you'll get either a seam or unwanted artifacts near the top of the mesh.

background clouds
Now let's add some clouds in the distance. One way to do it is to apply noise maps to the color slots of your gradient material. But let me show you a more controllable way. Select the hemisphere you're using for the skydome. Clone it either by shift-click or from the menu bar and rename it Clouds. Now, select the Uniform Scale icon and depress it, then right-click over it. This should bring up numeric entries for scaling this mesh. Just adjust the Offset to 95%. This will slightly scale the mesh inward. From there we need to make a cloud map that we'll use to blend in with the skydome.

Go to the material editor and create a 100% self-illuminated material. Make the diffuse color whatever you want your clouds to be. For this example I just went for white. Now assign a Noise map in the Opacity slot. The size of the noise map is important but really up to your aesthetic sense of what they should look like. Keep in mind that if you use XYZ, the noise will be mapped based on world coordinates and the scale of your scene will play a big part determining what size you use. If you use UVW, you are basing the noise on the object coordinates. This can be a little more flexible, but be sure to start with a value less than 1. A value of 0.5 is a good start as 1 is equivalent to the 1 times the scale of the mesh. To get decent looking natural clouds I suggest using Fractal noise with a levels setting above 3.

volume fog
The next atmospheric thing I did was add some volumetric fog. The idea here is to busy up the upper portion of the skydome and break up any discernible patterns. To do this, I added a BoxGizmo atmospheric apparatus and made it stretch out and overlap the top of the skydome, but also let it drop down into the scene a bit. The look of the volume fog is up to you. There are so many settings to choose from. The most important thing I adjusted was the color and density. Also, using fractal noise is important because you'll want this fog to blend in with the background clouds you made earlier.

lighting
The last and one of the most important things is lighting. First off, I wanted to simulate a sun in the sky so I added a Target Direct spotlight. Why not a regular spotlight? Well, Direct spotlights cast parallel light rays, similar to a distant source like the sun. You just need to make sure that your hotspot and falloff are large enough to encompass the scene. The angle that you set the light up at is dependent on what time of day you are considering. The closer you get to mid day, the higher in the sky the sun gets. But keep in mind, if you want to make an alien terrain, you can add more than one sun, perhaps from a binary star system. This is not the only light we're going to use, but it will be the main light, so set the multiplier slightly higher than normal, say 1.2. The color of the light is also important. I used an orangish-yellow shade. Finally, set it to cast shadows and ramp the sample range to 20. If your scene is too big and you're not happy with the shadows being cast, try making a larger sized shadow map.

image5So now you know where your light is coming from, it's time to add some other lights to balance the scene. These will be non-shadow casting omni lights with varying levels of strength. First, I added one directly opposite of the direct spotlight, gave it some altitude, made it a darker color and brought the multiplier down to 0.4. Next, I added two omni lights to the left and right of the first, but these have a lighter color and are slightly stronger. This is just one idea. There are so many ways to do this, it's really up to you how you want to do it. Remember, technically correct is not aesthetically correct. If say you had some spaceships flying through these mountains, you might also add an underneath bounce light that excludes the terrain but slightly lights the underside of the ships. This would fake some of the light scattering that happens in real life. Maybe global illumination renderers will help solve some of these issues. The very last thing I did was go back in the terrain's modifier stack and bump the resolution of the grid to a more refined larger number.

That's it for terrain. If you have questions, please email me. Remember, these tutorials are only for learning techniques. How you apply them is up to you. They should point you into the right direction and force you to do things differently then you'd do normally. That's one of the best ways to learn. Have fun and keep creating!


Brandon Davis is the producer of ParticleFX (www.particlefx.com), a web resource for 3D Studio MAX users, and can be reached by email at brandon@particlefx.com.


[ galleries | archives | downloads | about | contacts ]
[ back to main page | back to contents page ]