Lesson 36 +10 XP

Light Sources & Modes

Light Sources & Modes

Types of Lights

You add lights to a scene via GameObject -> Light:

  • Directional Light: Behaves like the sun. Located infinitely far away, it shines light in a single direction on everything.
  • Point Light: Emits light in all directions from a point, like a lightbulb.
  • Spot Light: Emits a cone of light in a specific direction, like a flashlight.
  • Area Light: Emits light from a flat shape (rectangle or disc) in one direction. Only available for baked lighting.

Light Modes

Every light has a Mode property:

  • Realtime: Light color and shadows are calculated every frame. Dynamic objects cast dynamic shadows. This is expensive but updates instantly.
  • Baked: Light calculations are done in advance in the editor, and saved to textures called Lightmaps. It does not calculate light at runtime. Extremely fast, but light cannot change during gameplay.
  • Mixed: Combines both. Stationary objects get baked lighting, while moving objects receive real-time direct illumination and cast real-time shadows.

TL;DR

  • Directional (sun), Point (bulb), Spot (cone), and Area (baked rectangle) are the core light types.
  • Realtime lights calculate lighting every frame.
  • Baked lights save calculations to Lightmap textures, running fast but remaining static.
  • Mixed mode blends baked background lighting with real-time actor shadows.