Portal 2

Portal 2

46 ratings
How to colour-correct a Portal 2 Map
By evelyncarnate
Colour correction in Portal 2 is uniquely challenging when compared to the process in other Source games. I couldn't find any online guides covering the process in enough detail, so I worked it out for myself and have presented my findings here.

This guide includes detailed instructions, plenty of tips and tricks, and a healthy number of screenshots and practical examples, all from my most recent map which used colour correction heavily.
2
3
   
Award
Favorite
Favorited
Unfavorite
Introduction
Colour correction can be a beautiful finishing touch to any map. It can be used to increase the contrast, or to make the shadows and colours really pop. Colour correction is probably the boldest way to set your map apart from others on the workshop.

It can also be used to tint the entire thing in bright, over-saturated purple, if you’re a fan of Hotline Miami.

It’s sad, then, that the process of actually colour-correcting a map is so tedious and unintuitive - even more so than in other Source games.

Thankfully, in my lengthy time using Hammer and learning about the game, I have gradually worked out how to do it. Since I couldn’t find an existing guide covering this, I thought I’d write it all down here myself, so that it doesn’t have to be this annoying for anyone else (and also so I have somewhere to refer back to in a few months when I’ve forgotten how to do it again).

All the screenshots in this guide come from my most recent and most garish map, 'The Cube Stacking Glitch':
https://steamproxy.net/sharedfiles/filedetails/?id=1806247420
Setting Up
Before you start, you’ll need a few things:
  • Portal 2, correctly installed.

  • A map, in its finished or nearly finished state (at least have the textures and lighting more or less finalised) and compiled. Preferably this would be with ‘final’ compile settings, but if your map is enormous then remember that this won’t be your actual final compile.

  • Right-click on Portal 2 in your Steam library, click on ‘Properties’, then click on ‘Set Launch Options’. In the dialogue box, type “-tools” (without the quotation marks).


Opening and using the Colour Correction UI
Launch Portal 2 and load your map using the “map [your map name]” command in the developer console.

Once the map has loaded, hide your HUD and get into a position where you can easily see the part of your map that you want to colour-correct (or just any part of the map that broadly represents the whole thing, if you just plan to colour correct it all the same).

Now, open the console again and type “colorcorrectionui” (Remember to use the American spelling: ‘color’ not ‘colour’). As long as you launched Portal 2 in tools mode (by typing “-tools” in the launch options), you should see a couple of windows open:



Using the colour correction UI is simple enough to anybody who has used Photoshop or other image manipulation tools before. All the same, I’ll briefly run through all the relevant buttons you can press and what they do. To make sure you are able to see the effect you’re having, make sure to tick the “Enable” box.

In the main dialogue box, you must first click “New” to add an effect – like an adjustment layer in Photoshop – to your colour correction list. Clicking “New” will open a small dialogue box somewhere on your screen where you can choose from a drop-down menu which adjustment tool you would like to use.



Your options are Curves, Levels, HSV (Hue, Saturation, Value), Lookup, and Colour Balance. I will now give a brief explanation of each of these tools and how to use them, but please bear in mind that I am not an expert, and it’s been years since I last used Photoshop. In general, I would recommend experimenting and playing around with sliders to get the effect you want. If you ruin anything, simply delete the adjustment layer with the “Del” button and try again. If you want to know more about the specifics of any of these tools, a simple Google search should do the trick.

Curves

The Curves tool lets you move a line around on a graph to change the contrast and brightness of your level. I usually use a curve that looks something like this, as it creates a nice contrast and gives proper black values and bright colours in most cases:



Unless you have a specific effect planned, I would recommend only making subtle changes to the curve.

Levels



The Levels tool allows you to fiddle with the strength of each (or all) of the RGB channels, and can be used to recolour your map or to alter the contrast further.

Selected HSV



With the drop-down menu at the top, you can select which parts of your view should be edited. Anything tinted red in the small window is selected. You can then alter the Hue, Saturation, and Value (a little like brightness) of the colours selected.

If you set the Saturation to -255 and use the Curves and Levels tools to improve the contrast and brightness, you can achieve a very appealing Noir filter:



Lookup

I have never used or needed to use the Lookup tool, but it appears you can load pre-existing .raw files into your new colour balance table if that’s something you need to do.

Colour Balance



This allows you to balance the colours present in your map in the shadows, midtones, and highlights (picked with the tick boxes underneath the sliders).

Some general tips for the UI
  • The ‘blend factor’ slider in each menu defines how heavily each adjustment should affect the final image.

  • The strange symbol next to all the available adjustments in the main dialogue box can toggle the visibility of that layer, like the eye button does for Photoshop layers.
How to save your Lookup Table correctly so it can be used
Once you’re happy with how your colour correction looks, you will need to save the lookup table so you can implement it in Hammer (The other window that’s open by default shows the lookup table you’re making – this is what the computer uses to actually correct the colours – and we need to save that as a .raw image file).

Along the bottom of the main dialogue box are two “Save” buttons, but we need to use the “Save As” button (this may have been cut off so may just look like “Save…”).

This is by far the hardest and most confusing part of creating colour correction in Portal 2. It seems as though it was designed to prevent you from succeeding. I'm not bitter

First, with the save dialogue it looks like you can only create .vcc (Valve Colour Correction) files. The .vcc file format is what the colour correction UI reads if you wanted to load it back up to edit it in future (a bit like how the .vmf file is the editable map file that Hammer reads), but to actually add the colour correction to our map using Hammer we need the .raw file (just like how you need a .bsp file to play your map in game).

If you look this up, as I did, then you will find that the .raw file should be created automatically, but in order to have that actually happen, you MUST NOT save the .vcc file in the default location. The default save location is in Steam/steamapps/content/portal2_dlc2 or whatever your highest dlc file is (some people have dlc3 for some reason).

Saving the .vcc file here will not result in the creation of a .raw file.

In order to ensure a .raw file is created, set the save location to be in Steam/steamapps/common/Portal 2/portal2/materials/correction.

I would also recommend using the standard naming scheme “cc_[your map name]_[any additional information, for example if you were using multiple colour correction entities in your map]” (eg “cc_columnblocker_main”). It’s entirely possible that the “cc_” prefix is necessary for the colour correction to work, knowing Valve. Even if that's not true, you should stick to standard naming schemes for easy readability and good practice. and style points
In Hammer
Once you've confirmed that you have correctly saved a .raw file, the hard part is over. The process of getting it to work in Hammer is not complicated.

There are two main colour correction entities in Hammer but in this guide, I will only focus on the first and most useful: the ‘color_correction’ point entity (again, using the American spelling). The other is the ‘color_correction_volume’ brush entity, which I have never used or needed to use.

Place this in your world and give it a well-thought-out name.



There are a couple of other properties you should worry about:
  • ‘Lookup Table Filename’ is the path from the portal2 folder to the .raw file we saved earlier, and it will always follow the format 'materials/correction/[your lookup table name].raw' (eg materials/correction/cc_columnblocker_main.raw). Make sure to include the .raw file extension.

  • ‘Lookup Fallof Start Distance’ and ‘Lookup Falloff End Distance’ define the distance from the entity that the player starts to experience the effect and the distance at which the effect is at full power. Set both to -1 if you want the effect to be visible everywhere, as I have in this map. If you only want the effect to be visible in certain areas then place the entity at the centre of this area and set the two distances accordingly, or use a trigger volume system to enable and disable it.

  • ‘Lookup Fade in Duration’ and ‘Lookup Fade out Duration’ define the time, in seconds, that the effect will take to fade up to or down from full power if enabled or disabled using an input.

  • ‘Start Disabled’ does what it says on the tin. If you set it to ‘Yes’ then remember to enable it with an input at some point in the map, for example with a trigger brush.

  • The 'client-side' flag is only relevant if you're making a co-op map, as single-player maps are not dependent on a server.


Final tips
It’s easy (and fun) to go overboard with colour correction, but try not to compromise the user experience. It might make for pretty screenshots to make all the blacks very black and all the colours pop, but if it hurts your eyes to play or conceals information in a puzzle, then consider toning it town a little.


(Two extreme examples of what I would consider to be colour correction compromising the user experience)

Additionally, remember that changing the hue in certain ways can alter the colour of test elements like antlines, which can be confusing as they may appear to be activated when they are not.

One thing I encountered but cannot explain is that the lookup table somehow became corrupted and caused my entire screen to go black when I tried to play the map. The solution to this was simply to remake the lookup table from scratch.

The ent_fire console command can be used to turn the colour correction on and off from within the map. I found this useful when using colour correction for a subtle contrast boost just to confirm to myself that the colour correction was working. If your colour correction is very garish then this may not be a problem.

Before submitting your map to the workshop, please remember to pack the colour correction lookup table into your .bsp file! Pack the .raw file, and maybe also the .pwl.raw file just to be safe (the .vcc file is not needed).
20 Comments
Dumpster boy 10 Oct, 2023 @ 5:44pm 
it's spelled color
broken-record 14 May, 2023 @ 12:11am 
This is really handy! Bookmarking this for later.
Daddy Sparky420 22 Jul, 2022 @ 2:54am 
btw i fixed the issue in VIDE i had to make sure to put the custom path as : /materials/correction/
Daddy Sparky420 21 Jul, 2022 @ 2:50am 
the file has grown from 24 602 kb to 24 698 wich is exactly the file size of my .raw so it's like it got added to the bsp but yet when i start the map without my .raw in my materials/correction it still says in the console the same message that it's missing from the folder i removed it from as if the game was desperatly trying to get it working from there
Daddy Sparky420 21 Jul, 2022 @ 2:27am 
did i do anything wrong in the "cubeovergoo.txt" wich is thenameofmymap.txt that i also used to pack my custom music wich worked perfectly fine everytime materials/correction/cc_cubeoverg.raw
D:\Programs\steamapps\common\Portal 2\portal2\materials\correction\cc_cubeoverg.raw
Daddy Sparky420 21 Jul, 2022 @ 1:36am 
it almost feels like the .raw shouldn't be saved in portal 2/portal2/materials/correction
Daddy Sparky420 21 Jul, 2022 @ 1:33am 
still didn't work although i manually packed it inside the bsp with VIDE tried to pack only the .raw then tried to pack the .raw + the pwl.raw the tried each 3 turns out as all tutorials said i only the .raw because if i had only that file in materials/correction i can see it in game once i delete the file from the material folder it doesn't show it's like it's not a part of the BSP for odd reasons here is the message i get in game in the console : CColorCorrectionSystem : missing file "materials/correction/cc_cubeovergoo.raw"
Daddy Sparky420 21 Jul, 2022 @ 12:07am 
i just understood where the issue is coming from i deleted my files temporarily to add them back later just to quickly test if i could still get the filter effect just from the bsp wich normally should be the case so that it works for everyone else so basically the .raw isn't getting packed properly with the bsp for odd reasons but i got an idea maybe it's because i left some of the old files from that filter in the place where it first saves portal2dlc folder
evelyncarnate  [author] 20 Jul, 2022 @ 7:26pm 
ah, that probably is the root of your problem. porting directly from pti to hammer is considered really bad practice for reasons like this - it introduces so much auto-generated and bad geometry and lots of extraneous logic entities that can mess with other things, that it's much cleaner and easier to just recreate the *puzzle* in hammer from scratch, only using the PTI layout as a reference. if you're still a beginner or intermediate hammer user too, it's really good practice with the fundamental tools - implementing certain puzzle elements can be a fun challenge if you haven't done it before (there are guides all over the internet). so yeah, i'd recommend doing that
Daddy Sparky420 20 Jul, 2022 @ 12:12pm 
is there perhaps an entity that PTI has for color correction that i'm not aware of that is fucking up the thing for others or something idk