INTRODUCTION
LESSON OVERVIEW
Environment lighting is one of the key aspects you will run on your project. Good lighting can make a project really shine (no pun intended), while bad lighting can make a good environment look very flat and uninteresting. Good lighting will allow you to direct your viewer's eye, create focal points, and most importantly, create a visually pleasing environment. In this lesson, we will cover a set of principles that will assist you in how to achieve this goal. During this lesson, all practical knowledge and examples will be shown in Unreal Engine, but all of the fundamental knowledge learned can easily be transferred to any engine or program.
Here are the following topics we will cover:
- Reference gathering
- UE5 and Lumen
- Exposure and contrast
- Light Units and Physical Based Lighting
- Types of lights
- Skylight and Skies
- Importance of Fog
- Exterior vs Interior Lighting
LESSON OVERVIEW
Reference Gathering (Link to lesson on this topic for more in depth knowledge)
Arguably one of the most important steps before jumping into any project is the planning stage and ensuring we cover all its pillars. Same as we gather references for what type of environment we are creating, or the materials that we need, gathering references for what type of lighting and mood is crucial for a successful project. It’ll tell us, what type of lighting we would use for example:
- Is it High Contrast? Soft lighting?
- What type of weather?
- Is it daytime, nighttime, or afternoon?
- What colors are we looking for?
- What is the emotion we want to convey or tap into?
Answering these questions will ensure we have proper identity on our projects.
Let’s take a look at a quick example of what a reference board for this would look like:
In this particular example, our references are indicating us not only the type of colors we would look for, but most importantly it’s telling us the type of lighting (soft/harsh?) we would use.There’s a common denominator that it’s soft-lighting, with cool tones, very moody with potentially heavy atmospherics, and lots of emphasis in using back-lit elements.
This is where cinematography and understanding it’s principles is quite important to understand lighting and art direction.
<aside>💡
For resources on these I recommend:
- Studio Binder playlist for cinematography: https://youtube.com/playlist?list=PLEzQZpmbzckX3A_SopJ-krGsV6BERxdwb&si=NoVQ2juZ3PyOQs3T
- For reference gathering, Shotdeck is without a doubt the most reliable source for good images (it has a free trial) SHOTDECK - Home</aside>
Before we jump into the specifics for environmental lighting, it’s important to understand that even though all of our practical examples are shown within Unreal Engine 5 (Using Lumen as a dynamic lighting system) this is just a tool where we are applying our fundamentals. Different game engines (i.e Unity, Godot, Frostbite, CryEngine, etc) all have different workflows when it comes to lighting.
Still, as long as we understand how to light properly, we’ll be able to achieve good results independent of the tools used.
For this we need to understand some core subject…
Exposure and Contrast
Getting the right exposure and contrast is key to creating believable lighting. This will dictate the mood of our scenes and help us ground it in reality, making it more familiar to the viewer. Lighting grounded in reality will ensure that the space feels coherent and believable no matter the creative choices we make or how stylized our scene is.
Inside of Unreal Engine we can visualize our exposure levels by going into Show - Visualize - HDR (Eye Adaptation)
<aside>💡
Here you will find deeper information on this tool and the exposure tools in UE Auto Exposure in Unreal Engine | Unreal Engine 5.4 Documentation | Epic Developer Community (epicgames.com)
</aside>
It’s useful to use a mid-grey cube to measure exposure levels properly. Why?
Material for a mid-grey in Unreal Engine
Higher contrast signifies more drama and tension. While lower contrast will be softer and tones will have a smoother transition. Different times of day will need to have a proper ratio between the light and shadowed areas:
Outdoor scenarios (Keep in mind this is just an approximate number, this depends on plenty of factors such as weather, atmosphere, etc, but this will be a good starting point for your lighting)
- 3 to 3.5 Stops at midday
- 2 to 2.5 stops at afternoon/evening
- 1 to 1.5 stops at late evening/overcast
here are a couple of examples showing this:
- Sunset setting with a 1-stop difference (i.e: 1 Value of difference in the EV100 number)
- An average cloudy day with a 2-3 stop difference between light and shadow
Light Units & Physical-Based Lighting
When it comes to lighting workflows, we have two different approaches. Non Physical Based Lighting (PBL) which in layman's terms, means eyeballing the number and intensity of our lights. And then we have the PBL way which relies on using real-life measurements of our lights.
For instance:
- We can measure our Sun in Lux intensities
- Bulbs and modern lights can be measured in Lumens
- And candela which derives from the intensity of a single candle
<aside>🖼️
Needs an interesting visual to represent all of these (Timothy)
</aside>
The reason as to why we would prefer working in a PBL manner is because it’s far more consistent and predictable when it comes to the interaction with our materials. Especially if we’re considering PBR (Physically Based Rendering) when creating our materials, following real-life measurements for our lights will ensure proper response from them. Regardless we’re doing a realistic or a stylized environment.
Here’s an example image of different measurements for light sources.
In this link, you’ll find a bigger list of different temperatures, light units, and EV100 values. UE4 Tech Art Portfolio & Orders of magnitude (illuminance) - Wikipedia
Types of lights
Important to note. Since for this lesson we are using Lumen in Unreal Engine 5, it’s important we set our lights to movable. We are not using static or stationary.
We have two ways of lighting an environment either with dynamic systems or with pre-computed lighting.
Lumen in Unreal Engine 5 is what we would call a fully dynamic lighting system. What this entails is that changes to shadows, bounce light (i.e global illumination), reflections, all occur in real time. Say picture a game with a 24/7 cycle, in order to have the sun change directions and have shadows properly update, this needs to be a dynamic light source making it of course more expensive on performance. (because is has to do all those calculations in real time, and we can’t really rely on stored data for this)
But in certain situations where a game is more linear and we have constrained lighting setups (i.e not a continuous day cycle) we can define with much more ease which lights need to update every frame or which lights can be made stationary/static. Pre-computed lighting means that elements like shadows are going to be baked into something called a shadow map. Therefore the shadow will always remain in the same spot and it’s not going to cast any shadow on a dynamic element, say for example a character walking through it.
It’s important to note with the increase in power of the GPUs and CPUs, fully dynamic lighting systems are more common nowadays.
Our tool kit has several different types of lights we can use.
We can divide them into two categories:
- Local lights (Like: Spot point, rect)
- Natural lights (Skylight and directional light)
All lights can be found in this window
Local Lights
For local lights, we have for example:
- Point lights (generally more expensive) are lights that cast light and shadows (if enabled) in a 360-degree radius.
Example of settings for a point light
- Spot Lights (cheapest lights to use in terms of performance) are lights that cast light and shadow in a single direction and depending on how big the cone angle is. (Inside of Unreal we have controls for the Outer Cone Angle and an Internal Cone Angle)
- Spot_Light.mov
Example of settings for a spotlight
- Rec Lights. This type of light is considered an ‘’area’’ light since it covers a larger range and is very useful to simulate rectangular shapes such as big soft boxes, or even windows or TV screens. (Notice in the video how making a light source bigger will change how soft the shadows get and how the reflection on the floor changes)
- Rec_Light.mov
Natural Lights
We’ll call natural lights anything that doesn’t have a defined distance from where it’s casting, such as the sun for example.
- Directional light is one of our main sources of light in Unreal Engine (especially for exteriors). Since this doesn’t have a defined distance, it’s mainly affected by rotation and not by the location from where the actor is placed.
- Directional_Light.mov
- Skylight is the one that controls the indirect soft light that originates from the sky (or HDRI for example) (we’ll touch more on this on the next chapter)
-
All these have different parameters that worth testing and trying to get a feel for how the lights respond to the different situations.
Skylight and skies
Regarding skies in game-engines, every game and production environment will have different needs and requirements. Unreal Engine comes with a default sky system which uses the sun position and volumetric clouds to cast the necessary light and shadow. You can find this under this window:
This will give you a set of level actors and parameters to start having a initial setup for your lighting.
Now, for this chapter, we will cover the use skies and skylight with an HDRI setup.
HDRI lighting
An HDRI is a panoramic picture of sorts that has ‘’High Dynamic Range’’, meaning that it contains more information than your regular image. This sort of picture is particularly useful when attempting to create believable lighting.
Example of an HDRI
For a proper HDRI lighting setup we will need a couple of things:
- HDRI according to our needs for the time of day and look we are trying to go for. (we can find free HDRIs here HDRIs • Poly Haven and here Free 3D Model and Free HDRI Skies | 2G ACADEMY )
- Sphere mesh to project our HDRI onto
- Skylight
For the setup itself we can use a material in Unreal for the HDRI:
<aside>🖼️
</aside>
You can download this text file that contains this material. It’s important to set this settings in the master:
- Shading model should be unlit
- Two Sided can be enabled
- Search for ‘’Is Sky’’. This should be ticked on
Once this material is created we can use any sphere mesh as long as the UVs are properly done on it, and apply a material instance from the master. A sphere can be scaled up to 15.000 units so that it covers most of the world
Example of HDRI applied on a sphere.
After the HDRI is set up, we set the desired intensity in the material instance (depending on what we are going for we can use the Eye Adaption debug view and see which value we have on our sky and check using this table Orders of magnitude (illuminance) - Wikipedia if we are in the correct range)
Then we can apply our Skylight, we set it to movable and the capturing method is ‘’Captured Scene’’. What ‘’Capture Scene’’ will do is that it will use the information from the HDRI and apply it onto the environment. Making it a very consistent setup.
This is even quite useful in an interior situation (assuming we have a window) because this will allow natural light to fill an interior space.
Example of HDRI + Skylight applied on an interior space
If we do any change on the HDRI, the skylight will remain adjusted to it making reflections and bounce light consistent with the HDRI.
The skylight actor has a setting called ‘’Recapture’’ on it’s details panels that helps to refresh the information if we do any change on the sky.
This step is crucial to have correctly lit environments in most situations.
Importance of Fog
After we have decided on our sky/skylight setup, decided on our sun direction/intensity, and we have setup our exposure levels, one of the key elements in an environment is fog or some sort of atmospheric that allows us to separate elements and give depth to our scene. Within Unreal Engine we can use the ‘’Exponential Height Fog’’ (highly recommend reading the documentation to understand the properties of it Exponential Height Fog in Unreal Engine | Unreal Engine 5.5 Documentation | Epic Developer Community | Epic Developer Community )
Let’s take a look at a quick example:
At the moment we have proper sun and shadow direction. Everything is in place to start guiding the eye of the viewer. But at this moment, everything in the environment is taking the same amount of importance. There’s no layering to the image since everything is almost the same value. But when adding the atmospherics:
There’s now a better distinction between the foreground and the background. This will also help you to make the environment feel more alive and natural. Always remember usually the further things are, the more they get affected by atmospherics.
Exterior vs Interior Lighting
Let’s take a look at how these two situations differ from each other. Important to remember our fundamentals apply to both situations and we should be mindful of where and how we place the lights.
Exterior Lighting
For exterior lighting, these are one of the main two things to keep in mind:
- Sun and shadow direction
- Exposure setup & Contrast of shadow and light (mentioned previously in this lesson)
- Usage of atmospherics
Let’s breakdown a couple of examples to showcase how to approach this:
Let’s highlight where some of our shadows and light is
If you see how the shadows wrap the shapes and the image, it serves as a framing element. It allows us to get the attention exactly where we need to, and it gives good readability to our shapes. It makes the image easy to understand. This will differ on the type of lighting we are doing, but our main priority is always going to ensure that our visibility is good and shapes are understandable.
Picture yourself as a player in a game, giving the proper direction to our lighting, and highlighting the important elements, is what allows us to not get lost or be confused during our playthrough. This is where our Lighting Fundamentals are important to remind ourselves with.
Let’s take a look at our second example following the same process:
Interior Lighting
Between the two, interior lighting can be the one that can get a bit tricky to setup. It contains a lot more intrinsic details, therefore proper reference gathering is important.
All we mentioned before (i.e proper light and shadow direction) still applies to interior lighting. What’s important in interior lighting is properly defining where our lights are coming from.
One common mistake beginners make is placing floating lights with no proper justification for them. If we are inside a room, where does our light come from? Is it TV screen? Is it a lamp? Candles? Do we have an open window?
Defining the source is crucial to provide context and proper believability. For Example:
In this particular interior we have no way to use our exterior lighting (i.e using a window). Therefore planning our lights according to which practical light sources is important for a grounded approach to lighting.
Setting up proper exposure levels is key to providing consistency between light source and emissive elements. Please do refer to this list UE4 Tech Art Portfolio which contains good information on what EV100 values are good depending on the situation.
Now in the case that we have a window or some sort of opening, we can use our skylight setup we visited previously in the lesson, because this will allow natural light to fill the room.
Example of HDRI + Skylight applied on an interior space
And we can as well combine it with the Directional Light coming through it to add extra layering and interest to our interior.
Interior lighting may require some more planning on our end as to where we place our practical light sources, or where our openings are located. As long as we define this, no matter the style of the environment, we will create a believable space.
Conclusion
With all of this said, let’s recap the steps I’d personally recommend when starting to setup our lighting:
- Decide time of day/sky/HDRI
- Set up Skylight
- Set up Directional Light and contrast levels
- Set up Exposure
- Tweak Sun direction as necessary
- Introduce volumetrics.
it’s important to remind ourselves that no matter the tools, as long as our fundamentals are strong, we can make good lighting in any engine or type of game. Understanding what do we want to focus on, what are our focal points, will allows us to make good choices.
EXERCISES
Environmental Lighting I - Lighting an AssetPack
Environmental Lighting I - Lighting an AssetPack
OVERVIEW
The steps for this is: 1) Searching for references of lighting/mood we’d like to create 2) Search for the appropiate sky and sun direction 3) Decide on intensities for both sky and sun (ideally PBL focused) 4) Set up proper exposure 5) Add volumetrics as necessary
EXAMPLES
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.