Portal Examination Room Guide
From ThinkingWithPortals
This page will discuss the development of Portal Style Lighting (Ala this page), as well as the development of an "Examination Room" to complete the lighting. Forum Page for Discussion.
Contents |
The Room
We need a test chamber, but as this is a very simple tutorial (it's about the lighting, not the playing!), our room is simply a 512x512x256 box with a short, 32 unit pedistal in the middle sporting the Portal gun. Don't add any lights to this map, we'll just use the game's ambient lighting for the first round. After developing the room (or downloading my copy), compile the level and "play" it in Portal.The light is way too bright and garish; it doesn't fit the game at all. Instead of Nurotoxins, GLaDOS should be serving cake. But the cake is a lie! ...let's make it more obvious.
The Observation Room
The lighting in Portal comes from the Observation rooms scattered around the test chambers. This hermetically sealed chamber is no different. Here I've added a 256x64x128 observation room in the top half of one of the walls. This is where those paragons of science will watch as Chell copes with being sealed in an airtight room.The lighting is still the horridly happy pure-white ambient no-shadow-throwing lighting. As soon as we have the bay done, however, we'll be ready for some decent lighting.
For textures, I've used the Observation Room floor, an Observation Room wall, and the same Modular Ceiling as the test chamber. Next we add some GLaSS!
(work in progress)
The Light Tube
Creating the tube itself
Start off with a 128x128 brush with all sides textured nodraw. The brush will have a height of 48 units. Align it on the grid (aligning it on some multiple of 128 is recommended). Use the clipping tool to cut the shape down to something in the order of 24x64 like shown to the right (pic 1).
Apply the settings shown on the picture (pic 2) to the right to the inner face of the newly creates object.
Also apply these settings to the face at the bottom (pic 3).
Use the copy & paste facility to create seven clones of these objects. Mirror and rotate them as needed to create the final arrangement that is shown on the image to the right (pic 4).
Add a new 128x128 brush on top of the other brushes. It has a height of 16 units, making the whole tube a block of 64 units to sink in your ceiling. Texture it with nodraw on all sides, except the bottom one, which receives lights/white009 (pic 5).
When using the texture lock option (enabled by default), it can happen that the textures for the bottom faces look completely scrambled. To give you an idea, the black hole in the texture image must not leak anywhere. Easiest thing is to enter texture tool, select the eight bottom faces, select World for Align and set the Texture Shift parameters until the hole is gone. Remember, if you aligned the tube on the grid like you were told, the shift should always be something like 64, 128, 192, 256 (that's why it's easiest to work on the grid). See pic 6.
Inserting the tube into your room
Now that you have a nice 128x128x64 block (if you created it around the origin, you could save it as a prefab and insert it many times) you can insert it into the observation room. See the ceiling in pic 7 - it will be the example ceiling. It is 64 units. It is actually not necessary for it to be that high, but in my maps I decided to make the eight brushes forming the tube itself detail brushes, so something was needed to mask them and the already existing wall was just fine.
Instead of just cutting up the wall using the clipping tool, I decided to take another way of splitting up the wall. The reason is that just splitting it into four rectangular areas creates the problem of T-intersections, where a vertex that is exactly on the line between two other vertices might not actually be on this line because of small errors. These might show off as tiny cracks (or leaks) when rendered. (I don't know how prone Source is to this but it doesn't hurt to just do it.) So use the vertex tool and make the large brush to something of this shape (pic 8).
By now it should be clear of what type the arrangement is. Note that there are no vertices directly on the line between two others, just some sharing a single point which does not hurt at all. Of course, if your tube wasn't supposed to be in the middle of the ceiling, you have to take the vertex tool again and alter the shape of some, but the idea should be quite clear - picture 9.
Note that this quick guide describes a light tube that is best to be hidden behind a frosted glass wall. After all, this is an observation room tutorial, and in most cases they're only visible from the outside, so there is really no need to have the high-polygon models for the tubes like these used in-game.
Ack, this tube is ugly. I will be rewriting this as per this guide... Observation Room Light Tube Guide. Thanks, NocturnalGhost!
I cheated, and will most likely be sent to the pits of the Aperture Science Enrichment Center for using the carve tool, but what I did for this was put in a 64x64 unit square brush, cut out an appropriate sized cylender out of the brush.
I then put a 32x64x64 brush on top of the hole made in the brush, and paint the bottom of the brush with the 'white' texture. This will act as a light in the room. How cool is that?
For the walls of the tube, I use a 'metal+white gradient' texture. You can find it by searching 'gradient' in the texture editor. For the base of the tube, I slapped on a similar metal texture. NOTE! This is not the correct metal texture, this one is too rusty. But I like this metal texture for my scene (and I don't want to seek the correct texture!).
So, here's a few views of the room after rendering the room. Wowsers! Now we see the power of radiosity. We can see this starting to build out.
The Window Pane
Now we place a glass wall between the observation room and the test chamber. I filled in the hole, and made the pane of glass one unit thick (the smallest block you can make.)
I now apply the glass/glasswindow_refract01 texture on only one side of the window; the side facing into the test chamber. All other faces on the brush are marked nodraw, to make the room render that much faster!Do not forget to tie the created glass brush to func_brush. This sadly happens to many mappers... Why do you have to do so? The reason is that a glass window dynamically changes the way you see things, but simple brushes are not able to do this. You have to make it an entity. If you do not do this, it will result in some sort of Hall of Mirrors effect. Compare the two pictures to the right; notice how what you see through the left window does not resemble what's behind, but the right one (func_brush) does.
Why this boring checkerboard? Simple. Do you want to wait for all those special effects to run while you are desparately trying to align entities or brushes? Didn't think so. (But give it a few years and we won't have to use checkers to sidestep this!) Also, this does a good job of being non distractive. But I digress.
Also notice that the texture doesn't effect the lighting effect of the room. There you go! The Observation room is our light source. Neat, huh?
Also, you can see the neat distortion effect caused by the windows, through the window, through the portal, looking at Chell. Neat, huh?
Additional Lights in the Examination Room (or: How to light your test chamber)
The official test chambers are almost always lit only by the observation rooms. This works by having enough spy rooms around and putting spotlights into them. This can completely eliminate the need for any other lightning outside the observation rooms.
Just put a light_spot behind the glass pane, slightly rotated to face downwards (so it doesn't light the ceiling of your room but rather the lower areas). Fire up the object properties and assign 183 204 218 300 to Brightness, 183 204 218 150 to BrightnessHDR, 200000 to Constant.
See, this doesn't look too bad... however, the examination room is unlit in the rear areas. We'll fix this by placing a single light into the back half of the room, assign the same values as above to Brightness and BrightnessHDR and optionally adjust Constant to light up even further. (Shouldn't be needed in most cases however.) It also lightens up the chamber some more.
