RuneEd-Logo







 
Search/Browse Tutorials Click Here For Tutorial Search Instructions
Search For:

All About Lights - Part Two
 
Author: Lode Vandevenne
Last Updated: December 26, 2001 at 06:33:16 PM
 

NOTE FROM KAZI: This tutorial originally appeared on Lode's Tutorials. It's a great site, so head over there for updates.

Changing the direction of SpotLights
To change the direction of the beam of a SpotLight or a StaticSpot, use the Rotation Tool.


If you have Unrealed1, use this button:


Now, select the light. Hold down CTRL and the right mousebutton to rotate it from left and right, and use left mouse button to rotate it up and down.




You can make the spotlight to have an arrow in the 2D views. To do this open Advanced in it's properties and set bDirectional to True. The arrow indicates the direction of the light. This has no effect on the look of the map in UT.

BlackLights
You can make lights that don't illuminate the textures, but only actors and objects. This way, they approach the blacklights used in dancings. If you make a dark room, with no normal lights in it, only a BlackLight, and then play the map, you will see nothing, only your opponent, the weapon you are holding in your hand and objects such as trees, crates and tables that you placed in there.

To make a BlackLight, add a light and set it's LightEffect to LE_OmniBumpMap. That's it! What you created now is not really spectacular. To make the BlackLight more spectacular, you can give it another color and LightEffect, for example set LightType to LT_Strobe, and make it violet.

You can use this effect to make a dancing, but you can also use it in a more subtle way: in a normally illuminated room, you can add a few of these blacklights to make players and objects brighter than the rest of the room. Or you can use it for special maps in which you can only see opponents and no walls.


The actors are illuminated by the blacklight, but the walls are not.

More Lighting Properties
Again, open Light Properties of the light and expand Lighting. Notice the following properties: bActorShadows, LightCone, LightPeriod & LightPhase.



bActorShadows: This was supposed to let the light cast realistic shadows of actors, but it doesn't work.

bLensFlare: This doesn't do anything. This is probably an old remainder of the pre-release version of Unreal. You could enter about 15 different coronatextures and make the effect of LensFlares in a camera. However, this is left away in the final version of Unreal.

LightCone: If the LightEffect is SpotLight or StaticSpot, use this to change size of the lightbeam.





LightPeriod: Use this to change the speed of the light-animations LT_Pulse, LT_SubtlePulse and LE_Searchlight. This does not work for the LightEffects and LightTypes, not even the LT_Strobe. The lower the number, the faster the animation will run. For LE_SearchLight, it moves at it's fastest when LightPeriod is 1. When it's 0, LE_SearchLight will not move at all.

LightPhase: use this to set the phase of the animation-cycle the light will start with. For examle: if you have 2 Pulsing (LT_Pulse) lights, and want the first one to fade in while the second one fades out you'll have to use this slider. Add two lights close to a wall. Set the lighttype of both of them to LT_Pulse. Now select one of them and set it's LightPhase to 128. An animation-cycle takes 255 steps, so 128 is exactly the middle of the animation. This means that while light one is in the start of the animation (= fading out), the second one is already in the middle of the animation (= fading in).




Two Colored Pulse, Two Colored Strobe
If you want for example a pulsing light that does not becomes red, black, red, black but red, green, red, green, you have to use the trick explained in this section.

To make a pulsing light that fades from red to green, first add two lights. Do not yet place them on the same place, otherwise they're standing in each others way so it's difficult to select each one of them. Select the first light and open it's Light Properties, and set it's LightType to LT_Pulse. Now expand LightColor and set it's color to green (use a low saturation). After you've done this, select the second light and set it's LightType to LT_Pulse. Set it's color to red (again a low saturation). Make sure both lights have the same LightPeriod. Set the LightPhase of one of the lights to 128, and the other light's to 0. Now place both lights on exactly on the same place, so it will look like it's one light that does a TwoColorPulse.

To make a TwoColorStrobe, do the same but with LT_Probe.

Another way to make this kind of effects, is using TexturePaletteLoop. You can read more about this further in the tutorial.

Coronas
A corona is a 2D picture placed on the lightsource. It is not like a 2D sprite, because 2D sprites become smaller on your screen if you walk further away from them. The corona of a light is alway as large on your screen.

To give the light a corona, open it's Light Properties and expand Lighting. In there set bCorona to True. Now, open the Texture Browser. To do this, open the menu View and there choose Texture Browser. If you have UEd1, the Texture Browser should be open already, if not, just search in all the menus or read a beginners tutorial about UEd1. Also, in version 436 of UEd2, they have forgotten to add the Texture Browser in the menu, but you can use the button in the upper toolbar that looks like this:



In the TextureBrowser, open the menu File and there choose Open. In UEd1, just click on the Open button. Go to the Textures folder in your Unreal Tournament or Unreal folder, and open GenFX.utx. The package GenFX has multiple groups in it, one of them is called LensFlar. See screenshot below to see which dropdownmenu to use to open LensFlar: I painted a red circle around it. If you have UEd1, probably all folders will be visible, so ignore this. Now you should see a lot of lensflare pictures. Choose one and select it.


The LensFlares of GenFX

GenFX is the main package for coronas, palettes, etc..., but there are more corona textures in other packages and groups. For example City.utx has some.

Now go back to the Light Properties and expand Display.


The Display tab

Click on Skin. A button Use appears. Click that button and the name of the texture you selected should appear in the textfield. Before you can see the corona in UEd, you have to rebuild geometry. After that, also rebuild lighting. Now you'll see the corona in the 3D view. If you don't see it, make sure the camera is close enough to the light if it has a small LightRadius and that the camera is not inside a wall. If you still don't see it, it might be that your software or hardware modus doesn't has the corona option enabled. go to the Fog-section of this tutorial and read the first part of it, but instead of tutning on the VolumetricLighting option, turn on the Corona option.

If you think the corona is too small or too large (it will probably be too large), use Display in the Display expansion of the Light Properties. Try entering different values in it. 0.2 is most of the times perfect.

The LightRadius value does not only determine how far the light will shine, but also from which distance you start to be able to see the corona.

If you want to make a light with a very small radius but a corona that's visible from very far, just use two lights: one without corona that gives light in small radius, and one with corona, LightBrightness set to 0 and a large LightRadius. Then place these two lights on the exact same position.


Coronas in DOM-MetalDream

Animated Coronas
To make an animated corona, use an animated texture as skin. But there is a problem: there are no animated corona textures avaible in the standard texture packages. You have to make one yourself.

To make a strobing corona, select a standard coronatexture and look at it's size (it's size should appear on top of the Texture Browser window). Most of the times they are 128*128 or 64*64. With any painting program, make a completely black picture that has the same size as the corona. Save it as a 256 color PCX-file. Now go back to the texturebrowser, and select the coronapicture. open the menu File of the texturebrowser and choose Export. In UEd1, just click on the Export button. Save the flare as a PCX-File. After that, click Import. Open that same PCX-File you just saved, and in the Import Texture window, type the following things:


The Import Texture window

Make sure that you type a packagename that DOES NOT already exist, or you'll overwrite an existing package and destroy your UT!

Press OK. Now again choose Import, but this time open the black texture you created. In the Import Texture window, type the same Package as before. Use a different Name for the texture. (for example StrobingLensFlarePart2)

After you did this, select the package you created and in there you should see the two textures: The lensflare and the black one. Select the LensFlare texture and in the menu Edit of the Texture Browser, choose Properties. Or rightclick on the lensflaretexture and choose properties. In UEd1 select the texture and press the Edit button on the bottom of the Texture Browser. In the Texture Properties window that appears, expand Animation. Go back to the Texture Browser and select the black texture. Now go back to the Texture Properties, click on AnimNext and click the Use button. The name of the black texture appears. You'll also see that the example will strobe. Change the MaxFrameRate value to change the strobing speed. The higher the value, the faster it strobes. Setting it higher than 16 doesn't appear to work. The lower the value, the slower it strobes.



The Texture Properties window, and the Texture Browser.

Before you can use this in your maps, you'll have to save your ChooseAName Package. Open the menu File of your TextureBrowser and choose save make sure you DO NOT overwrite an existing package, or you'll ruin your Unreal Tournament. Save it as the same name you already gave it, in my example ChooseAName.utx. If you called the package MyLevel you don't have to save it, it will be saved automaticly in the *.utx file of your map then. However, this also means you can't use the package for other maps.

Now select any light and give it your strobing texture as skin. The animation will only be visible in Unreal Tournament, not in the editor.

Why using this? Because the coronas in the Unreal engine have a big problem: when you set the LightType to LT_Strobe, LT_Pulse, LT_Flicker or whatever, the light will strobe but the corona will not, which is not very realistic. But the animated corona you just created strobes. Of course, your timing needs to be perfect...

To make a rotating corona, export the standard corona texture you want and open it in any painting program. In there, rotate the corona a little bit and save texture as a new PCX-file, rotate again, save again, etc... untill you're rotated back to the original position. Rotate at for example 30 degrees to have 12 different animation frames. Import the textures in a new texture package. In the Texture Propoties, first select the first texture and set it's AnimNext to the second one, set the AnimNext of the second one to the third one, ... , and set the AnimNext of the last one back to the first one. Play with the MaxFrameRate and MinFrameRate to try out different effects. And of course save your texture package and make sure you don't overwrite an existing one!

You can also create coronas that change color, grow and shrink, or anything else.

Sprites
In old 3D games, such as Wolfenstein 3D, Doom and Duke Nukem 3D, the objects were 2D pictures. No matter from which angle you looked at them, they always looked the same. The soldiers in Wolfenstein had 8 pictures, so you could see them from 8 different angles, but that still isn't 3D. What does this have to do with lighting? You can use the lights to create the effect of sprites in Unreal. You can also do this with other object, but lights are one of the few that don't have a mesh, so they are easier to use for this purpose. How? Make a light and set its LightBrightness or LightRadius to 0 (you don't have to do that, if you want the object to give light). Open it's LightProperties, and expand Advanced. In there, set bHidden to False. This means that the torch symbol will now also be visible in Unreal Tournament, and not in the editor only. The only thing you've got to do now is to change the torch picture in another picture. Open the texturebrowser and select anything you like. If you import a picture, make sure that you set it to be masked if you don't want a black square around it. Masked will make the first color in the palette to become transparent, in most cases this is the black. Go back to the Light Properties and expand Display. Play with the following settings:

* Drawtype: this determinates what kind of object you have. DT_Sprite creates 2D objects, DT_Mesh (see further) creates 3D objects.
* To change size of the 2D object, use DrawScale.
* To change the lightness or darkness of it, use ScaleGlow. In most cases you have to use this, because the sprites ignore lighting and this is the only way to let them be dark in a dark room or bright in a bright room. If the style is translucent, ScaleGlow doesn't change the brightness, but it's translucenty.
* Use Style to make it translucent, modulated or masked.
* To make the objects not walkthroughable, Expand Collision and set BlockActors, BlockPlayers, CollideActors and CollidePlayers to True and choose a height and Radius.


The Collision tab

You can of course also use this 2D-objects effect for other things, for example if you use the texture of an eyeball, the eye will always look in your direction.



Fog (Volumetric Lighting)
Fog isn't called fog in the Unreal Engine, but Volumetric Lighting. Creating fog is quite difficult, and it also slows down the computer. Fog in Unreal isn't like fog in for example Delta Force II, and making a foggy outdoor map is almost impossible. Most Unreal Tournament players don't even have the Volumetric Lighting propertie set to True, so they won't be able to see the fog. Probably even you don't have it enabled. To enable it, or to check if it is enabled, you must open the Advanced Options Window. This window is somewhat hidden, but there are several ways to open it:

* By entering a command in the console. To enter a consolecommand in Unreal (Tournament), press the Tab key in a game or use the Tools menu in the menu. The console of UnrealEd2 425 or higher is the Commandfield on the bottom.
* By choosing it in a menu. In Unreal 1, go to Options and there choose Advanced Options. Or in UnrealEd2 open the menu View and there choose Advanced Options. Unreal Tournament does not have a link to it in it's menus.
* You can also edit the UnrealTournament.ini instead of using Advanced Options. Search for the VolumetricLighting setting of the correct 3D modus, and set it to True.

In the Advanced Options window, expand Rendering and in there expand Software rendering. That's the modus that UnrealEd uses in most cases. If it uses Direct3D, expand that one. In there, set VolumetricLighting to True. If your map already has fog, you can see it in your editor now. Notice that there are lots of other options. Make sure Coronas and ShinySurfaces are set to True and that FastTranslucenty is False because that's ugly and is only for very slow computers. ShinySurfaces are mirrors.


The Software rendering properties

To be able see fog in Unreal or Unreal Tournament, expand the 3D modus that your Unreal Tournament uses, in this example Direct3D, and there set VolumetricLighting to True.


Direct3D properties

To create fog you need a lightsource, placed in a FogZone.

If you want to place the light in a zone without ZoneInfo, go to Level Properties. If you don't know how, read the section ZoneLight of this tutorial. In the Level Properties Window, expand ZoneInfo and in there set bFogZone to True. If you want the fog in another zone, right click on the ZoneInfo actor and there xpand ZoneInfo and in there set bFogZone to True. Now select the light that will become fog, and open it's Light Properties. Expand Lighting. There are three values important for Volumetric Lighting.

* VolumeBrightness changes the brightness of the fog.
* VolumeFog changes how thick the fog is: the higer this value, the less far you can see in the fog.
* VolumeRadius: this changes how far away from the light the fog will reach. If set to 0, there will be no fog.
* To change the color of the fog, change the color of the light, in the LightColor expansion.
* You can use any Lighttypes and other properties as well.


A room with green fog

You can also use fog to create coronas: just give it a really small radius.


A corona created with Volumertic Lighting

ZoneFog/Screen Flashes
As you can have ZoneLight, you can also have ZoneFog. You can create this effect by using Screen Flashes. To enable it, open the ZoneInfo or LevelInfo properties and expand ZoneLight.


The ZoneLight tab

Expand ViewFog, and you'll see 3 values: X, Y and Z. X stands for Red, Y stands for Green and Z stands for Blue. Enter values between 0 and 1 in it. ViewFog creates a translucent layer of the RGBcolor you entered on your screen, so it appears like fog. For example if you enter X=1, Y=0 and Z=0, you'll have really red fog in that zone. To get white or grey fog, give X, Y and Z the same value, for example 0.5, 0.5, 0.5

ViewFlash needs values between 0 and -1. It reduces the ViewFog a bit.

You can't see this fog in the editor, and you can only see it in UT if you have the screenflashes option enabled. Go to the Advanced Options of UT (see the Fog section for that) and expand Display. There set ScreenFlashes to True. These Screen Flashes are also used to turn the screen red when you're hit by someone, and for example WaterZones have green ZoneFog.


No ZoneFog


Blue ZoneFog

Unlit
When you place any light or use ZoneLighting, the walls are affected by these lightsources. But it is possible to make the walls ignore the lighting and just be completely bright, even if they are in a dark room. Create a normal cuberoom, add some very dark lights in it and make sure ZoneLighting is set to 0. Now rebuild lighting. You'll see nothing but black now. Now select one of the walls. Blue dots should appear on it. Right click on it. In the menu that appears, choose Surface Properties. (In UEd1 doubleclick on the surface does the same). In the Surface Properties open the Flags-tab.


The Surface Properties window

There activate Unlit and rebuild lighting. Notice how all the walls of the room are dark, exept the one you set to Unlit. Just for fun, add a light in the room. The dark walls will be affected by the light, but the unlit will remain unaffected. They also ignore ZoneLighting.


None of the walls are unlit


A unlit wall

Use this option for example for surfaces that are giving light, such as lava or computer screens. Also add some lights around it to make the other walls appear to be enlighted by the lava or the screen.

The surface propertie Force View Zone does the same as unlit.

To make objects unlit, open Display in their properties and set bUnlit to True. Now, the brightness of the object depends on it's scaleglow setting only.

Special Lit
Again make a normal cuberoom, and add two lights in it: a red one and a green one. Give them a high LightBrightness and LightRadius, and a low LightSaturation. Rebuild geometry and lighting.


No Special Lit

Select one of the walls and open it's Surface Properties, and activate Special Lit (make sure Unlit is Off). Rebuild again. The Special Lit wall is just black, while the others are still illuminated. That's because walls that are set to Special Lit, don't get light from the lights you added. Note: Special Lit walls DO get light from the ZoneLight, so if it doesn't look black check if there is ZoneLight.


The special lit wall is black

They can only be enlighted by lights that are set to special lit as well, or by ZoneLight. Open the Light Properties of the red light and expand Lighting. Now set Special Lit to True and rebuild lighting. The normal walls are green and the Special Lit wall is red.


The Special Lit wall gets red light from the Special Lit light

You can use the Special Lit option for two things: to make black walls (if you don't add any Special Lit lights, and there is no ZoneLight), and to make lights that may shine on one thing but not on another. For example if you want to make a computer screen that pulses if you don't want the environment to flicker, you'll have to add a light in front of that screen and set the LightType to LT_Pulse and set the screen surface and the light to Special Lit.

Bright Corners
There is another surface propertie, called Bright corners. If this is not activated, the corners of the walls will be darker than the center of it. If you activate it, the sides of the wall will be as bright as the center. Use this for outside landscapes or if you don't want darker corners in a room. You can see the difference on these screenshots:


Dark corners


Bright corners

The size of the corners is determinated by the scaling of the texture you used (to scale the texture of a surface, use Scaling in the Alignment tab of the Surface Properties). If you use a really large scaling for a texture, it's corners will be so big that the whole surface will be black no matter how many lights you place next to it. In a 256*256*256 room with a normal light in it, a texture with a scaling value of 4 will be hardly illuminated! Also, if you have really small surfaces with a scaling of 1, the corners will still be larger than the surface. Of course, if you set Bright corners to True this problem will not occur.

An example of such a problem, that really annoyed me, is when you subtract a tubelight in the ceiling. As long as it has dark corners, the whole tubelight will be black. Only after you enabled Bright corners for these surfaces you will be able to see them.


Dark corners (too dark)


Bright corners

Had enough? No. Okay, then head over to "All About Lights - Part III" in the Miscellaneous section.

[ Click here for printable version ]

 

Current Comments on this article:

No User comments added.

Post New Thread
This comment system uses the official RuneGame.com Forum as its verification. To post a comment, please register on the main RuneGame.com Forum using the "Want to register?" link below.

Your UserName:    Want to register?
Your Password:   Forgotten your password?
Message:
 
Copyright ©2001 Ed.RuneGame.com