Lighting and Setup

Checked with version: 2017.3


Difficulty: Intermediate

At this stage content creators have meshes that are properly textured, an assembled Scene with proper tonemapped Unity render settings, but the Scene will still not look good until a proper lighting setup in place. It is assumed that content creators set the Scene with a Realtime GI strategy and then lit with Realtime lights for instant feedback, despite similar principles also applied towards baking.

Outdoor lighting and Scene setup.

  • Hemisphere lighting. First component for outdoor lighting is Hemisphere lighting, called Environment Lighting in Unity. This is a fancy word for skylight. Night sky has minimal contribution, while daytime sky has very bright contribution. Hemisphere settings can be found under the Lighting tab (Window > Lighting > Settings > Environment). For a start, procedural skybox material would be prefered instead of HDRI cubemap. Create a new material in the project, name it SkyMaterial and then set it to Skybox / Procedural.

Assigned it to Environment Skybox Material inside Lighting tab > Scene.

At this point the Scene is somewhat lit. There is ambient, but not exactly proper hemisphere lighting. We’ll leave this alone for now.

  • Directional Light. Typical Sunlight or Moonlight is usually represented by a directional light. This is due to the parallel nature of its light and shadow direction mimicking light source at close to infinity distance.

  • Global Illumination. Directional light + Ambient alone won’t create believable lighting. Proper hemisphere lighting requires occlusion of the skylight lighting and Sun requires indirect lighting bounce. The sky currently renders a single color value to the Scene making it flat. This is where Realtime Global Illumination or Baked Lighting is required to calculate occlusion and indirect bounce lighting. In order to achieve that, follow these steps:

    • Make sure all meshes that need to contribute to the Realtime GI or baking are flagged with Enable Lightmap Static and Reflection probe static. (Typically large static meshes).

    • Next is to enable Realtime Global Illumination (Leave at default-medium settings) in the Lighting tab > Scene > Realtime Lighting. Hit Generate Lighting or check Auto Generate.

The Scene is now dark after the Scene finished generating lighting. To make matters worse, some elements of the Scene are out of place (Notice the Tram and the door on the background). The static objects in the Scene currently have proper occlusion for hemisphere and indirect bounce response from the directional light, however the rest of the object lack a of proper lighting setup.

  • Light Probes and Reflection Probes. For dynamic objects or non-lightmap objects to receive Realtime/Baked Global Illumination, there needs to be Light probes distributed in the Scene. Make sure to distribute Light probe groups in the Scene efficiently near the area where dynamically lit object located or will pass (such as player). More information for Light Probes group can be found here

Hit Generate Lighting again or wait for the precomputation to finish if Auto Generate is checked.

The Tram and the background door are grounded better, but reflections look out of place. Sky reflection is all over the place and shows up inside the tunnel. This is where reflection probes comes in. Efficiently place reflection probes with proper coverage in the Scene as needed (In the Scene above 1 reflection probe for the entire room is sufficient). 128 pixels Cubemap Resolution using box projection usually is a good baseline for typical cases and will keep memory and reflection bake times happy.

More information for reflection probe can be found here.

The Scene now looks properly grounded and cohesive, an important part of believable Scene. But everything is even darker than before and nowhere near believable quality.

  • HDR Lighting Value. Many content creators don’t realize that, in reality, hemisphere lighting and Sunlights are very bright light sources. They’re much brighter than value 1. This is where HDR lighting comes into play. For now, turn off the directional light and then set the SkyMaterial Exposure to 16. This will give you a good idea what hemisphere lighting does to a Scene.

Things start to look believable. Think of this state as a cloudy day, where sunlight is completely diffused in the sky (directional light don’t show up). At this point sunlight can then be reintroduced back into the Scene at a much higher value, try Intensity 5 for a start. Despite the sun looking nearly white, it is important that color is chosen properly as the impact of indirect color from the strong sun can dramatically change the look of the Scene.

Now the sun (directional light) looks like a high energy light as expected from real life. The Scene looks quite believable at this point.

  • Screen Space Ambient Occlusion and Screen Space Reflection. While the Scene lighting looks pretty good at this point there’s additional details can be added to Scene to push it further. Baking of detailed occlusion usually isn’t possible because of the limited resolution set in the Realtime GI for reasonable performance. This is where Screen Space Ambient Occlusion can help. Enable SSAO in Post Process Profile under Ambient occlusion. Settings for this example is set to Intensity 0.5, Radius 1, Medium Sample count w/ Downsampling and Ambient Only checked for a start.

While SSAO takes care of extra ambient lighting occlusion, reflection could use some accuracy improvements in addition to the simple reflection probes. Screen Space Ray trace Reflection can helps improve this situation. Enable the Screen Space Reflection in the post process profile.

Notice that the left side of the wet track no longer renders bright reflections as SSR gives the Scene more accurate reflections for on screen objects. Both of these post process incur performance costs at runtime, so enable it wisely and set the quality settings at reasonable performance impact to fit runtime requirements.

  • Fog At this stage the content creators have achieved somewhat believable outdoor and indoor value separation on a fixed exposure. Reflection is visible in the dark indoor areas as strong highlights and not dim muddy values.

However the Scene foreground elements and background elements are not showing up despite having strong perspective elements. A subtle fog in the Scene can create a massive difference in giving the Scene additional dimension.

Notice the foreground railing have better definition compared to the zero fog Scene. Fog is enabled in Lighting tab > Scene > Other Settings. Fog color #6D6B4EFF, Exponential at 0.025 density is enabled here. In deferred rendering, fog might also need to be enabled in the post process profile if its not activated automatically.

Indoor and local lighting

  • Spotlight / Pointlight The staples of real time local lighting are spotlights and pointlights. Area lighting can only be used when baking lighting, with the exception of HD Scriptable Render Pipeline. There are new area lights that can be rendered in realtime in HD SRP mode. Fundamentally both of these types of lights emit light from one point in space and are limited by range with the spotlight having an additional limit by angle. More information can be found here.

The big differences between the two lights have to do with the way they casts shadows and interact with cookies. Shadowing with a Pointlight costs 6 shadow maps compared to a Spotlight’s single shadow map. For this reason point lights are much more expensive and should be used very sparingly. NOTE: Baked lights don’t need to worry about this issue. Another difference is that a cookie texture on a Spotlight is a simple straight forward 2d texture while a pointlight requires a cubemap, usually authored in 3D software. More information here.

  • Colour and Intensity of light. Choosing the proper colour and intensity for your lights needs to follow some loose guidelines to give plausible results. Factors that need to be considered is the effect of the color and value chosen. When selecting intensity for indoor lights, try to make sure no indoor lights have a greater intensity than the sun’s. This can create an unbalanced look depending on the Scene.

Given this Scene setting, it’s very unlikely that there’s a high intensity lights shining from the ceiling that exceed the brightness of the daylight time.

When selecting colour, try not to leave out any one of the colour channels completely. This creates a light that has problem converging to the white point.

While it is technically a valid light color, the light color on the left image removes all blue color from the final output. Having a limited final color palette in the Scene for a baseline is not a great idea, especially if color grading is expected to be done later on.

  • Emissive Surfaces In Unity, emissive surfaces can contribute to lighting if Realtime GI or baked GI is enabled, giving the effect of area lighting. This is especially useful if Realtime GI is enabled. content creators can modify the intensity and color of the emissive surface and get the feedback immediately, assuming that precompute had been done ahead of time.

Image above showcase subtle diffuse lighting coming from small meshes on the ceiling.

At this point, your content creators should have a good understanding of how to setup and light a Scene to look believable.


  1. Introduction to Lighting and Rendering
  2. Choosing a Lighting Technique
  3. The Precompute Process
  4. Choosing a Rendering Path
  5. Choosing a Color Space
  6. High Dynamic Range (HDR)
  7. Reflections
  8. Ambient Lighting
  9. Light Types
  10. Emissive Materials
  11. Light Probes
  1. Introduction to Precomputed Realtime GI
  2. Realtime Resolution
  3. Understanding Charts
  4. Starting the precompute process
  5. Probe lighting
  6. Unwrapping and Chart reduction
  7. Optimizing Unity's auto unwrapping
  8. Understanding Clusters
  9. Fine tuning with Lightmap Parameters
  10. Summary - Precomputed Realtime GI
  1. Lighting Overview
  2. Lights
  3. Materials
  4. The Standard Shader
  5. Textures
  6. Using Skyboxes
  7. A Gentle Introduction to Shaders
  8. Using detail textures for extra realism close-up
  9. Frame Debugger
  1. Cameras
  2. Image Effects: Overview
  1. Meshes
  2. Mesh Renderers and Mesh Filters
  1. Where to Start?
  2. Preparing Unity Render Settings
  3. Lighting Strategy
  4. Modeling
  5. Standard Shader/Material PBS and texturing
  6. Lighting and Setup
  7. Understanding Post Process Features
  8. Dynamically Lit Objects
  9. Sample Project File
  1. Using Cameras
  2. Using Lights
  3. Fun with Lasers!
  4. The Particle System
  5. Cinematic Explosions - PIT
  6. Cinematic Composition - PIT
  7. Image Effects: Overview
  8. Fun with Explosions!
  9. Exploring the Blacksmith Environment
  1. Turning it up to 11: Making Unity 5 look Awesome!
  1. Substance - Introduction
  2. Substance - Understanding PBR
  3. Substance - Working with PBR in Unity
  4. Substance - Using Substance materials in Unity
  5. Substance - Optimization for Substance materials
  6. Substance - Creating rock shapes
  7. Substance - Creating rock material, Pt 1
  8. Substance - Creating rock material, Pt 2
  9. Substance - Creating the dirt ground material
  10. Substance - Creating the rock ground material, Pt 1
  11. Substance - Creating the rock ground material, Pt 2
  12. Substance - Publishing the Substance
  13. Substance - Creating a blocking scene
  14. Substance - Creating the ground model
  15. Substance - Modelling the rock assets
  16. Substance - Texturing the upper body
  17. Substance - Exporting textures from Substance Painter
  18. Substance - Creating a scene in Unity, Pt 1
  19. Substance - Creating a scene in Unity, Pt 2
  1. Introduction and Goals
  2. Flame Particles Overview
  3. Particle Emission and Color
  4. Adding Movement To Particles With Noise
  5. Creating The Ember Particles
  6. Adding Lighting To Particles
  7. Creating Sparks With Particle Trails
  8. Particle Question and Answers
  1. Introduction and Goals
  2. Adding a Second Camera
  3. Adding Minimap Icons
  4. Render Textures and UI
  5. Adding A UI Mask and Border Image
  6. Questions and Answers
  1. Session Introduction
  2. Rendering In Unity
  3. Anatomy Of An Unlit Shader
  4. The Vertex Function
  5. The Fragment Function and Color Tint
  6. Making A Transparent Shader
  7. Displacing Vertices and Clipping Pixels
  8. Questions and Answers
  1. Introduction and Session Goals
  2. The VideoPlayer Component
  3. Texturing Objects With Video
  4. Playing and Pausing
  5. Playing A New Clip
  6. Displaying Current Time and Clip
  7. Animated Playhead
  8. Questions and Answers
  1. Overview and Goals
  2. Tonemapping and Color Grading
  3. Camera Movement & Animation
  4. Post Processing Volumes
  5. Timeline & Cinemachine
  6. Questions and Answers