For outdoor areas, light_environment is the only light entity that will simulate sunlight or moonlight. We'll cover the outdoor environment in more detail later, but let's introduce you to the skybox texture first. Without a skybox texture in your map, light_environment by itself does not work.
Setting the Skybox Texture
In order to make an outdoor area, we'll have to texture the entire ceiling brush with the skybox texture. This is very important.
If you just textured one of the six surfaces of the ceiling brush with the skybox texture, the light_environment would not make the skybox texture surface emit light. Open up the Texture Browser, and type "sky tool" into the filter. You should spot a light blue texture called "tools/toolsskybox" as shown below:
 tools/toolsskybox texture |
Pick this texture, and texture the ceiling brush of the bigger room with it (apply current texture hotkey:
Shift-T). Remember, you must select the entire brush first, and then apply the texture. Texturing just one surface of the brush does not work. We should also remove the simple light entity in that room. Otherwise, there would be a simple light entity floating in midair in our map.
Next, we need to choose a specific sky texture, so the map knows what kind of sky we want (i.e. morning, dusk, night, etc). The process isn't very intuitive, because this is one of the few occasions we actually need to access the setting from the menu system.
Click on "Map" from the menu, and then choose "Map Properties...". Select the Skybox Texture Name field in the dialog box. We need to change the default "sky_wasteland02" and type in the name of the sky texture we want, whether it's morning, high-noon, or dusk. How do you know what the sky textures look like? Conveniently, there is a
nice reference of sky textures at the Valve wiki for this purpose. It's much easier than the old days, when I had to load up each sky and compile the map, and look at the sky in-game. I started mapping for the Source engine as soon as Half-Life 2 and CS: Source were released back in 2004.
So, it's a matter of browsing the sky textures and typing its name into the Skybox Texture Name. At this stage of mapping, we need to think about the time setting for the map. I want to make our example map set in the late afternoon, so let's pick the "train" sky texture for this map.
Adding light_environment
This is the first time we'll venture into what I call the art of mapping. As your homework assignment, I suggest you paying special attention to the color and angle of the sunlight at various times throughout the day. You'll notice that at dawn, the light is yellow and very soft. Late afternoon often has a harsh whitish light, and the angle is relatively perpendicular to the ground. Dusk has one of the most beautiful light. The fading sunlight varies from orange to fiery rose, and the angle is very low.
Since we have already selected a sky texture that looks like the late afternoon, we need to set the corresponding light_environment setting so everything correlates and your map looks realistic. The light_environment entity basically transforms all the sky texture in your map into light-emitting textures. The light rays that shines from the sky texture are all parallel, mimicking a light source from very far away (i.e. the Sun).
We'll pick the Entity Tool (
Shift-E) and select the "light_environment" entity. We can place the light_environment entity anywhere in the map. The actual location of the entity is arbitrary. Keep in mind that the light_environment entity does not emit light itself. Instead, it sets the parameters for the light-emitting sky texture in your map. As long as it is inside our enclosed map, it'll work with the sky texture. I prefer placing it near the top of the map, because the top of the map tends to be less crowded by models and other things on the ground.
 Placing light_environment |
Change the brightness setting of the light_environment to "255 250 234 700". Don't be afraid to experiment with the settings in your other maps, as long as it looks appropriate for the corresponding skybox texture in the map.
We will change the pitch of the light_environment entity to the recommended "-57" (see the Valve sky texture reference), and the ambient brightness to "98 129 179 500". The pitch controls the angle of the sunlight, and the ambient settings control the color and brightness of indirect daylight reflected in the atmospheric particles. This indirect light is the light you get from your window on a cloudy day.
Lastly, we will set the angles of the light_environment to "200". The angle is set either by typing in the number of degree or by dragging the radar-looking black disc on the right side of the properties box. The angle determines the direction of sunlight in the map, and the angle in degrees is just like what you learned in trigonometry (and you thought math is useless). The default is 0 degrees, which means the sunlight will be shining directly toward "East" in the x/y view. An angle set to "200" will make the sunlight shine approximately toward "Southwest" in the x/y view of the map.
Okay, we're all set. Let's save our changes and compile the map. Get ready for the wonderful outdoor area in the map.
And for extra credit, try to see whether you can extend the indoor section of the map beyond the small room (HINT: Clip the ceiling brush of the large room and re-texture it with the indoor ceiling texture). Also, add a door frame to the wall separating the indoor and outdoor areas (door with dimension 128x96). If you succeed, your map should look like this:
 Extra credit mapping |
Tip: If you haven't noticed by now, you can measure the dimensions of brushes by using the Select Tool. Just drag out a measurement in the 2D view without actually selecting a brush, and the unit measurement will be displayed next to the brush. This may be a good time to review the
Dimensions and Scale in Hammer, if you haven't done that tutorial already.