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. 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.

Enumerations

enum BakeQuality:

  • BAKE_QUALITY_LOW = 0

  • BAKE_QUALITY_MEDIUM = 1

  • BAKE_QUALITY_HIGH = 2

  • BAKE_QUALITY_ULTRA = 3


enum GenerateProbes:

  • GENERATE_PROBES_DISABLED = 0

  • GENERATE_PROBES_SUBDIV_4 = 1

  • GENERATE_PROBES_SUBDIV_8 = 2

  • GENERATE_PROBES_SUBDIV_16 = 3

  • GENERATE_PROBES_SUBDIV_32 = 4


enum BakeError:

  • BAKE_ERROR_OK = 0

  • BAKE_ERROR_NO_LIGHTMAPPER = 1

  • BAKE_ERROR_NO_SAVE_PATH = 2

  • BAKE_ERROR_NO_MESHES = 3

  • BAKE_ERROR_MESHES_INVALID = 4

  • BAKE_ERROR_CANT_CREATE_IMAGE = 5

  • BAKE_ERROR_USER_ABORTED = 6


enum EnvironmentMode:

  • ENVIRONMENT_MODE_DISABLED = 0

  • ENVIRONMENT_MODE_SCENE = 1

  • ENVIRONMENT_MODE_CUSTOM_SKY = 2

  • ENVIRONMENT_MODE_CUSTOM_COLOR = 3

Property Descriptions

Default

0.0005

Setter

set_bias(value)

Getter

get_bias()


Default

1

Setter

set_bounces(value)

Getter

get_bounces()


Default

false

Setter

set_directional(value)

Getter

is_directional()


  • Color environment_custom_color

Setter

set_environment_custom_color(value)

Getter

get_environment_custom_color()


  • float environment_custom_energy

Setter

set_environment_custom_energy(value)

Getter

get_environment_custom_energy()


  • Sky environment_custom_sky

Setter

set_environment_custom_sky(value)

Getter

get_environment_custom_sky()


Default

0

Setter

set_environment_mode(value)

Getter

get_environment_mode()


Default

0

Setter

set_generate_probes(value)

Getter

get_generate_probes()


Default

false

Setter

set_interior(value)

Getter

is_interior()


Setter

set_light_data(value)

Getter

get_light_data()


  • int max_texture_size

Default

16384

Setter

set_max_texture_size(value)

Getter

get_max_texture_size()


Default

1

Setter

set_bake_quality(value)

Getter

get_bake_quality()


Default

true

Setter

set_use_denoiser(value)

Getter

is_using_denoiser()