Intro
One of the most important tools in a level designer's arsenal is lighting. Lighting can be used to make the most boring room exceptionally visually interesting. It can be used to send a chill down the player's spine or let them know that a room is safe.
However, lighting is limited in most pre-Portal 2 Source games, because it's static and requires a huge amount of fiddling in Hammer to get your shadows
just right, and of course requires a compile every time you change it.
This is where colour correction comes in. Colour correction is available in every Source2009 onwards Source game, and allows you to change the depth of the shadows, the hue of light, the contrast curves and the saturation of a room in real-time and can be triggered just by walking into a room. It's an incredibly powerful tool and one that Valve have taken full advantage of in their recent titles. Left 4 Dead, particularly, uses colour temperature to subconsciously lead the player to safety as they head towards the warmer areas of a level.
This tutorial assumes you are comfortable in the knowledge of how to create a playable map from scratch, compile it and load it in-game.
With that in mind, it's also a good idea to have a solid idea of the mood you want an area to have before you begin using this tool. Got one? Sitting comfortably?
Good, let's begin.
Step by Step
Start by loading up your scene in Hammer and creating an entity roughly in the middle of the area you want your colour correction.
Either use the drop-down menu or type in the Class field:
color_correction
Then in the properties, change the
Lookup Falloff Start Distance to
-1, as well as the
Lookup Falloff End Distance. This will make the entity global throughout the map, and is what we want while the entity is not configured.
It should look like this:
You'll have to get used to the American spelling, I'm afraid.
And that's all you need to add to the map at this stage, so compile that work of art and load it up in game.
Now open up the console and type the following:
sv_cheats 1
colorcorrectionui
This will open up the colour correction editor
When you close the console, you will be greeted with two windows overlayed on your game. You will also notice that the mouse now controls your cursor again, not your player view. These windows can be clicked and dragged to anywhere on the screen. It's entirely up to you.
In some but not all cases, your screen gamma will have shot right up as well. Nobody seems to be able to definitively say why this happens, but it makes accurate colour correction impossible, so if it happens you should just click anywhere in the "Lookup View" window to fix it. If this doesn't work, reloading the map sometimes will.
Good grief, why is my screen so bright?
Ah, that's much better.
So now you want to make sure the two tickboxes at the top of the Color Correction Tools window are ticked (
Enable and
Enable Entities) before clicking the "New" button at the bottom left.
This will bring up this window:
New Adjustment Layer
Here you can choose from any of the colour correction operations. If you've used software like Photoshop before, these will all be very familiar to you. They are the
Curves Tool, the
Levels Tool, the
Selected HSV Tool, the
Lookup Tool and the
Color Balance Tool
Not sure what any of these mean? Don't worry, you'll find that by playing about with the settings in each that they're all very easy to use.
The
Curves tool adjusts tonal range, either by stretching it or compressing it. This can be done across the entire RGB range, or only to a specific colour. It is an extremely powerful tool.
The
Levels Tool adjusts contrast, brightness and darkness. It can make shadows much deeper, without making the bright spots any darker.
The
Selected HSV Tool allows for incredibly specific editing of colours. You are presented with a thumbnail of the image on-screen, and you can literally select a colour from it to modify. This is also the tool you use if you want to de-saturate a scene. Remember Sin City, where only specific colours appear in scenes, like bright yellow on black and white? That can be achieved with this tool.
The
Lookup Tool allows you to load a pre-existing lookup table. I've never actually needed to use this as I treat each scene I colour correct individually.
Finally, the
Color Balance Tool is the one you'll probably use most. It works very intuitively, and lets you decide how much R, G or B is in the shadows, the mid-tones and the highlights.
Going into more detail would be pointless, as the best way to learn tools like these is just having a play with them.
So, select the tool you want to start with. I'm going to choose Color Balance. You don't have to name it, but It helps with complex scenes. Here's an example of how much it can instantly change the look of a scene. I've selected the highlights radial, and boosted the Red channel significantly.
Now the brightest parts of the map have a pink look to them.
It's worth noting that you can change the shadows, highlight and mid-tones using the same color balance layer, just by switching between the radials. Switching between them won't lose any settings you've changed in a previous one.
When you're happy with the colour, you might also want to change the contrast, so close the colour balance window and click New again in the bottom left of the Color Correction Tools window. This can be done as many times as you want, with as many tools as you want. It also operates under a layers system, just like Photoshop, so you can give certain tools priority over others, as seen here:
Curves1 is at the top of the list, so it is the first adjustment that is made
Once you're happy with the scene, you're going to want to save it. Conveniently, there's a big save button at the bottom right of the Color Correction Tools window just for that.
It'll bring up a standard save dialogue window. Navigate to your game's materials directory (
steamapps/username/half-life 2 episode 2/ep2/materials for example) and create a new folder called
correction.
In that folder, give your colour correction a name prefixed by
cc_ and click save.
Note the cc_ at the start of the filename
Back in Hammer
Now that you have your colour correction settings, go back into the properties of your
color_correction entity and find the
Lookup Table Filename field. In there, you want to point the entity to your newly created colour correction settings. Start with the materials directory, and make sure it has the .raw file extension on the end. Mine was
materials/correction/cc_redbluecontrast.raw
It's important to keep the file extension
You might notice in that screenshot that I've also changed the
Lookup Falloff Start Distanceand the
Lookup Falloff End Distance fields. What these do is tell the entity where to start fading in to your colour correction, and where it's at its strongest. Literally it means where the colour correction is
falling off.
Changing these values will also change the size of two spheres surrounding the entity, most visible in 2D views.
The space between the two rings is where the colour correction either fades in or out
You can more easily change the sizes just by dragging these circles. If you invert them so that the
Lookup Falloff Start Distance is the larger circle, then everywhere
except the area in the circle will be affected by your colour correction.
If you keep the values at
-1, you can also trigger the colour correction by an event using any of the standard Hammer triggering methods.
Save and compile, and hopefully you'll end up with a much improved scene.
There's more emotion in this area now
Comparison