Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon

Lighting basics

Save for later
  • 5 min read
  • 19 Feb 2016

article-image

In this article by Satheesh PV, author of the book Unreal Engine 4 Game Development Essentials, we will learn that lighting is an important factor in your game, which can be easily overlooked, and wrong usage can severely impact on performance. But with proper settings, combined with post process, you can create very beautiful and realistic scenes.

We will see how to place lights and how to adjust some important values.

(For more resources related to this topic, see here.)

Placing lights

In Unreal Engine 4, lights can be placed in two different ways. Through the modes tab or by right-clicking in the level:

  • Modes tab: In the Modes tab, go to place tab (Shift + 1) and go to the Lights section. From there you can drag and drop various lights.

    lighting-basics-img-0

  • Right-clicking: Right-click in viewport and in Place Actor you can select your light.

    lighting-basics-img-1

Once a light is added to the level, you can use transform tool (W to move, E to rotate) to change the position and rotation of your selected light.

Since Directional Light casts light from an infinite source, updating their location has no effect.

Various lights

Unreal Engine 4 features four different types of light Actors. They are:

  • Directional Light: Simulates light from a source that is infinitely far away. Since all shadows casted by this light will be parallel, this is the ideal choice for simulating sunlight.
  • Spot Light: Emits light from a single point in a cone shape. There are two cones (inner cone and outer cone). Within inner cone, light achieves full brightness and between inner and outer cone a falloff takes place, which softens the illumination. That means after inner cone, light slowly loses its illumination as it goes to outer cone.
  • Point Light: Emits light from a single point to all directions, much like a real-world light bulb.
  • Sky Light: Does not really emit light, but instead captures the distant parts of your scene (for example, Actors that are placed beyond Sky Distance Threshold) and applies them as light. That means you can have lights coming from your atmosphere, distant mountains, and so on. Note that Sky Light will only update when you rebuild your lighting or by pressing Recapture Scene (in the Details panel with Sky Light selected).

Common light settings

Now that we know how to place lights into a scene, let's take a look at some of the common settings of a light. Select your light in a scene and in the Details panel you will see these settings:

  • Intensity: Determines the intensity (energy) of the light. This is in lumens units so, for example, 1700 lm (lumen units) corresponds to a 100 W bulb.
  • Light Color: Determines the color of light.
  • Attenuation Radius: Sets the limit of light. It also calculates the falloff of light. This setting is only available in Point Lights and Spot Lights.

    lighting-basics-img-2

    Attenuation Radius from left to right: 100, 200, 500.

  • Source Radius: Defines the size of specular highlights on surfaces. This effect can be subdued by adjusting the Min Roughness setting. This also affects building light using Lightmass. Larger Source Radius will cast softer shadows. Since this is processed by Lightmass, it will only work on Lights with mobility set to Static

    lighting-basics-img-3

    Unlock access to the largest independent learning library in Tech for FREE!
    Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
    Renews at €18.99/month. Cancel anytime

    Source Radius 0. Notice the sharp edges of the shadow.

    lighting-basics-img-4

    Source Radius 0. Notice the sharp edges of the shadow.

  • Source Length: Same as Source Radius.

Light mobility

Light mobility is an important setting to keep in mind when placing lights in your level because this changes the way light works and impacts on performance. There are three settings that you can choose. They are as follows:

  • Static: A completely static light that has no impact on performance. This type of light will not cast shadows or specular on dynamic objects (for example, characters, movable objects, and so on). Example usage: Use this light where the player will never reach, such as distant cityscapes, ceilings, and so on. You can literally have millions of lights with static mobility.
  • Stationary: This is a mix of static and dynamic light and can change its color and brightness while running the game, but cannot move or rotate. Stationary lights can interact with dynamic objects and is used where the player can go.
  • Movable: This is a completely dynamic light and all properties can be changed at runtime. Movable lights are heavier on performance so use them sparingly.

Only four or fewer stationary lights are allowed to overlap each other. If you have more than four stationary lights overlapping each other the light icon will change to red X, which indicates that the light is using dynamic shadows at a severe performance cost!

lighting-basics-img-5

In the following screenshot, you can easily see the overlapping light.

lighting-basics-img-6

Under View Mode, you can change to Stationary Light Overlap to see which light is causing an issue.

Summary

We will look into different light mobilities and learn more about Lightmass Global Illumination, which is the static Global Illumination solver created by Epic games. We will also learn how to prepare assets to be used with it.

Resources for Article:

 


Further resources on this subject: