2Bit's Mapping Corner on www.PythonOnline.co.uk
ET Mapping Tutorial

Lesson 17

Topics

Lighting
 
Ambient light
Light entities
Put on the red light
Adding a corona
Light-emitting textures
Back to main menu
Ambient light [Top]
Run Radiant and open your map.

You can give your map an overall minimum level of light, regardless of the location and lighting you've included.  This is the ambient light setting.  It is optional.

If you feel your creation is just a little too gloomy generally, you might consider setting the ambient light.

To set it, select a regular brush and press N to get at the worldspawn settings.

Enter "ambient" in the key and a number say "10" in the value and press return.  Close the window.  I wouldn't really go above 20 as it starts to wash things out and reduces the appearance of shadows.  As a guide, Breakout has a setting of 20; 6flags has a setting of 10; and 2tanks has no ambient light.

Light entities [Top]
We've already added 3 light entities to the tutorial map.  We'll look at them in more detail and make them look better.

In 2D overhead view, zoom in to the room with the Allied start point in it.  I have moved the start up a little so it doesn't confuse the picture with the light that is overhead.

Right click on the centre of the green light box and select misc/misc_model.  Then navigate to mapobjects\light and select cagelight.md3.

I've found that some light models either add hours to the compile time, or crash the game.  These are my findings:
These models are safe:
cagelight
cagelighta
cagelightr
p_nolight
lantern
These models should be avoided
pendant10k
sdsconce3
Get a side view and move the lantern up to the ceiling.

Press 2 and lower the lantern one notch.  We have to bring the lantern ever-so-slighty out of the ceiling because you can't put a model into a structural brush.  If the ceiling had been a detail brush you could have put the model partially into it.  If you find you can see the gap between the model and the ceiling, make yourself a detail brush to run along the ceiling and close the gap between the ceiling and the light - make it look like electrical trunking for example.

Move the light entity down a bit.  It usually is just below the model.

If you put the light too close to the model it will cast a shadow of the model onto the ceiling.  Which might be ok, depends on what effect you want.

Compile and test that you see an illuminated cagelight model and that the light illuminates the room satisfactorily.  (In Radiant the cagelight will appear unilluminated.)

Put on the red light [Top]
Let's give the cagelight a red bulb.  There is already a model for this.

Select the cagelight model and press N.  Press the model button at the bottom right of the entities window.

Navigate to mapobjects/light and select cagelightr.md3.

Press ESC then select the light entity and press N.  Enter the "_color" key and "0.900000 .0100000 0.100000" value as shown, to make this light red instead of white.

The numbers of the _color value are the amount of RGB (Red Green Blue) in the light.  Values are 0 to 1 to 6 decimal places.

Close the entities window and press ESC.

Let's give this light a corona too.  The corona is the glow that a player sees, which is bigger the more of the light source he can see.

Adding a corona [Top]
Right click in the 2D view at the point shown, and select Corona.

Then press N.  If you haven't clicked on any other entitiy keys in the entity window since setting the light color, the _color stuff will still be in the key and value boxes.  If so, just press return to input them.  This is a handy shortcut to setting the corona colour (although coronas are generally white because most light sources in a map will be white).  If the key is not _color already, one trick is to select the light entity, press N and click on the _color row - this puts their values into the key/value boxes.  Then close the window, press ESC and select the corona.  Now when you press N you'll have the boxes pre-filled.

If you corona is still selected, press ESC.

Compile and test the red light and make sure the corona is placed realisitically.  Two things to note: one is that a coloured corona doesn't show up as much as a white one, and also that the coloured light has actually been shone through the closed door and has coloured the snow!

So this would be no good in a map - either you'd have to move the door or light, or make the light white, which is what we'll do:

Select the cagelight model, press N and click model and change the model back to cagelight.md3.  Close the entity window and press ESC.

Select the corona, press N and click the _color row then click del key/pair, close the window and press ESC.

Select the light, press N and click the _color row then click del key/pair, close the window and press ESC.

Compile and test, and you'll see the effect is now fine.

Light-emitting textures [Top]
As you know, textures can give off an ambient light of their own, such as if you put a sky texture on a ceiling or wall face.  This is done by creating a shader (a set of instructions) for the texture.  We won't need to do this ourselves because there are plenty of pre-supplied light textures with the shaders already done.

Select both of the other lights in the room and delete them.

In 2D topdown view, create a brush which we will make into a ceiling light.

Press shift+M so that the models aren't shown.  This makes it easier to see what we're doing.

Press 5 and draw a brush as shown.  Caulk it and make it detail.  Select the brush again.

Ctrl+tab so you can move the brush up to the ceiling.  Press 4 so you can get it flush against the ceiling.

Apply a metal texture to all of the 4 side faces of the brush (shift+ctrl+click in 3D on one face and shift+alt+ctrl+click the other 3).  Metal_c07 will do, and it's already listed in the texture window.

Now shift+ctrl+click the bottom face, which will be our light texture.

Select Textures/lights and apply light_xlight3_4000.

The texture is misaligned on the face, so press S and click Fit and Done, and press ESC.

Select the brush, and shrink it upwards so it's not such a chunky brush.  Use grid scale 2 to achieve this.

Press ESC and press 5 to put the grid scale back to something sensible.  Press shift+M to remove the models filter if you haven't already.

Compile and test and you should see something like this:

Next lesson