Lighting
UnrealED2 Tutorials by EZkeel

E-mail:Ezkeel@nikodemus.co.uk
Accompanied files : Lighting.UNR

Contents

1) Standard Lighting
2) Surface light
3) Coronas
4) Trigger Lights
5) Fog
6) Ambient Lighting
7) Tips

Introduction

Again, as with any of my other tutorials, I don't claim to be an expert. If you liked the look of my levels, one of the things that contributes a great deal to this is the lighting. I don't understand all the lighting functions, in fact a lot of it is still a mystery to me, but I can share what I've found out.

To give great atmosphere in a game, the lighting should be as realistic as possible. Not too dark, not too bright and not too harsh.

Lighting should nearly always have a source; it doesn't come from thin air but needs a lamp, torch or some other device that radiates light.

Here's how to create lighting:

Standard Lighting:

1) Create a room as normal. Make it large, so that you can get a feel for what your lights will do.

2) Its really simple to add a light to a room. Just right click anywhere in the 3D view to bring the menu up and you'll see an option that says "add light here". Click that.

3) You should then see a small torch appear on one of your walls. Manoeuvre this to the centre of your room, rebuild and save the map (Call it "lights")

4) The small torch won't appear when you play the level, all you will see is a patch of light on nearby surfaces. If you don't see anything its probably because your room is a little on the large size. (You can change how far the light reaches by changing its properties).

5) Click on your light and press F4. A properties box will appear. There are only a few of these properties that I will cover in this tutorial. "Display", "LightColor", and "Lighting".
(I will cover other properties when we look at "triggerable lights")

6) First click on the property called "Lighting" and use the information below to set up your light as you would like it. Some of these fields are a mystery to me, so I will only discuss the fields that I know about:

bCorona and bLensFlare are used to give that realistic feel to bright light sources. I will go into specific detail about this later.

LightEffect and LightType both give your light a special effect of some kind. For example, if you had created a small torch with flames coming out of it, you would want your light to have a faint flickery effect. To do this you would choose the "Lighteffect" dropdown menu option called "LE_torch waver".
Experiment with these to try out different effects, but remember not to use to many special effects as this tends to eat up a lot of processor power.

LightRadius. By default this is set to 64, but it will go up to 255. The larger the number, the greater area your light will spread.

VolumeBrightness, VolumeFog and VolumeRadius are all specific to creating foggy light which I will cover later

7) This is the nicest bit I think. :) This is where you give some colour to your lights.

Again, bring up the property box for your light and click on "LightColor". You should see 3 more fields appear called "brightness", "hue" and "saturation"

Brightness is by default set at 64 but can go up to 255. Obviously, the higher the number you choose, the brighter your light will be.

Hue and Saturation both control the actual colour spectrum. By default the hue is set to 0 and the saturation is set to 255. The higher the number for saturation, the whiter the light will be. If saturation is set to 0 then the full depth of the hue can be seen. Try different combinations to see what colours you get. Here are a few:

Hue =0, Saturation =0: Harsh, bright red, good for "red alert" signs
Hue =80, Saturation =0: Harsh, bright green,
Hue =180, Saturation = 0: Deep blue light
Hue = 36, Saturation = 60: Warm, amber firelight.

Light effects on surfaces:

There will be times when you want a surface to stand out without having to have an actual light to create that effect. To do this, click on the surface of the brush that you want to stand out. (This could be a transparent flame for example).

Now press F5 and you'll see the properties come up for that textured surface. Make sure it’s on the tab called "effects". There are lots of useful attributes there, but the one we're interested in is "unlit". Click on that so a tick appears. This means that this surface is no longer effected by any light actors. The whole of the surface just glows in the dark.

Another useful attribute here is "bright corners". There will be times when you've made a really small indented brush in your wall or something similar. No matter how bright you do your lights, or however big a radius you use, you just can't get the area inside this brush to light up. If you tick "bright corners" it will react to the lights you put near it.

Coronas:

These are great when you want a really impressive bright light, but remember not to have too many of these as it could slow things down a little bit.

Set a light actor up in the usual way and then bring up its properties by pressing F4. Click on "lighting" and set "bCorona" to true.

Next you need to give the light a "skin". In the properties box, click on "Display" and another set of properties will appear. Amongst those is a field called "skin" which should be blank. This is where you tell Unreal that the light actor will be visible in the game, and what it looks like.

Now bring up the "texture browser". At the bottom of this toolbar press "load" and with the browser pick "SpaceFX". Look through this texture file and you will find a small collection of different coloured stars. Choose
one you like for your light by clicking on it. Then, in the field called "skin" in your light's properties click on "use"
(this button will appear when you click on the field).

Rebuild, save and play and you should see a nice corona where your light is sourced from. If you can't see it, it may simply be the positioning of the light. Fiddle and play with its position, until you can see it properly.

Triggerable Lights

You can add triggerable lights to your world and adjust their properties in exactly the same way, but the advantage here is that you can turn these on and off.

Click on "classes" in your right hand tool bar, then click on "lighting" and a whole list of different types of light will appear. Choose "TriggerLight" (there are 2, but either will do).

Right click somewhere in your map in the 3D view and choose "add TriggerLight". You will see a light appear that looks just the same as the ordinary lights. Adjust it and get it looking exactly as you want by changing its properties (F4).

Now in the property box click on the property called "Object". You will see more properties, you need to click the one called "initial state". A drop down menu will appear with the following options: "Trigger pound", "Trigger control", "Trigger toggle", "Trigger Turns Off", "Trigger turns on"

Trigger Pound, I believe will keep the light on as long as the player stays near the trigger.

Trigger Control is triggered as long as a normal trigger is in use.

Trigger Toggle is applied when you want to be able to turn the light on and off
whenever you like. each time the light is triggered it will change from on to
off or vice versa.

Trigger Turns Off is exactly that, and Trigger turns on also speaks for itself.

Once you've decided which one of these to use, click on "Events" and give your light a Tag name. When you want this light to be triggered, just put this tag name in the event property of the thing that triggers it.

Now, also in the Trigger Light's properties you'll find a property called "Trigger Light", click on that and you'll find some more useful fields. You can make your light fade in or out when its triggered by typing in a number (seconds) in the field called "Change Time". You'll need to set the trigger to be either on or off before its actually triggered. If you want it to be turned off when its triggered set this field to "true", and obviously set it to "false" if you want it be off before being triggered. "Remain on time" is exactly what it says.

Foggy Light

Add a light to your world in the normal way, but this time you need to add an extra item. Click on "Classes" from your right hand toolbar and find the section called "Info". In that section you will find another section called "ZoneInfo".

See the tutorial on zones for more information on these.

There are different types of zones, but just choose this one and add it to your map.

Once you’ve added it to you map, it should appear as a small cube with a question mark in it. Click on it and bring up its property box (F4). Under the property called "Zone Info" there should be a field that says "fog zone". Click on this and select "true"

Now you need to add some information to your light to tell it about the fog. Bring up the property box for your light and choose the "lighting" option. You will need to adjust these three settings to create a fig effect with your light:

"VolumeBrightness", "VolumeFog" and "VolumeRadius.

VolumeBrightness and VolumeRadius work the same way as the normal lighting attributes, and VolumeFog effects the density of your fog.Try experimenting (also check out the sample map) and you’ll soon get the hang of it.

Ambient Lighting

As well as using individual lights to light an area you can speed up your maps performance by giving zones (or the whole map) ambient lighting. For the whole level, bring up the level properties (right click in UnrealEd2) from the top menu. Right at the bottom of the properties is a section called "ZoneLight". Open that out and adjust the ambient brightness, hue and saturation to your taste. The draw back is that the lighting is everywhere so the textures can look a bit flat without the usual lighting. Its best to use normal lights in conjunction with this method and keep the ambient brightness to a maximum of 12.

Tips:

1) Try and avoid using fancy lighting effects and foggy areas in large outside places, it will slow things down quite a bit.

2) Keep the radius of your lights small. With a large radius the light hits more surfaces. The more surfaces your lights hit the more calculations your processor has to make and the slower your game gets.

3) Use the "group" command to change multiple lights. When you set up the properties of your lights open up the "Object" section and give the field "group" any name you like. All the lights that you are using for ambient lights can be given this same name. When you want to adjust all of them at the same time again, simply right click on one of them and choose "select all". All of the lights with that group name will then be selected. You can do this with anything, not just lights.

4) If you open up the properties of anything you add to your map, whether it's a brush or an actor, you'll notice it has lighting properties too. These can be used in the same way but usually they aren't "activated". Make sure that the "Light Type" field under the "Lighting" section is set to "LT_Steady" and then adjust all the usual attributes and a light source will come from the focal point of your object. This is especially useful with moving brushes for obvious reasons (moving lights duh!)