Lighting in Unity Game Engine

Thomas Mauro
4 min readAug 25, 2022

--

Light is an amazing thing that I realize how grateful I am to observe and understand. Light is an element that stimulates sight which enables our ability to actually see things. Glorious photons I would be lost without you. Anyway, this article is about lighting in Unity Game Development Editor and Engine. Just about as cool as the real-life thing with a twist. You get to be the creator of the lighting in your world/game. There are 4 light sources to use in Unity I will quickly fill you in on.

Types of Light in Unity

  • Directional Light
  • Point Light
  • Spot Light
  • Area Light

Directional Light in Unity

That brings us to the first one in my order of Directional Light. Directional light has the behavior like our Sun to Earth. The light will emit infinitely and illuminate the entire scene like it is daylight. If rotated you will get the effect of it being at different times of the day. You have the controls of your own sun actually. Helps you set the lighting for a scene or an area, and helps with showdown effects around objects. It is pretty realistic. Check the sample out below.

Point Light in Unity

This point light effect will emit light from its point and sends light out equally in all directions according to the range and other settings you decide to set. Range/intensity will dictate the light fall off. The point you see hitting a surface is the line from the point of contact back to the center of the light object. “The intensity diminishes with distance from the light, reaching zero at a specified range. Light intensity is inversely proportional to the square of the distance from the source. This is known as ‘inverse square law’ and is similar to how light behaves in the real world”.

Spot Light in Unity

The spot light is like a point light in the way that it has a specific range and location. Light intensity will fall off over the range distance. You can adjust the intensity. A difference is the spotlight is constrained to an angle and has a cone shape illumination region.

A good example of a spotlight is a flashlight in a game. But also can be used to highlight objects within the game the developers want you to look at/to give more life to a scene for more player emergence. I have a spotlight highlighting a mech bot you can see in the sample below.

Area Light in Unity

Unity Area Light can be the shape of a rectangle or disc. Light will emit from one side of the shape. This light will evenly spread in all directions across the surface area of whichever shape. The range you set determines the size. The intensity of the illumination by a Unity Area Light will diminish by the rate set by the inverse square of the distance from the light source (see inverse square law). They can only be backed into lightmaps due to high processor requirements. It also illuminates an object from several areas at once.

This light type might be used for stuff like a realistic street lamps and house interiors. The shading is softer than other light types and tends to offer a slightly more realistic effect than a point light.

Light is emitted across the surface of an Area Light producing a diffuse light with soft shadowing.

--

--