Lighting Basics
From RoboBlitz Editor Wiki
Contents |
Light Types
Most lights have a Movable and a Toggleable version. Toggleable Lights can be turned on and off with Kismet. Movable Lights are lights which can be moved once the map starts and can be turned on and off with Kismet.
- Point
- A Point Light is a simple spherical light that shines on it's surroundings in all directions. This is the light which is most similar to an uncovered light bulb.
- SkyLight
- Skylights shine on the entire level, no matter where they are. They are the simplest type of light for lighting a map.
- SpotLight
- Spotlights shine in one direction. The area they light up is shaped like a cone. This light is similar to how a flashlight casts a cone of light.
- DirectionalLight
- A directional light is similar to a SkyLight except that it comes from a specific direction.
Lighting up the Darkness
The best place to learn about lights is in the dark. So start off by creating a new unlit map. (I used a subtractive map, since walls and ceilings make good things to shine lights on, and it's easier to make insides of rooms in subtractive bsp).
All the light types are accessible by right clicking in a view port and selecting Add Actor->Add <LightName>
I've added a single Point light to the corner of a map. I've also added a few RDestructibles (a box and two barrels). The white radius sphere of the light is clearly visible in this screenshot.
When you start the level and drive Blitz into the light it'll look like this:
None of the dynamic objects (the barrels, boxes and Blitz) are lit up by the light!
Lighting Channels
What Are Lighting Channels
Lighting Channels allow you to select which kind of objects your lights will shine on. The two basic channels are Dynamic and Static. However several other lighting channels are also available.
In order for a light to affect an object in the map both the light and the object must have a channel in common. Since lighting channels are fully customizable it's possible to create a static mesh that is lit only by dynamic lights. The only exception is that dynamic objects (like RDestructibles) cannot be lit on the static light channel.
You will also note that lights which effect the static channel are baked into the texture when the level is built; this means that they cannot change while the map is running (which is why dynamic objects can't be staticly lit). But why would you use static light and not dynamic all the time? The answer to this is frame rate!!! Dynamic lights are constantly calculating and the means that this is one more thing that the your CPU or GPU need to keep track of and thus one more thing to slow your machine down. Static light you can place in, bake the lighting solution in the texture and then not worry about the performance effect of the light.
The easiest way to set the lighting channels on a light is to right click on a light select "Set what this Light Affects", and then choose "Affecting only Dynamic Objects", "Affecting only Static Objects" or "Affecting both Dynamic and Static Objects". You can also specify the lighting channels in more detail in the properties of the light in the Light section in the LightingChannels field.
You can tell what kind of objects the light affects by it's icon:
Static Light Icon:
Dynamic Light Icon:
Dynamic and Static Light Icon:
User Defined Light Icon (AKA any manually defined channel setup that differs from the defaults):
!!!!!!!!!!!!!!!!!!!DON'T FORGET TO SAVE AND BACKUP!!!!!!!!!!!!!!!!!!!!!!!!
An Example of Lighting Channels and Radiosity
Krab from NSE says:
Here's an example of how we do it in RB:
Say I have a level. It's a simple BSP room with a static mesh desk and a skylight. There is a lamp as well, but this lamp is a KActor (rigidbody).
So I light the room with a blue static light to simulate the effect of moonlight coming in from the skylight above. So now we have a hard shadow created off the desk, because the blue light falls at an angle. Consequently, it's all black in the little hole where legs go in the desk. But that's not realistic--I want to simulate that the moonlight is bouncing off the floor and into this area, so I create a smaller, dimmer blue light in there. Now it's not all black; there's a simulation of radiosity.
For the lamp, I'll add a yellow-white dynamic light. Let's assume it's attached to the object and can be batted around in game. It casts a shadow as well. So, in addition to being a system hog, this light will cast shadows (to the limit of its radius) on the items in the room. It will not, however, bounce. There is no way to really simulate radiosity in this case. It's more accurate to say the light casts rather than bounces...cause it really doesn't bounce off anything.
Now, here's the distinction. If the light is ONLY dynamic, it will not cast light on any of the static meshes--the desk and BSP will be blue, and that's it. If we set the dynamic light to affect both static AND dynamic objects, then it will affect these (and cost more fps wise).
Colored Lights
You can adjust the color of a light by editing the properties of the light. In the Light section you'll find a LightComponent; changing the LightColor field will adjust the color of the light. You can use the color picker to select a color from the editor, or adjust the Red, Green and Blue values directly. The alpha value (A) has no effect on lights. Valid values of colors range from 0 to 255.
In the same way, you can change the ModShadowColor which effects the color of the shadows which the light casts. (To notice a difference, you need something around which will cast a shadow when the light shines on it.) If you want to do this with Dynamic objects make sure CastDynamicShadows is checked. Changing the alpha value of ModShadowColor effects the "?glowiness?" of the shadows?
Using Directional Lights
Other Properties of Lights
Common Properties
- bEnabled
- Is the light on or off?
- Brightness
- How bright the light is. Default is 1.0
- FalloffExponent
- Rate at which light intensity falls off. Lower values will create a light of uniform intensity with a hard edge at the end of its radius. Higher values will soften the intensity of the light at a much shorter radius.
- ShadowFalloffExponent
- Rate at which shadow intensity (darkness) falls off. Lower values will mean shadows will remain darker when the objects that cast them are further from the lightsource. Higher values result in softer, more subtle shadows.
Point Light Properties
- Radius
- The Radius field affects how large of an area this light affects, measured in standard unreal units.. Default is 1024.
Spotlights Properties
- InnerConeAngle
- The light shines at fully intensity in the inner cone. This angle specifies how wide the cone is.
- OuterConeAngle
- The light does not shine past the OuterConeAngle. Space between the inner and outer cone is a gradient of shadow from full brightness to zero brightness based on the falloff values (which one? Both?)
- Radius
- The distance between the light's location and where the light falls off completely
(Note: This diagram doesn't show the light dimming as it gets farther from the source. This light would have an instantanous falloff at the end of the radius. However, it does show the light falling off (losing brightness) as it transitions from the inner cone to the outer cone)
Directional Lights Properties
- TraceDistance
- How far it affects things?
Shadow Projection Techniques
This field determines what method is used for calcuating shadow buffers. The default Shadow Projection technique is ShadowProjTech_PCF
Someone needs to verify this, but VSM might be a little higher quality, but slower, and might cause some artifacts, and PCF is a little lower resolution but might take advantage of hardware lighting (maybe sometimes).




