How to use the sun(s)
This tutorial will walk you through the process of creating a map with working suns. You can download the reference map to see what the final result should look like. In this tutorial, I will describe three different methods for aiming. Once you are become accutomed to the aiming methods, you can use whichever method you find the easiest.
To start, we must have a map. Open up your favorite map editor and create a new map. Let’s make a floor. Pick your favorite floor texture and make a floor brush, 512 by 512. Surround it by walls 128 units high. Make sure that the walls all meet to make a square.
Now switch to the the sky texture and create brushes that go up another 128 units and seat against the outside of the walls. Cap it all off with a ceiling. It is important to remember that you should not have any sky brushes on the same plane as any of your other world brushes if they are not blocked by another brush. If a sky brush and a world brush are on the same plane and there is a brush blocking their line of sight to each other, it is okay, but if there isn’t a brush blocking their line of sight, you may get unwanted results.
Select all of the sky faces that will be seen within the level and apply a light value of 50 (select the light flag and add a value of 50). The actual light value is not important as long as it is over a minimum value. Fifty is a good safe number.
Now lets deal with the sun. The first definition method we will use is the angle definition. Although this may be difficult to understand at first, I find it to be the easiest way to aim a sun. Define your _sun_angle key as follows:
“_sun_angle” “315 -45”
See the tutorial on pitch and yaw for an explanation of the angles.
To define a brightness for the sun, we enter a _sun_light value.
Give the sun a color. We will be using really ugly colors for the purpose of this tutorial for purposes of clarity. Define a _sun_color value of 1 1 0 for a 100% yellow sun.
“_sun_color” “1 1 0”
Let us define an ambient shadow value. The ambient shadow can be defined in one of two ways. If you only define a single value (“_sun_ambient” “50”), the color of the shadow will be defined by an average of all of your suns. If you define three values, one for each color, then you will override the ambient color with the one you enter. If you use the second method, each value entered will be the intensity of the color.
“_sun_ambient” “10 10 10”
The above value overrides the default shadow color with a brightness of 50 red, 50 green, and 50 blue, resulting in a value of 50 white. Notice that, unlike the _color value, the _sun_ambient value is an absolute measurement of the light intensity. A value of 50 entered will return an absolute texture brightness of 50.
The first sun has been properly created. You may compile the map now to evaluate the results, or go on to the second sun.
For the second sun, we will use the conventional aiming method. Create a light entity. Add the keyvalue pair:
The target’s name is not important. It just needs to match the targetname of the info_null you are about to create. Create an info_null that is one grid unit left and one grid unit down from your light. If your light were at an origin of 64 64 64, and your grid is set to snap at 16 units, then you would place the info_null at 32 32 32. Set the info_null’s targetname
With that out of the way, it’s back to the worldspawn we go. To define your second sun, we will use the _sun key. Since this is the second sun, we will substitute _sun with _sun2. You can substitute _sun2 _sun3 or _sun4 for any key with _sun in it except _sun_ambient.
The _sun and _sun_target keys do the same thing. The value that follows the _sun key is the targetname of the info_null.
We shall make this sun red with a brightness of 500