This is the 11th day of my participation in the August More Text Challenge

Lighting in Unity works similar to how light works in the real world. Unity uses detailed ray working models to get more realistic results, and simplified models to get more stylized results.

Directional Lights

  • —– is not related to the position of the light source, mainly the direction of the light (Angle) (association: sun)

Directional light is useful for creating effects such as sunlight in a scene. Directional light behaves like sunlight in many ways, and can be thought of as a source of light that exists at an infinite distance. Directional light does not have any recognizable light source location, so light objects can be placed anywhere in the scene. All objects in the scene are illuminated as if the light is always coming from the same direction. The distance between the light source and the target object is undefined, so the light does not fade out.


Point Lights

  • —– A light source is emitted from a single Point, which can be changed in position.

A point light source is located at a point in space and emits light evenly in all directions. The direction of light hitting the surface is the line returning from the point of contact to the center of the light source object. The intensity decays as it moves away from the light source and becomes zero at a specified distance. The intensity of light is inversely proportional to the square of the distance from the source. This is called the “inverse square law” and is similar to what light does in the real world.


Spot Lights

  • / Can change position and Angle (think: flashlight, searchlight)

Like a point light source, a spot light has a specified position and attenuation range. The difference is that spotlights have an Angle constraint, forming a tapered area of light. The center of the cone points to the luminous (Z) direction of the light source object. The edge of the spot cone will also be dimmed. Widening this Angle increases the width of the cone, and with it the size of this dilution, called the penumbra.

Spotlights are usually used for artificial light sources such as flashlights, car headlights and searchlights. Controlled by script or animation, moving spotlights illuminate a small area of the scene and create a stage-style lighting effect.


Area Lights

  • Area Lights — used to create the light Titus uses when baking — are not available for immediate attention

Region light is defined by rectangles in space. Light is emitted evenly in all directions over the surface area, but only from the side on which the rectangle is located. There is no manual control over the range of the surface light source, but the intensity will decay inversely as the square of the distance away from the light source. Since illumination calculation consumes a lot of processor performance, the surface light source cannot be processed in real time and can only be baked into the illumination map.