LightmapGI

package
v0.0.0-...-0d6c339 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2025 License: MIT Imports: 29 Imported by: 0

Documentation

Overview

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

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

Performance: graphics.gd/classdb/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 [graphics.gd/classdb/CSGShape3D]s and [graphics.gd/classdb/PrimitiveMesh]es is not supported, as these cannot store UV2 data required for baking.

Note: If no custom lightmappers are installed, graphics.gd/classdb/LightmapGI can only be baked from devices that support the Forward+ or Mobile renderers.

Note: The graphics.gd/classdb/LightmapGI node only bakes light data for child nodes of its parent. Nodes further up the hierarchy of the scene will not be baked.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsLightmapGI() Instance
}

type BakeError

type BakeError int //gd:LightmapGI.BakeError
const (
	// Lightmap baking was successful.
	BakeErrorOk BakeError = 0
	// Lightmap baking failed because the root node for the edited scene could not be accessed.
	BakeErrorNoSceneRoot BakeError = 1
	// Lightmap baking failed as the lightmap data resource is embedded in a foreign resource.
	BakeErrorForeignData BakeError = 2
	// Lightmap baking failed as there is no lightmapper available in this Godot build.
	BakeErrorNoLightmapper BakeError = 3
	// Lightmap baking failed as the [graphics.gd/classdb/LightmapGIData] save path isn't configured in the resource.
	BakeErrorNoSavePath BakeError = 4
	// Lightmap baking failed as there are no meshes whose [graphics.gd/classdb/GeometryInstance3D.Instance.GiMode] is [Geometryinstance3d.GiModeStatic] and with valid UV2 mapping in the current scene. You may need to select 3D scenes in the Import dock and change their global illumination mode accordingly.
	BakeErrorNoMeshes BakeError = 5
	// Lightmap baking failed as the lightmapper failed to analyze some of the meshes marked as static for baking.
	BakeErrorMeshesInvalid BakeError = 6
	// Lightmap baking failed as the resulting image couldn't be saved or imported by Godot after it was saved.
	BakeErrorCantCreateImage BakeError = 7
	// The user aborted the lightmap baking operation (typically by clicking the Cancel button in the progress dialog).
	BakeErrorUserAborted BakeError = 8
	// Lightmap baking failed as the maximum texture size is too small to fit some of the meshes marked for baking.
	BakeErrorTextureSizeTooSmall BakeError = 9
	// Lightmap baking failed as the lightmap is too small.
	BakeErrorLightmapTooSmall BakeError = 10
	// Lightmap baking failed as the lightmap was unable to fit into an atlas.
	BakeErrorAtlasTooSmall BakeError = 11
)

type BakeQuality

type BakeQuality int //gd:LightmapGI.BakeQuality
const (
	// Low bake quality (fastest bake times). The quality of this preset can be adjusted by changing [graphics.gd/classdb/ProjectSettings] "rendering/lightmapping/bake_quality/low_quality_ray_count" and [graphics.gd/classdb/ProjectSettings] "rendering/lightmapping/bake_quality/low_quality_probe_ray_count".
	BakeQualityLow BakeQuality = 0
	// Medium bake quality (fast bake times). The quality of this preset can be adjusted by changing [graphics.gd/classdb/ProjectSettings] "rendering/lightmapping/bake_quality/medium_quality_ray_count" and [graphics.gd/classdb/ProjectSettings] "rendering/lightmapping/bake_quality/medium_quality_probe_ray_count".
	BakeQualityMedium BakeQuality = 1
	// High bake quality (slow bake times). The quality of this preset can be adjusted by changing [graphics.gd/classdb/ProjectSettings] "rendering/lightmapping/bake_quality/high_quality_ray_count" and [graphics.gd/classdb/ProjectSettings] "rendering/lightmapping/bake_quality/high_quality_probe_ray_count".
	BakeQualityHigh BakeQuality = 2
	// Highest bake quality (slowest bake times). The quality of this preset can be adjusted by changing [graphics.gd/classdb/ProjectSettings] "rendering/lightmapping/bake_quality/ultra_quality_ray_count" and [graphics.gd/classdb/ProjectSettings] "rendering/lightmapping/bake_quality/ultra_quality_probe_ray_count".
	BakeQualityUltra BakeQuality = 3
)

type EnvironmentMode

type EnvironmentMode int //gd:LightmapGI.EnvironmentMode
const (
	// Ignore environment lighting when baking lightmaps.
	EnvironmentModeDisabled EnvironmentMode = 0
	// Use the scene's environment lighting when baking lightmaps.
	//
	// Note: If baking lightmaps in a scene with no [graphics.gd/classdb/WorldEnvironment] node, this will act like [EnvironmentModeDisabled]. The editor's preview sky and sun is not taken into account by [graphics.gd/classdb/LightmapGI] when baking lightmaps.
	EnvironmentModeScene EnvironmentMode = 1
	// Use [Instance.EnvironmentCustomSky] as a source of environment lighting when baking lightmaps.
	EnvironmentModeCustomSky EnvironmentMode = 2
	// Use [Instance.EnvironmentCustomColor] multiplied by [Instance.EnvironmentCustomEnergy] as a constant source of environment lighting when baking lightmaps.
	EnvironmentModeCustomColor EnvironmentMode = 3
)

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsLightmapGI

func (self *Extension[T]) AsLightmapGI() Instance

func (*Extension[T]) AsNode

func (self *Extension[T]) AsNode() Node.Instance

func (*Extension[T]) AsNode3D

func (self *Extension[T]) AsNode3D() Node3D.Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsVisualInstance3D

func (self *Extension[T]) AsVisualInstance3D() VisualInstance3D.Instance

type GenerateProbes

type GenerateProbes int //gd:LightmapGI.GenerateProbes
const (
	// Don't generate lightmap probes for lighting dynamic objects.
	GenerateProbesDisabled GenerateProbes = 0
	// Lowest level of subdivision (fastest bake times, smallest file sizes).
	GenerateProbesSubdiv4 GenerateProbes = 1
	// Low level of subdivision (fast bake times, small file sizes).
	GenerateProbesSubdiv8 GenerateProbes = 2
	// High level of subdivision (slow bake times, large file sizes).
	GenerateProbesSubdiv16 GenerateProbes = 3
	// Highest level of subdivision (slowest bake times, largest file sizes).
	GenerateProbesSubdiv32 GenerateProbes = 4
)

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.LightmapGI

Instance of the class with convieniently typed arguments and results.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsLightmapGI

func (self Instance) AsLightmapGI() Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsNode3D

func (self Instance) AsNode3D() Node3D.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsVisualInstance3D

func (self Instance) AsVisualInstance3D() VisualInstance3D.Instance

func (Instance) Bias

func (self Instance) Bias() Float.X

func (Instance) BounceIndirectEnergy

func (self Instance) BounceIndirectEnergy() Float.X

func (Instance) Bounces

func (self Instance) Bounces() int

func (Instance) CameraAttributes

func (self Instance) CameraAttributes() CameraAttributes.Instance

func (Instance) DenoiserRange

func (self Instance) DenoiserRange() int

func (Instance) DenoiserStrength

func (self Instance) DenoiserStrength() Float.X

func (Instance) Directional

func (self Instance) Directional() bool

func (Instance) EnvironmentCustomColor

func (self Instance) EnvironmentCustomColor() Color.RGBA

func (Instance) EnvironmentCustomEnergy

func (self Instance) EnvironmentCustomEnergy() Float.X

func (Instance) EnvironmentCustomSky

func (self Instance) EnvironmentCustomSky() Sky.Instance

func (Instance) EnvironmentMode

func (self Instance) EnvironmentMode() EnvironmentMode

func (Instance) GenerateProbesSubdiv

func (self Instance) GenerateProbesSubdiv() GenerateProbes

func (Instance) ID

func (self Instance) ID() ID

func (Instance) Interior

func (self Instance) Interior() bool

func (Instance) LightData

func (self Instance) LightData() LightmapGIData.Instance

func (Instance) MaxTextureSize

func (self Instance) MaxTextureSize() int

func (Instance) Quality

func (self Instance) Quality() BakeQuality

func (Instance) SetBias

func (self Instance) SetBias(value Float.X)

func (Instance) SetBounceIndirectEnergy

func (self Instance) SetBounceIndirectEnergy(value Float.X)

func (Instance) SetBounces

func (self Instance) SetBounces(value int)

func (Instance) SetCameraAttributes

func (self Instance) SetCameraAttributes(value CameraAttributes.Instance)

func (Instance) SetDenoiserRange

func (self Instance) SetDenoiserRange(value int)

func (Instance) SetDenoiserStrength

func (self Instance) SetDenoiserStrength(value Float.X)

func (Instance) SetDirectional

func (self Instance) SetDirectional(value bool)

func (Instance) SetEnvironmentCustomColor

func (self Instance) SetEnvironmentCustomColor(value Color.RGBA)

func (Instance) SetEnvironmentCustomEnergy

func (self Instance) SetEnvironmentCustomEnergy(value Float.X)

func (Instance) SetEnvironmentCustomSky

func (self Instance) SetEnvironmentCustomSky(value Sky.Instance)

func (Instance) SetEnvironmentMode

func (self Instance) SetEnvironmentMode(value EnvironmentMode)

func (Instance) SetGenerateProbesSubdiv

func (self Instance) SetGenerateProbesSubdiv(value GenerateProbes)

func (Instance) SetInterior

func (self Instance) SetInterior(value bool)

func (Instance) SetLightData

func (self Instance) SetLightData(value LightmapGIData.Instance)

func (Instance) SetMaxTextureSize

func (self Instance) SetMaxTextureSize(value int)

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetQuality

func (self Instance) SetQuality(value BakeQuality)

func (Instance) SetShadowmaskMode

func (self Instance) SetShadowmaskMode(value LightmapGIData.ShadowmaskMode)

func (Instance) SetSupersampling

func (self Instance) SetSupersampling(value bool)

func (Instance) SetSupersamplingFactor

func (self Instance) SetSupersamplingFactor(value Float.X)

func (Instance) SetTexelScale

func (self Instance) SetTexelScale(value Float.X)

func (Instance) SetUseDenoiser

func (self Instance) SetUseDenoiser(value bool)

func (Instance) SetUseTextureForBounces

func (self Instance) SetUseTextureForBounces(value bool)

func (Instance) ShadowmaskMode

func (self Instance) ShadowmaskMode() LightmapGIData.ShadowmaskMode

func (Instance) Supersampling

func (self Instance) Supersampling() bool

func (Instance) SupersamplingFactor

func (self Instance) SupersamplingFactor() Float.X

func (Instance) TexelScale

func (self Instance) TexelScale() Float.X

func (Instance) UseDenoiser

func (self Instance) UseDenoiser() bool

func (Instance) UseTextureForBounces

func (self Instance) UseTextureForBounces() bool

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL