Colors and Lighting – the Science Behind

A picture is worth 1,000 words, so here are quite a few pictures to show what difference lighting can do for your level. I won’t be showing you how to do lighting in this particular article, but by the end of it you should have a better understanding of lighting in the Source engine and how it works. By the way, if you’re getting this problem, it’s nothing to do with the lighting- it’s to do with the cubemaps in your level. Look up my tutorial on that instead. If you choose the ‘3D Lightmap Grid View’ in Hammer, your map will turn into a load of squares. When you compile your map, it calculates how bright each of these squares is.

light and colors

Obviously, the more squares there are,the longer it takes to compile your map… and the larger your map’s file size will be.You can change the light map scale in Hammer. The number shown is the number of units across each square is. Smaller values mean more detailed shadows, but your map’s file size will greatly increase, and it can cause strange artifacts and problems, particularly if done across a large area. Before compiling your map you have a choice of which setting to set RAD to. If you set it to ‘No’, your map will have no lighting. If you set it to ‘Fast’, it will have ‘bad lighting’ and if you set it to ‘Normal’, it will have normal lighting.

Personally, I can’t see much of a difference between fast and normal, and I’ve done a couple of tests.here are my results. However, the general consensus is that normal is better, so I suggest you just put up with the wait and get some one to make you a sandwich. Light go round corners, but it can bounce off surfaces. Here is an extreme example of a brightly lit orange wall making the shaded wall glow orange. Newer games can do this in real time, but for Source, it’s all calculated when compiling your map.

Because Source calculates lighting when you compile your map, it doesn’t need to do so in-game, leading to higher frame rates than in games where lighting is calculated in real-time. However, because of this you can’t attach (or parent) lights to moving objects in Hammer, and the number of flashing or toggle able lights you can have in a particular areas is limited. There are certain lights that are dynamic to a degree, but they don’t tend to look that good and may lead to problems. Here you can see examples of point_spotlight and env_projected texture entities.

Obviously the best way to learn is to do it yourself. However, I’m going to give you some advice. Putting loads of different colored lights in a room ends up looking horrible and messy, and some times, the fewer lights there are, the better. The aim of lighting isn’t to light everything up like a Christmas tree- it’s to make maps look better more realistic by having darker areas. It’s also quite artistic. The general idea is that certain colors look nice together. For some examples,try watching films like the latest Harry Potters. Compare them to the older ones and you’ll find that the lighting is more uniform, with entire scenes being in one or two main colors. This can be used to make things look more stylized and professional.

Color correction is a large topic and there are ways of changing the lighting in your level much like you would when editing a frag video in a video editing program. However, for now, I’m just going to say that you should try and pick a suitable color scheme when selecting your textures. Green is sickly, red is for anger or alert. You can also contrast colors.

Hopefully this article has helped you to question colors, study shadows and has given you a justification for watching Harry Potter. Don’t forget to point out every interesting shadow you see to your friends and how real life could look better if everything was yellow. Your friends will really thank you for it later.