Facebook

Ambient Lighting in Unity

by Michael Sacco Published January 4, 2024

What is Ambient light?

Ambient lighting provides an overall, uniform illumination for a room, space, or environment. This is the baseline lighting level of a space. You may add punctual lights in targeted areas of your space to call attention to or highlight specific areas.

What is Ambient light in Unity?

Ambient light is light that is present all around the Scene. It doesn’t come from a specific source or direction. Instead, it is applied equally based on the normal of the material. It is also known as diffuse environmental light. It can also be referred to as world lighting.

Ambient Lighting has a crucial impact on the look of your scene. It can also have a big effect on the overall brightness of your scene.

What color should ambient light be?

Soft colors work best. Try not to overdo it. Use a low brightness and low saturation to add a little bit of lighting throughout the scene. If your ambient light is too strong, it will wash out your directional and punctual lighting. If you have a skybox, it is often best to use the Skybox Material. Using the Skybox Material will provide realistic, slightly uneven ambient lighting to help your scene feel grounded.

When do I use Ambient lighting in Unity?

Ambient light is important to nailing the look of your chosen environment.

For example, there is no ambient light in Space. So, if your game is set in Space, you should turn off the Ambient light.

In contrast, you may want to reduce the intensity of shadows in a cartoony scene. In that case, you might choose to use a Gradient ambient light with relatively bright values.

How do you make ambient light in Unity?

Unity automatically has ambient light. You can select the ambient light source from the Lighting settings window (Window > Rendering > Lighting). You can select one Source from the three Source options: Skybox, Gradient, and Color. The default setting is Skybox, which is the source of the ambient light, so the colors will look natural and will match the skybox material.

How do you make a gradient ambient light in Unity?

Open the Lighting settings window (Window > Rendering > Lighting). Then, set the Source to Gradient. You can now set the Ground, Horizon, and Sky colors. Unity automatically interpolates between these colors based on the normal vector of the material.

How do I change ambient color in Unity?

In the main menu, click Window > Rendering > Lighting in the main menu. The Lighting window will appear. Inside the Lighting window, open the Scene tab. Change the Environment Lighting Source to Color. Now you can change Ambient Color to any color you want.

How do you change environment lighting in Unity?

In Unity, you can customize the Environment Lighting. To do this, go to Window > Rendering > Lighting > Environment Lighting in the main menu and make your desired changes to the settings in the Environment tab.

How do I turn off ambient light in Unity?

Window > Rendering > Lighting > Environment Lighting > Change Ambient Lighting Mode to Color > Set Ambient Color to Black

How to make the scene completely dark in Unity

To make the scene completely dark, turn off your ambient lighting, then remove any light sources.

How to make the background black in Unity

Open your Main Camera in your Scene. In your Camera component, look for the Clear Flags option. Clear Flags has three options: Skybox, Color, and Nothing. Change the Camera Clear Flag from Skybox to Color. Then, change the Background color to Black.

What to do if your ambient light is not working

If you enable the Baked or Precomputed Realtime GI, the Environmental Lighting color will be blocked by objects in your scene. This can gives a more realistic result. But, it can make it appear like your ambient light is not working inside buildings or corridors.

How can I add an ambient lighting value via shader

To add a flat ambient light term with a shader, you will need to create a new shader with a custom lighting model. Then, add a Property for “Ambient Color”. Finally, add the “Ambient Color” to the final lighting data in your shader.

How to change ambient light via script

You can change the ambient light via script by using the RenderSettings.ambientLight property.

RenderSettings.ambientLight = Color.black;

Recommended Reading

Free download: Indie Game Marketing Checklist

Download now

Category

lighting and rendering

Don't forget to share this post!

Popular assets for Unity

See all assets ->
    Cutting-edge volumetric fog and volumetric lighting with support for transparent materials.
    Volumetric clouds, day night cycles, dynamic skies, global lighting, weather effects, and planets and moons.
    A lightweight procedural skybox ideal for semi-stylized projects.
    Image-based Outlines for 2D and 3D games with variable line weight, color, and displacement options.
    Per-pixel gaussian blur on your entire screen, part of the UI, or in-scene objects.
    Drag-and-drop ready-to-use ambient, impact, and spell particle effects.

Free Indie Game Marketing Checklist

Learn how to make your game successful with this handy checklist.

Download for free