LightmapGI

Inherits: VisualInstance3D < Node3D < Node < Object

Computes and stores baked lightmaps for fast global illumination.

Description

The LightmapGI node is used to compute and store baked lightmaps. Lightmaps are used to provide high-quality indirect lighting with very little light leaking. LightmapGI can also provide rough reflections using spherical harmonics if directional is enabled. Dynamic objects can receive indirect lighting thanks to light probes, which can be automatically placed by setting generate_probes_subdiv to a value other than GENERATE_PROBES_DISABLED. Additional lightmap probes can also be added by creating LightmapProbe nodes. The downside is that lightmaps are fully static and cannot be baked in an exported project. Baking a LightmapGI node is also slower compared to VoxelGI.

Procedural generation: Lightmap baking functionality is only available in the editor. This means LightmapGI is not suited to procedurally generated or user-built levels. For procedurally generated or user-built levels, use VoxelGI or SDFGI instead (see Environment.sdfgi_enabled).

Performance: LightmapGI provides the best possible run-time performance for global illumination. It is suitable for low-end hardware including integrated graphics and mobile devices.

Note: Due to how lightmaps work, most properties only have a visible effect once lightmaps are baked again.

Note: Lightmap baking on CSGShape3Ds and PrimitiveMeshes is not supported, as these cannot store UV2 data required for baking.

Note: If no custom lightmappers are installed, LightmapGI can only be baked when using the Vulkan backend (Forward+ or Mobile), not OpenGL.

Tutorials

Properties

float

bias

0.0005

int

bounces

3

CameraAttributes

camera_attributes

bool

directional

false

Color

environment_custom_color

float

environment_custom_energy

Sky

environment_custom_sky

EnvironmentMode

environment_mode

1

GenerateProbes

generate_probes_subdiv

2

bool

interior

false

LightmapGIData

light_data

int

max_texture_size

16384

BakeQuality

quality

1

bool

use_denoiser

true


Enumerations

enum BakeQuality:

BakeQuality BAKE_QUALITY_LOW = 0

Low bake quality (fastest bake times). The quality of this preset can be adjusted by changing ProjectSettings.rendering/lightmapping/bake_quality/low_quality_ray_count and ProjectSettings.rendering/lightmapping/bake_quality/low_quality_probe_ray_count.

BakeQuality BAKE_QUALITY_MEDIUM = 1

Medium bake quality (fast bake times). The quality of this preset can be adjusted by changing ProjectSettings.rendering/lightmapping/bake_quality/medium_quality_ray_count and ProjectSettings.rendering/lightmapping/bake_quality/medium_quality_probe_ray_count.

BakeQuality BAKE_QUALITY_HIGH = 2

High bake quality (slow bake times). The quality of this preset can be adjusted by changing ProjectSettings.rendering/lightmapping/bake_quality/high_quality_ray_count and ProjectSettings.rendering/lightmapping/bake_quality/high_quality_probe_ray_count.

BakeQuality BAKE_QUALITY_ULTRA = 3

Highest bake quality (slowest bake times). The quality of this preset can be adjusted by changing ProjectSettings.rendering/lightmapping/bake_quality/ultra_quality_ray_count and ProjectSettings.rendering/lightmapping/bake_quality/ultra_quality_probe_ray_count.


enum GenerateProbes:

GenerateProbes GENERATE_PROBES_DISABLED = 0

Don't generate lightmap probes for lighting dynamic objects.

GenerateProbes GENERATE_PROBES_SUBDIV_4 = 1

Lowest level of subdivision (fastest bake times, smallest file sizes).

GenerateProbes GENERATE_PROBES_SUBDIV_8 = 2

Low level of subdivision (fast bake times, small file sizes).

GenerateProbes GENERATE_PROBES_SUBDIV_16 = 3

High level of subdivision (slow bake times, large file sizes).

GenerateProbes GENERATE_PROBES_SUBDIV_32 = 4

Highest level of subdivision (slowest bake times, largest file sizes).


enum BakeError:

BakeError BAKE_ERROR_OK = 0

Lightmap baking was successful.

BakeError BAKE_ERROR_NO_SCENE_ROOT = 1

Lightmap baking failed because the root