How to light night time outdoor scene with a "starry" sky in Unreal Engine 4?
There are 2 major obstacles with lighting night time scenes (or daytime scenes).
First is artistic. You have to understand color theory and how lighting works to communicate proper feel, mood, and atmosphere of the environment.
Second is technical. You have to know which actors to use, which properties to change and in what order. You also have to have the content to light the scene with, such as sky Static Mesh and sky material.
In this 2-part tutorial series we'll cover both obstacles but mainly focus on the second issue - technical; how to light a night time scene, which actors to use and which properties to change.
2 tutorials in this series are:
Here is what you can expect to learn from the following tutorial:
To light night time outdoor scenes in Unreal Engine 4 you need a Sky Sphere (aka: sky dome or skybox), Sky Light, Directional Light (if you have a moon in the sky), sky material, atmosphere (fog) and artificial lights (Spot Lights and/or Point Lights):
We will be using "BP_Sky_Sphere" that comes with Unreal Engine 4 and we will tweak it to what we want in our scene.
I know there is a great want to create everything yourself. I even have a complete tutorial series on it "Custom Static Mesh Formula".
But if you have to create everything from scratch every time you set out to do an environment - projects will take a long time to build. I recommend using all the tools at your disposal, this includes:
Get something started quickly and update as you move forward. Create custom content and replace default content as you iterate.
"BP_Sky_Sphere" is a Blueprint Sky set up that contains certain amount of customization right out of the box. This includes:
There are some limitations with using "BP_Sky_Sphere". For example you can't have both moon and stars at the same time and you can't change the size or how the moon looks.
Also, if you want something more complex such as rotating sky sphere, shooting stars, planets or night-to-day cycle that is something outside the scope of this tutorial. So if you have something more specific in mind, you'll have to create your own custom sky material and use that instead.
We'll be working with the constraints of "BP_Sky_Sphere" but even then we can get good night time sky results.
The quickest way to get access to Blueprint Sky Sphere and its functionality is to go "File > New Level":
Select "Default Level":
You will have the "Blueprint Sky Sphere", "Directional Light" and "Atmospheric Fog" which all are connected to work together.
There will also be a "Sky Light", "Player Start", "Sphere Reflection Capture" and a ground plane.
You can use this scene and build your environment in.
We will cover Blueprint Sky Sphere Option #2 (Manual Setup) in the second tutorial. Where we'll insert all the actors ourselves and make them work together to understand the process and actor relationship better.
I have an environment already built inside this "Default Level" to give us some sort of context for lighting the night time scene.
Nothing in the "Default Level" was changed other than constructing this environment using Static Meshes, inserting ocean water that comes with Starter Content and using very simple landscape.
Following night time scenario will give you a starry sky without a moon.
Finished sky we are after:
If you want night time moon sky, see the second tutorial.
For starry sky, the "Directional Light" needs to point up. This means you won't be able to use the Directional Light and you'll to use other lights such as a Sky Light, Spot Lights and Point Lights.
We wouldn't want to use "Directional Light" to light our night time scene anyway. The "Directional Light" will produce shadows and this will not work in this particular example. It will work if we have a moon but not when we need diffused lighting without strong shadows coming from a directional light source which is what would happen if "Directional Light" was used.
Select the "Sky Sphere" and in "Details" panel disable "Sun Brightness: 0":
This will remove the sun disk from the sky:
Select "Directional Light" and change the rotation of the actor to:
This points the "Directional Light" up. The way this Blueprint is set up it also changes the sky material to display stars. Although the starry sky will not show up yet:
To see the night time sky and stars you need to "Refresh Material" on "BP_Sky_Sphere".
Select the Sky and click "Refresh Material":
We can now see the night time sky and stars. This is a good start:
Insert "Post Process Volume" into the scene:
With "Post Process Volume" selected, go to "Details" panel and enable "Infinite Extent (Unbound)":
This will make the "Post Process Volume" universal, whether you are inside this volume or not.
"Auto Exposure" (Eye Adaptation) is a very useful tool that should be adjusted to your scene.
I usually disable "Auto Exposure" at the beginning of environment creation but when I get to lighting and post process stage, I adjust it to make it work for the scene.
Select "Post Process" and change "Min/Max Brightness" values. I set up mine to (exposing for the sky):
You can always come back to re-adjust "Auto Exposure" anytime, especially when you are tweaking lighting.
We'll now change colors of the sky.
Select the sky and disable "Colors Determined by Sun Position", doing this will enable us to change Zenith, Horizon, Cloud and Overall colors of the sky:
It will reset the colors of the sky sphere:
But don't worry, we'll change this.
Following 4 properties will determine the color of the sky. Change these to what you want your sky color to be:
Here is what we have so far:
If you look at your scene from below you will see the "Directional Light" affecting the bottom of our environment:
Decrease "Directional Light" intensity:
In order to get starry sky, we need "Directional Light" to point up but we need this light to be off or have very low intensity value such as ".0001".
Lowering "Intensity" to 0 doesn't work:
So a very low intensity value should be used, which I set mine to "Intensity: .001".
Optional: You can also disable "Affect World" to remove "Directional Light" influence in the scene:
Select "Blueprint Sky" and adjust "Cloud Speed", "Cloud Opacity" and "Star Brightness" to your liking.
I changed my values to:
Current sky result:
Insert a "Lightmass Importance Volume":
Scale this volume to cover the important parts of your level where you want to focus your lighting in:
Since we won't use "Directional Light" to light our scene, we'll need to work with the following:
Since we don't have a "Directional Light" contributing to the scene, we need other ways of lighting. In our case this is a "Sky Light" which is already included in "Default Level".
I will change mobility of the "Sky Light" to "Stationary":
In the default Level" it is set to "Static" but because I have water in my scene, I need to change it to Stationary. If you don't have a large body of water like I do, you can keep it to "Static".
Let's bake our lighting to see what the environment looks like right now.
"Bake Lights" on "Preview":
Here is what we currently have and it is very dark. We can't see our environment and we can sort of see our starry sky:
"Sky Light" is affecting our scene but it is so subtle we can't even see it.
We have 2 options on how to use the "Sky Light":
The 2 major concerns with using "SLS Specified Cubemap" is finding HDRI cubemap texture that mimics the night time sky material in the scene and the interior spaces will be lit the same way as exterior spaces. So basically the entire environment is lit by the cubemap whether it is an exterior or an interior.
We'll be using "SLS Capture Scene", which uses the scene's sky.
Select the "Sky Light" and set the following options:
Important Note: night time lighting is subtle and doesn't come through in screenshots as much as it does on the monitor. I had to increase some values higher so you can see the results better.
Here is before/after adjusting the "Sky Light" "Intensity: 1" and "Indirect Lighting Intensity: 1":
Here is after adjusting the "Sky Light" "Intensity: 4" and "Indirect Lighting Intensity: 35". I used higher intensity values only for showing so it comes through in the screenshot better:
It is still too dark.
Let's add a bit more diffused lighting. We can increase "Sky Light" "Intensity" and "Indirect Lighting Intensity" but instead we'll adjust "Environment Color" under "World Settings":
"Environment Color" represents a constant light color surrounding the upper hemisphere of the environment (like a sky). Be careful using it as the light doesn't get bounced as indirect lighting and it causes incorrect reflection capture brightness. It is better to stick with using a "Sky Light". Knowing these limitations we can still use "Environment Color" to our advantage.
Under "World Settings" I changed "Environment Color" values to ("Hex sRGB: 0D1A30FF"):
To see the results we need to build lighting.
Without "Environment Color":
With "Environment Color". Again I had to increase the intensity of "Environment Color" so it shows up in the screenshot. The "Hex sRGB" value of "Environment Color" in the screeshot below is "1A2D50FF":
No night time lighting is complete without some complimentary lights. In this example we'll use a light post Static Mesh and a "Spot Light":
Properties I used for the "Spot Light" are:
"Atmospheric Fog" relies on the "Directional Light" to calculate fog. Since we are not using "Directional Light" we are going to turn off "Atmospheric Fog" and use "Exponential Height Fog".
Select "Atmospheric Fog" and disable "Visible" or delete the fog actor completely:
Insert "Exponential Height Fog":
I've adjusted the following properties to fit the scene:
Let's add more atmospheres to the scene by enabling "Volumetric Fog" and setting up few options:
When working with Static Lighting you will need to do a lot of bake tests to achieve the final result. Although I didn't show you the constant lighting builds I had to do, I went through a lot of them to achieve the outcome that looks good.
Here is the build with everything we've done so far:
The scene looks a bit too dark, we lose definition in the distant landscape, there is lack of contrast and starry sky is being hidden by the fog.
We'll take care of all this using "Color Grading".
Color Look Up Table or LUT is a way to color correct your scene using a texture file with information on how your scene looks.
You can download this small texture file on this page from Unreal Engine.com.
I've also added it below:
Basically, LUT allows you to color correct colors and values of the scene.
To do this I took a screenshot in UE4 by pressing F9. Here is the screenshot I took in-game before any adjustments:
Open the screenshot in Photoshop and using "Adjustment Layers" I changed "Levels", "Brightness/Contrast" and "Color Balance":
Result of "Adjustment Layers":
I then placed the LUT texture underneath the "Adjustment Layers":
Cropped it to the LUT texture and saved it as PNG.
Below is the actual adjusted PNG LUT texture. If you want to use this in UE4, make sure you "Right-Click and Save As" the image below then import it into UE4:
This file now contains color information from "Adjustment Layers" that will display the same results in UE4.
I imported the LUT texture into UE4 and changed its properties to:
In "Post Process Volume" under "Color Grading LUT" I used the imported LUT texture:
The scene will now display the same adjustments I made in Photoshop:
LUTs are a great way to change how your scene looks but there is a problem using them.
LUTs fail to be consistent across different displays such as HDR displays.
LUTs happen in Low Dynamic Range and they are adjusted at a moment in time at whatever your current display is they fail to maintain the same result for whatever the final output may be. This is a problem.
Since Unreal Engine 4.16, LUTs are being used less and Epic Games recommended using new "Color Grading" controls in "Post Process":
I used the LUT as a target what I wanted to achieve, then adjusted the "Color Grading" options in "Post Process" to match the LUT. I did not use LUT in the final scene, but everything was done through "Color Grading" options.
Here are all the inputs I adjusted:
All content on this website is copyrighted ©2008-2018 World of Level Design LLC by Alex Galuzin. All rights reserved.
Duplication and distribution is illegal and strictly prohibited.
World of Level Design LLC is an independent company. World of Level Design website, its tutorials and products are not endorsed, sponsored or approved by any mentioned companies on this website in any way. All content is based on my own personal experimentation, experience and opinion. World of Level Design™ and 11 Day Level Design™ are trademarks of Alex Galuzin.
Template powered by w3.css