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 ¶
- type Advanced
- type Any
- type BakeMode
- type Extension
- type ID
- type Instance
- func (self Instance) AsLight3D() Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsNode3D() Node3D.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsVisualInstance3D() VisualInstance3D.Instance
- func (self Instance) DistanceFadeBegin() Float.X
- func (self Instance) DistanceFadeEnabled() bool
- func (self Instance) DistanceFadeLength() Float.X
- func (self Instance) DistanceFadeShadow() Float.X
- func (self Instance) EditorOnly() bool
- func (self Instance) GetCorrelatedColor() Color.RGBA
- func (self Instance) ID() ID
- func (self Instance) LightAngularDistance() Float.X
- func (self Instance) LightBakeMode() BakeMode
- func (self Instance) LightColor() Color.RGBA
- func (self Instance) LightCullMask() int
- func (self Instance) LightEnergy() Float.X
- func (self Instance) LightIndirectEnergy() Float.X
- func (self Instance) LightIntensityLumens() Float.X
- func (self Instance) LightIntensityLux() Float.X
- func (self Instance) LightNegative() bool
- func (self Instance) LightProjector() Texture2D.Instance
- func (self Instance) LightSize() Float.X
- func (self Instance) LightSpecular() Float.X
- func (self Instance) LightTemperature() Float.X
- func (self Instance) LightVolumetricFogEnergy() Float.X
- func (self Instance) SetDistanceFadeBegin(value Float.X)
- func (self Instance) SetDistanceFadeEnabled(value bool)
- func (self Instance) SetDistanceFadeLength(value Float.X)
- func (self Instance) SetDistanceFadeShadow(value Float.X)
- func (self Instance) SetEditorOnly(value bool)
- func (self Instance) SetLightAngularDistance(value Float.X)
- func (self Instance) SetLightBakeMode(value BakeMode)
- func (self Instance) SetLightColor(value Color.RGBA)
- func (self Instance) SetLightCullMask(value int)
- func (self Instance) SetLightEnergy(value Float.X)
- func (self Instance) SetLightIndirectEnergy(value Float.X)
- func (self Instance) SetLightIntensityLumens(value Float.X)
- func (self Instance) SetLightIntensityLux(value Float.X)
- func (self Instance) SetLightNegative(value bool)
- func (self Instance) SetLightProjector(value Texture2D.Instance)
- func (self Instance) SetLightSize(value Float.X)
- func (self Instance) SetLightSpecular(value Float.X)
- func (self Instance) SetLightTemperature(value Float.X)
- func (self Instance) SetLightVolumetricFogEnergy(value Float.X)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetShadowBias(value Float.X)
- func (self Instance) SetShadowBlur(value Float.X)
- func (self Instance) SetShadowCasterMask(value int)
- func (self Instance) SetShadowEnabled(value bool)
- func (self Instance) SetShadowNormalBias(value Float.X)
- func (self Instance) SetShadowOpacity(value Float.X)
- func (self Instance) SetShadowReverseCullFace(value bool)
- func (self Instance) SetShadowTransmittanceBias(value Float.X)
- func (self Instance) ShadowBias() Float.X
- func (self Instance) ShadowBlur() Float.X
- func (self Instance) ShadowCasterMask() int
- func (self Instance) ShadowEnabled() bool
- func (self Instance) ShadowNormalBias() Float.X
- func (self Instance) ShadowOpacity() Float.X
- func (self Instance) ShadowReverseCullFace() bool
- func (self Instance) ShadowTransmittanceBias() Float.X
- func (self Instance) Virtual(name string) reflect.Value
- type Param
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 BakeMode ¶
type BakeMode int //gd:Light3D.BakeMode
const ( // Light is ignored when baking. This is the fastest mode, but the light will not 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 [LightmapGI]. Hiding a light will still affect baking [VoxelGI] and SDFGI (see [Environment.SdfgiEnabled]). // // [Environment.SdfgiEnabled]: https://pkg.go.dev/graphics.gd/classdb/Environment#Instance.SdfgiEnabled // [LightmapGI]: https://pkg.go.dev/graphics.gd/classdb/LightmapGI // [VoxelGI]: https://pkg.go.dev/graphics.gd/classdb/VoxelGI BakeDisabled BakeMode = 0 // Light is taken into account in static baking ([VoxelGI], [LightmapGI], SDFGI ([Environment.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 [LightmapGI] if [EditorOnly] is true. // // [EditorOnly]: https://pkg.go.dev/graphics.gd/classdb/#Instance.EditorOnly // [Environment.SdfgiEnabled]: https://pkg.go.dev/graphics.gd/classdb/Environment#Instance.SdfgiEnabled // [LightmapGI]: https://pkg.go.dev/graphics.gd/classdb/LightmapGI // [VoxelGI]: https://pkg.go.dev/graphics.gd/classdb/VoxelGI BakeStatic BakeMode = 1 // Light is taken into account in dynamic baking ([VoxelGI] and SDFGI ([Environment.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 [ProjectSettings] "rendering/global_illumination/sdfgi/frames_to_update_lights". // // [Environment.SdfgiEnabled]: https://pkg.go.dev/graphics.gd/classdb/Environment#Instance.SdfgiEnabled // [ProjectSettings]: https://pkg.go.dev/graphics.gd/classdb/ProjectSettings // [VoxelGI]: https://pkg.go.dev/graphics.gd/classdb/VoxelGI BakeDynamic BakeMode = 2 )
type Extension ¶
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]) AsVisualInstance3D ¶
func (self *Extension[T]) AsVisualInstance3D() VisualInstance3D.Instance
type 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.
type Instance ¶
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 (Instance) AsVisualInstance3D ¶
func (self Instance) AsVisualInstance3D() VisualInstance3D.Instance
func (Instance) DistanceFadeBegin ¶
func (Instance) DistanceFadeEnabled ¶
func (Instance) DistanceFadeLength ¶
func (Instance) DistanceFadeShadow ¶
func (Instance) EditorOnly ¶
func (Instance) GetCorrelatedColor ¶
Returns the Color.RGBA of an idealized blackbody at the given LightTemperature. This value is calculated internally based on the LightTemperature. This Color.RGBA is multiplied by LightColor before being sent to the RenderingServer.
func (Instance) LightAngularDistance ¶
func (Instance) LightBakeMode ¶
func (Instance) LightColor ¶
func (Instance) LightCullMask ¶
func (Instance) LightEnergy ¶
func (Instance) LightIndirectEnergy ¶
func (Instance) LightIntensityLumens ¶
func (Instance) LightIntensityLux ¶
func (Instance) LightNegative ¶
func (Instance) LightProjector ¶
func (Instance) LightSpecular ¶
func (Instance) LightTemperature ¶
func (Instance) LightVolumetricFogEnergy ¶
func (Instance) SetDistanceFadeBegin ¶
func (Instance) SetDistanceFadeEnabled ¶
func (Instance) SetDistanceFadeLength ¶
func (Instance) SetDistanceFadeShadow ¶
func (Instance) SetEditorOnly ¶
func (Instance) SetLightAngularDistance ¶
func (Instance) SetLightBakeMode ¶
func (Instance) SetLightColor ¶
func (Instance) SetLightCullMask ¶
func (Instance) SetLightEnergy ¶
func (Instance) SetLightIndirectEnergy ¶
func (Instance) SetLightIntensityLumens ¶
func (Instance) SetLightIntensityLux ¶
func (Instance) SetLightNegative ¶
func (Instance) SetLightProjector ¶
func (Instance) SetLightSize ¶
func (Instance) SetLightSpecular ¶
func (Instance) SetLightTemperature ¶
func (Instance) SetLightVolumetricFogEnergy ¶
func (Instance) SetShadowBias ¶
func (Instance) SetShadowBlur ¶
func (Instance) SetShadowCasterMask ¶
func (Instance) SetShadowEnabled ¶
func (Instance) SetShadowNormalBias ¶
func (Instance) SetShadowOpacity ¶
func (Instance) SetShadowReverseCullFace ¶
func (Instance) SetShadowTransmittanceBias ¶
func (Instance) ShadowBias ¶
func (Instance) ShadowBlur ¶
func (Instance) ShadowCasterMask ¶
func (Instance) ShadowEnabled ¶
func (Instance) ShadowNormalBias ¶
func (Instance) ShadowOpacity ¶
func (Instance) ShadowReverseCullFace ¶
func (Instance) ShadowTransmittanceBias ¶
type Param ¶
type Param int //gd:Light3D.Param
const ( // Constant for accessing [LightEnergy]. // // [LightEnergy]: https://pkg.go.dev/graphics.gd/classdb/#Instance.LightEnergy ParamEnergy Param = 0 // Constant for accessing [LightIndirectEnergy]. // // [LightIndirectEnergy]: https://pkg.go.dev/graphics.gd/classdb/#Instance.LightIndirectEnergy ParamIndirectEnergy Param = 1 // Constant for accessing [LightVolumetricFogEnergy]. // // [LightVolumetricFogEnergy]: https://pkg.go.dev/graphics.gd/classdb/#Instance.LightVolumetricFogEnergy ParamVolumetricFogEnergy Param = 2 // Constant for accessing [LightSpecular]. // // [LightSpecular]: https://pkg.go.dev/graphics.gd/classdb/#Instance.LightSpecular ParamSpecular Param = 3 // Constant for accessing [OmniLight3D.OmniRange] or [SpotLight3D.SpotRange]. // // [OmniLight3D.OmniRange]: https://pkg.go.dev/graphics.gd/classdb/OmniLight3D#Instance.OmniRange // [SpotLight3D.SpotRange]: https://pkg.go.dev/graphics.gd/classdb/SpotLight3D#Instance.SpotRange ParamRange Param = 4 // Constant for accessing [LightSize]. // // [LightSize]: https://pkg.go.dev/graphics.gd/classdb/#Instance.LightSize ParamSize Param = 5 // Constant for accessing [OmniLight3D.OmniAttenuation] or [SpotLight3D.SpotAttenuation]. // // [OmniLight3D.OmniAttenuation]: https://pkg.go.dev/graphics.gd/classdb/OmniLight3D#Instance.OmniAttenuation // [SpotLight3D.SpotAttenuation]: https://pkg.go.dev/graphics.gd/classdb/SpotLight3D#Instance.SpotAttenuation ParamAttenuation Param = 6 // Constant for accessing [SpotLight3D.SpotAngle]. // // [SpotLight3D.SpotAngle]: https://pkg.go.dev/graphics.gd/classdb/SpotLight3D#Instance.SpotAngle ParamSpotAngle Param = 7 // Constant for accessing [SpotLight3D.SpotAngleAttenuation]. // // [SpotLight3D.SpotAngleAttenuation]: https://pkg.go.dev/graphics.gd/classdb/SpotLight3D#Instance.SpotAngleAttenuation ParamSpotAttenuation Param = 8 // Constant for accessing [DirectionalLight3D.DirectionalShadowMaxDistance]. // // [DirectionalLight3D.DirectionalShadowMaxDistance]: https://pkg.go.dev/graphics.gd/classdb/DirectionalLight3D#Instance.DirectionalShadowMaxDistance ParamShadowMaxDistance Param = 9 // Constant for accessing [DirectionalLight3D.DirectionalShadowSplit1]. // // [DirectionalLight3D.DirectionalShadowSplit1]: https://pkg.go.dev/graphics.gd/classdb/DirectionalLight3D#Instance.DirectionalShadowSplit1 ParamShadowSplit1Offset Param = 10 // Constant for accessing [DirectionalLight3D.DirectionalShadowSplit2]. // // [DirectionalLight3D.DirectionalShadowSplit2]: https://pkg.go.dev/graphics.gd/classdb/DirectionalLight3D#Instance.DirectionalShadowSplit2 ParamShadowSplit2Offset Param = 11 // Constant for accessing [DirectionalLight3D.DirectionalShadowSplit3]. // // [DirectionalLight3D.DirectionalShadowSplit3]: https://pkg.go.dev/graphics.gd/classdb/DirectionalLight3D#Instance.DirectionalShadowSplit3 ParamShadowSplit3Offset Param = 12 // Constant for accessing [DirectionalLight3D.DirectionalShadowFadeStart]. // // [DirectionalLight3D.DirectionalShadowFadeStart]: https://pkg.go.dev/graphics.gd/classdb/DirectionalLight3D#Instance.DirectionalShadowFadeStart ParamShadowFadeStart Param = 13 // Constant for accessing [ShadowNormalBias]. // // [ShadowNormalBias]: https://pkg.go.dev/graphics.gd/classdb/#Instance.ShadowNormalBias ParamShadowNormalBias Param = 14 // Constant for accessing [ShadowBias]. // // [ShadowBias]: https://pkg.go.dev/graphics.gd/classdb/#Instance.ShadowBias ParamShadowBias Param = 15 // Constant for accessing [DirectionalLight3D.DirectionalShadowPancakeSize]. // // [DirectionalLight3D.DirectionalShadowPancakeSize]: https://pkg.go.dev/graphics.gd/classdb/DirectionalLight3D#Instance.DirectionalShadowPancakeSize ParamShadowPancakeSize Param = 16 // Constant for accessing [ShadowOpacity]. // // [ShadowOpacity]: https://pkg.go.dev/graphics.gd/classdb/#Instance.ShadowOpacity ParamShadowOpacity Param = 17 // Constant for accessing [ShadowBlur]. // // [ShadowBlur]: https://pkg.go.dev/graphics.gd/classdb/#Instance.ShadowBlur ParamShadowBlur Param = 18 // Constant for accessing [ShadowTransmittanceBias]. // // [ShadowTransmittanceBias]: https://pkg.go.dev/graphics.gd/classdb/#Instance.ShadowTransmittanceBias ParamTransmittanceBias Param = 19 // Constant for accessing [LightIntensityLumens] and [LightIntensityLux]. Only used when [ProjectSettings] "rendering/lights_and_shadows/use_physical_light_units" is true. // // [LightIntensityLumens]: https://pkg.go.dev/graphics.gd/classdb/#Instance.LightIntensityLumens // [LightIntensityLux]: https://pkg.go.dev/graphics.gd/classdb/#Instance.LightIntensityLux // [ProjectSettings]: https://pkg.go.dev/graphics.gd/classdb/ProjectSettings ParamIntensity Param = 20 // Represents the size of the [Param] enum. ParamMax Param = 21 )