Introduction
This tutorial is going to focus on using textures to light your levels in Half-Life 2, using the Hammer editor. I am going to be assuming that you know how to make and compile a map for HL2. If any of this confuses you, check out the links in the Source Resources section. I am going to discuss lighting in Source, how to start using texture lights, and several ways in which I use this method.

About Lighting in Source
The Source engine uses lightmaps on BSP geometry, baked vertex lighting on static props (it could possibly be dynamic), and dynamic vertex lighting on movable props. This means that once your map is ready, you will need to compile the lighting. It uses radiosity, so you will have to keep this in mind when you are setting up the lighting, fill lights may or may not be needed. It is also possible to use HDR lighting. This can create glows, blooms, auto-exposure, and a whole bunch of different effects. The main one to keep in mind when lighting is the auto-exposure, you can get a much wider range of lights and darks in your map without worrying about blowing an area out, or having solid black areas. The basic lights in Hammer are the point light, spot light, environment light (sun), and dynamic light. These are quite useful in most situations, but there will be places where you’ll be left wanting something different.

Texture Lights
This is where using textures as lights comes in. To use them, you will need to pick a texture that has an entry in the lights.rad file located in the main folder of the mod you are using. For HL2, some sample ones are “lights/white001, lights/white002, etc”. Apply one of these textures to a brush, and it will light the area around it up, like an object light. The larger the object, the more light it will give off. Below is an example of putting the lights/white001 texture on a box. It also uses HDR, which is where the glow comes from.
Cube Light

I have found that lighting like this seems to work better with dynamic props. I had tried using the environment light for my factory, but I was getting some odd things happening, like this:

Lighting Problem 1

I tried a bunch of different ways of lighting it, including spot lights, but the only one that worked consistently was texture lighting. It seems that Source has a hard time finding the shadow boundaries with the other methods of lighting. This wouldn’t be a problem if you weren’t trying to make a dark factory with only small windows being the only source of light.

Texture Lights for Windows
One of the best ways to use this method is for windows. You don’t have to worry about which way the sun is facing, you will always get some nice light coming into the room. If you were to just put the brush with the texture right outside the window, there will be no direction to the light. This can be useful if your sky is supposed to be overcast. Below is how to achieve that effect. The idea is to think in terms of area lights if you are only seeing one side of it.
Window Setup 1 Window In Game

Light Shafts
If you want to make it look like your light is coming from a direction, you will have to make a sort of tube for it to travel through. You will need to make a hollow shaft with a non-lighting texture. I usually use lights/white. It is a solid white texture, with no lighting information. This way you still just see white when you look, but it won’t be adding extra light into the scene. Below is the way to set this up. The pink parts have the non-lighting texture applied. You will need to make this a completely enclosed area and stick the open part against the opening in the wall. This setup will prevent the light from shining directly on the ceiling, and make it appear to come from an angle. You can also have the shaft go at an angle from left to right, to create the angle going that way.
Light Shaft Light Shaft Results

Making your own Texture Lights
Making a texture light is quite simple. There are three parts to it, the texture itself, the material, and the entry in the lights.rad file. For the texture, you can use almost anything you want. It can be solid colours or designs, such as detail on a light fixture. The material will need to be a lightmappedgeneric, with this flag in there: “$selfillum” 1. The lights.rad file is a plain text file that sits in the main folder of the mod. This is the folder with the maps, models, materials, etc subfolders. If there isn’t a lights.rad there already, make one. You can do this by making an empty .txt file and renaming the extension to .rad To add an entry, you need to enter the texture’s name, without any extension, then 4 numbers, which are red, green, blue, and intensity. Here is an example:

lights/white001 250 240 205 100

This would make an orangish light, with an intensity of 100.

Source Files
Here is a little package with the files I used in the tutorial. Put this into your “half-life 2 episode one” folder. It should also work for HL2, just put the files in that folder instead. If you already have a lights.rad, just add the line in from my file to the file you have.
http://www.simonbarsky.com/lightingTutorial_files.zip

Conclusion
Well, that wraps up this tutorial. Hopefully I’ve covered enough to get you started with texture lights. If you have any more questions about texture lights that you think should be covered in this tutorial, please let me know.