Skip to main content

Introduction to 3D Lighting

Lighting is crucial for creating atmosphere and visual depth in 3D scenes. Godot provides three main light types and advanced global illumination techniques to achieve realistic and performant lighting.
All light nodes inherit from the base Light3D class (doc/classes/Light3D.xml:2).

Light Types

DirectionalLight3D

Simulates distant light sources like the sun

OmniLight3D

Point light radiating in all directions

SpotLight3D

Cone-shaped light like a flashlight

DirectionalLight3D

Models infinite parallel rays from a distant source, typically used for sunlight or moonlight.

Basic Setup

See doc/classes/DirectionalLight3D.xml:7-8
Light is emitted in the -Z direction of the node’s global basis. For an unrotated light, this means light travels forward.

Shadow Configuration

See doc/classes/DirectionalLight3D.xml:24, 21-22

Shadow Split Configuration

For better shadow quality, directional lights use cascaded shadow maps:
Good balance between quality and performance.
See doc/classes/DirectionalLight3D.xml:30-37

Sky Mode

  • SKY_MODE_LIGHT_AND_SKY: Affects both scene and sky (default)
  • SKY_MODE_LIGHT_ONLY: Only lights the scene
  • SKY_MODE_SKY_ONLY: Only affects sky shader
See doc/classes/DirectionalLight3D.xml:39-40

OmniLight3D

Emits light in all directions from a point, like a light bulb or candle.

Basic Setup

See doc/classes/OmniLight3D.xml:23-25
Only 8 omni lights can affect each mesh in Mobile/Compatibility rendering methods. Exceeding this limit causes flickering.

Attenuation

Controls how light fades with distance:
See doc/classes/OmniLight3D.xml:17-21

Shadow Modes

See doc/classes/OmniLight3D.xml:27-28, 32-37

SpotLight3D

Cone-shaped light emission, useful for flashlights, car headlights, or stage lights.

Basic Setup

See doc/classes/SpotLight3D.xml:21-23, 34-36
Light is emitted in the -Z direction. The spot_angle is the angular radius (from center to edge), so a 45° angle creates a 90° cone.

Angle and Range

Attenuation Curves

See doc/classes/SpotLight3D.xml:25-26, 28-32

Common Light Parameters

All light types share these properties from the Light3D base class:

Energy and Color

See doc/classes/Light3D.xml:66-67, 73-74, 102-103

Physical Light Units

For realistic lighting, enable physical units in Project Settings:
See doc/classes/Light3D.xml:85-87, 80-83

Color Temperature

See doc/classes/Light3D.xml:105-107

Negative Lights

Create areas of darkness:
See doc/classes/Light3D.xml:89-90

Indirect Lighting

Control contribution to global illumination:
See doc/classes/Light3D.xml:76-78, 109-111

Shadows

Enabling Shadows

See doc/classes/Light3D.xml:122-123
Shadows have significant performance cost. Use them judiciously and enable distance_fade_enabled for distant lights.

Shadow Quality Parameters

See doc/classes/Light3D.xml:113-114, 125-126, 116-117, 128-129

Percentage-Closer Soft Shadows (PCSS)

Create realistic soft shadows:
See doc/classes/Light3D.xml:57-60, 97-100
PCSS is only supported in Forward+ rendering (not Mobile or Compatibility).

Shadow Cull Mask

See doc/classes/Light3D.xml:119-120

Distance Fade (LOD)

Optimize performance by fading distant lights:
See doc/classes/Light3D.xml:38-53

Light Projectors (Cookies/Gobos)

Project textures through lights:
See doc/classes/Light3D.xml:92-95
Light projectors are only supported in Forward+ and Mobile rendering methods.

Global Illumination (GI)

Godot offers multiple GI techniques:

Bake Modes

See doc/classes/Light3D.xml:62-64, 204-214

LightmapGI

Bake static lighting for best performance:
1

Add LightmapGI Node

Add a LightmapGI node to your scene.
2

Configure Lights

Set lights to BAKE_STATIC mode:
3

Bake Lightmaps

Select the LightmapGI node and click “Bake Lightmaps” in the toolbar.
4

Use Baked Result

Lightmaps are automatically applied to static meshes.

VoxelGI

Real-time voxel-based global illumination:

SDFGI (Signed Distance Field GI)

Enable in WorldEnvironment for large open worlds:

Lighting Best Practices

Always use DirectionalLight3D for primary outdoor lighting:
Too many lights hurt performance. Use distance fade:
For static scenes, use LightmapGI:
Don’t render shadows too far away:
Exclude unnecessary objects from lighting:

Common Lighting Scenarios

Outdoor Daytime

Indoor Room with Window

Night Scene with Moonlight

Torch/Flashlight

Debugging Lights

See doc/classes/Light3D.xml:54-55

Performance Monitoring

3D Overview

3D fundamentals and transforms

Meshes and Materials

How materials interact with lighting

Environment

Sky, fog, and ambient lighting

Shaders

Custom lighting in shaders

Resources