1. The basic principle
of the 'sky box'
 |
As the the headline is saying this
part is becoming more theoretical and if you are not interested
in the basic principle of the sky then hide over to the more
practical part.
First of all since we're talking about sky we've to define
the directions. The top of of your XY-screen will be north
the right part east and so on. Now we come to the 'sky box'
which is like a cube around your level which each wall covered
with one of the env pictures (you find them in your *.pak
file under gfx\env\ ). This virtual 'sky box' is bigger then
your original map in order to make it more realistic (so that
you get the feeling your looking in a real sky). So the sky
texture marks only the brushes which become |
something like a window to the sky but later more. Back to the env
pictures you will notice that they all have a basic name and then
different endings like dw, up, rt, lf and so on.
In order to show you which ending belongs to which direction look
at the next four pictures:
| |
 |
 |
 |
 |
|
North = BK (back)
|
East = RT (right)
|
South = FT (front)
|
West = LF (left)
|
|
|
But in order to cover the sides of a cube you need four pictures
for the surrounding and two pictures for the bottom and the top.
If you now combine all these pictures to an opened up cube you will
get this picture:
 |
Now on the left you can see the
sky how it will look in a perspective. You're level would
be exactly in the middle of this cube with enough space between
the borders and the walls of the cube. This virtual environment
will only be seen through the parts with a sky texture. So
when you're using the sky texture the compiler will make these
brushes to some kind of window to the virtual environment.
You can enlarge this effect of a high sky by making sky texture
walls and then a ceiling.
So this was the small theoretical part of the tutorial. In
the next paragraph you will get some info about the light
environment and how to influence the shadow effect.
|
2.
The light_environment and shadows
 |
First we come to the entity which
is responsible for the light in your outdoor levels. This
entity is called light_environment and must be put next to
the brush with the sky texture. You also need only one light_environment
for each group of brushes with the sky texture (Only if there's
an interruption you have to put in more then one). After putting
it into your map you have to define the incidence of the light
and it's color. To control the incidence of you light you
have to angels, one is responsible for the horizontal angle
(key: angle) and the other one control the vertical angle
(key: pitch). So with these two angles you can define every
incidence you want (important: since the light should shine
from up to down you always need a negative pitch |
value). Also you should look to the env pictures you are using in
order to find out the roughly angle of your sun! The next thing
you have to do is to find out the right color. It will be stupid
mistake if you have a warm yellow sun and you take a white light
color. So the best way is to open the env picture with the sun in
your graphic application and to check the RGB value of it. For example
the sun of the desert env picture has the
RGB
value of:
255 255
255 now to make it a little more realistic
you can make the color a little bit warmer the
RGB
value will then be :
255 253
222 which gives your outdoor level
a warmer touch.
At last we come to the shadow effect. All worldspwan brush (these
are all brushes which are not entities) will draw a shadow. To control
the shadow you have to change the negative pitch value. A high value
around -70 degrees will mean that your light will shine very vertical
and there won't be any good shadows. The opposite a very low value
like -10 degrees will mean you have very long shadows and only small
sunny parts. In order to find the right size of the shadows and
also the right value and color of your light you simply have to
try it out.