Light3D

package
v0.0.0-...-503a9e4 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2025 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Light3D is the abstract base class for light nodes. As it can't be instantiated, it shouldn't be used directly. Other types of light nodes inherit from it. Light3D contains the common variables and parameters used for lighting.

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
	AsLight3D() Instance
}

type BakeMode

type BakeMode int //gd:Light3D.BakeMode
const (
	// Light is ignored when baking. This is the fastest mode, but the light will be taken into account when baking global illumination. This mode should generally be used for dynamic lights that change quickly, as the effect of global illumination is less noticeable on those lights.
	//
	// Note: Hiding a light does not affect baking [graphics.gd/classdb/LightmapGI]. Hiding a light will still affect baking [graphics.gd/classdb/VoxelGI] and SDFGI (see [graphics.gd/classdb/Environment.Instance.SdfgiEnabled]).
	BakeDisabled BakeMode = 0
	// Light is taken into account in static baking ([graphics.gd/classdb/VoxelGI], [graphics.gd/classdb/LightmapGI], SDFGI ([graphics.gd/classdb/Environment.Instance.SdfgiEnabled])). The light can be moved around or modified, but its global illumination will not update in real-time. This is suitable for subtle changes (such as flickering torches), but generally not large changes such as toggling a light on and off.
	//
	// Note: The light is not baked in [graphics.gd/classdb/LightmapGI] if [Instance.EditorOnly] is true.
	BakeStatic BakeMode = 1
	// Light is taken into account in dynamic baking ([graphics.gd/classdb/VoxelGI] and SDFGI ([graphics.gd/classdb/Environment.Instance.SdfgiEnabled]) only). The light can be moved around or modified with global illumination updating in real-time. The light's global illumination appearance will be slightly different compared to [BakeStatic]. This has a greater performance cost compared to [BakeStatic]. When using SDFGI, the update speed of dynamic lights is affected by [graphics.gd/classdb/ProjectSettings] "rendering/global_illumination/sdfgi/frames_to_update_lights".
	BakeDynamic BakeMode = 2
)

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]) AsLight3D

func (self *Extension[T]) AsLight3D() 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 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.Light3D

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) AsLight3D

func (self Instance) AsLight3D() 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) DistanceFadeBegin

func (self Instance) DistanceFadeBegin() Float.X

func (Instance) DistanceFadeEnabled

func (self Instance) DistanceFadeEnabled() bool

func (Instance) DistanceFadeLength

func (self Instance) DistanceFadeLength() Float.X

func (Instance) DistanceFadeShadow

func (self Instance) DistanceFadeShadow() Float.X

func (Instance) EditorOnly

func (self Instance) EditorOnly() bool

func (Instance) GetCorrelatedColor

func (self Instance) GetCorrelatedColor() Color.RGBA

Returns the [Color.RGBA] of an idealized blackbody at the given Instance.LightTemperature. This value is calculated internally based on the Instance.LightTemperature. This [Color.RGBA] is multiplied by Instance.LightColor before being sent to the graphics.gd/classdb/RenderingServer.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) LightAngularDistance

func (self Instance) LightAngularDistance() Float.X

func (Instance) LightBakeMode

func (self Instance) LightBakeMode() BakeMode

func (Instance) LightColor

func (self Instance) LightColor() Color.RGBA

func (Instance) LightCullMask

func (self Instance) LightCullMask() int

func (Instance) LightEnergy

func (self Instance) LightEnergy() Float.X

func (Instance) LightIndirectEnergy

func (self Instance) LightIndirectEnergy() Float.X

func (Instance) LightIntensityLumens

func (self Instance) LightIntensityLumens() Float.X

func (Instance) LightIntensityLux

func (self Instance) LightIntensityLux() Float.X

func (Instance) LightNegative

func (self Instance) LightNegative() bool

func (Instance) LightProjector

func (self Instance) LightProjector() Texture2D.Instance

func (Instance) LightSize

func (self Instance) LightSize() Float.X

func (Instance) LightSpecular

func (self Instance) LightSpecular() Float.X

func (Instance) LightTemperature

func (self Instance) LightTemperature() Float.X

func (Instance) LightVolumetricFogEnergy

func (self Instance) LightVolumetricFogEnergy() Float.X

func (Instance) SetDistanceFadeBegin

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

func (Instance) SetDistanceFadeEnabled

func (self Instance) SetDistanceFadeEnabled(value bool)

func (Instance) SetDistanceFadeLength

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

func (Instance) SetDistanceFadeShadow

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

func (Instance) SetEditorOnly

func (self Instance) SetEditorOnly(value bool)

func (Instance) SetLightAngularDistance

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

func (Instance) SetLightBakeMode

func (self Instance) SetLightBakeMode(value BakeMode)

func (Instance) SetLightColor

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

func (Instance) SetLightCullMask

func (self Instance) SetLightCullMask(value int)

func (Instance) SetLightEnergy

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

func (Instance) SetLightIndirectEnergy

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

func (Instance) SetLightIntensityLumens

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

func (Instance) SetLightIntensityLux

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

func (Instance) SetLightNegative

func (self Instance) SetLightNegative(value bool)

func (Instance) SetLightProjector

func (self Instance) SetLightProjector(value Texture2D.Instance)

func (Instance) SetLightSize

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

func (Instance) SetLightSpecular

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

func (Instance) SetLightTemperature

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

func (Instance) SetLightVolumetricFogEnergy

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

func (*Instance) SetObject

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

func (Instance) SetShadowBias

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

func (Instance) SetShadowBlur

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

func (Instance) SetShadowCasterMask

func (self Instance) SetShadowCasterMask(value int)

func (Instance) SetShadowEnabled

func (self Instance) SetShadowEnabled(value bool)

func (Instance) SetShadowNormalBias

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

func (Instance) SetShadowOpacity

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

func (Instance) SetShadowReverseCullFace

func (self Instance) SetShadowReverseCullFace(value bool)

func (Instance) SetShadowTransmittanceBias

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

func (Instance) ShadowBias

func (self Instance) ShadowBias() Float.X

func (Instance) ShadowBlur

func (self Instance) ShadowBlur() Float.X

func (Instance) ShadowCasterMask

func (self Instance) ShadowCasterMask() int

func (Instance) ShadowEnabled

func (self Instance) ShadowEnabled() bool

func (Instance) ShadowNormalBias

func (self Instance) ShadowNormalBias() Float.X

func (Instance) ShadowOpacity

func (self Instance) ShadowOpacity() Float.X

func (Instance) ShadowReverseCullFace

func (self Instance) ShadowReverseCullFace() bool

func (Instance) ShadowTransmittanceBias

func (self Instance) ShadowTransmittanceBias() Float.X

func (Instance) Virtual

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

type Param

type Param int //gd:Light3D.Param
const (
	// Constant for accessing [Instance.LightEnergy].
	ParamEnergy Param = 0
	// Constant for accessing [Instance.LightIndirectEnergy].
	ParamIndirectEnergy Param = 1
	// Constant for accessing [Instance.LightVolumetricFogEnergy].
	ParamVolumetricFogEnergy Param = 2
	// Constant for accessing [Instance.LightSpecular].
	ParamSpecular Param = 3
	// Constant for accessing [graphics.gd/classdb/OmniLight3D.Instance.OmniRange] or [graphics.gd/classdb/SpotLight3D.Instance.SpotRange].
	ParamRange Param = 4
	// Constant for accessing [Instance.LightSize].
	ParamSize Param = 5
	// Constant for accessing [graphics.gd/classdb/OmniLight3D.Instance.OmniAttenuation] or [graphics.gd/classdb/SpotLight3D.Instance.SpotAttenuation].
	ParamAttenuation Param = 6
	// Constant for accessing [graphics.gd/classdb/SpotLight3D.Instance.SpotAngle].
	ParamSpotAngle Param = 7
	// Constant for accessing [graphics.gd/classdb/SpotLight3D.Instance.SpotAngleAttenuation].
	ParamSpotAttenuation Param = 8
	// Constant for accessing [graphics.gd/classdb/DirectionalLight3D.Instance.DirectionalShadowMaxDistance].
	ParamShadowMaxDistance Param = 9
	// Constant for accessing [graphics.gd/classdb/DirectionalLight3D.Instance.DirectionalShadowSplit1].
	ParamShadowSplit1Offset Param = 10
	// Constant for accessing [graphics.gd/classdb/DirectionalLight3D.Instance.DirectionalShadowSplit2].
	ParamShadowSplit2Offset Param = 11
	// Constant for accessing [graphics.gd/classdb/DirectionalLight3D.Instance.DirectionalShadowSplit3].
	ParamShadowSplit3Offset Param = 12
	// Constant for accessing [graphics.gd/classdb/DirectionalLight3D.Instance.DirectionalShadowFadeStart].
	ParamShadowFadeStart Param = 13
	// Constant for accessing [Instance.ShadowNormalBias].
	ParamShadowNormalBias Param = 14
	// Constant for accessing [Instance.ShadowBias].
	ParamShadowBias Param = 15
	// Constant for accessing [graphics.gd/classdb/DirectionalLight3D.Instance.DirectionalShadowPancakeSize].
	ParamShadowPancakeSize Param = 16
	// Constant for accessing [Instance.ShadowOpacity].
	ParamShadowOpacity Param = 17
	// Constant for accessing [Instance.ShadowBlur].
	ParamShadowBlur Param = 18
	// Constant for accessing [Instance.ShadowTransmittanceBias].
	ParamTransmittanceBias Param = 19
	// Constant for accessing [Instance.LightIntensityLumens] and [Instance.LightIntensityLux]. Only used when [graphics.gd/classdb/ProjectSettings] "rendering/lights_and_shadows/use_physical_light_units" is true.
	ParamIntensity Param = 20
	// Represents the size of the [Param] enum.
	ParamMax Param = 21
)

Jump to

Keyboard shortcuts

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