Class GLTFLight
Represents a glTF light.
- Inheritance
-
GLTFLight
Remarks
Represents a light as defined by the KHR_lights_punctual
glTF extension.
See Also
Properties
color
The Color of the light. Defaults to white. A black color causes the light to have no effect.
var color : Color = Color(1, 1, 1, 1)
Property Value
Remarks
inner_cone_angle
The inner angle of the cone in a spotlight. Must be less than or equal to the outer cone angle.
Within this angle, the light is at full brightness. Between the inner and outer cone angles, there is a transition from full brightness to zero brightness. When creating a Godot SpotLight3D, the ratio between the inner and outer cone angles is used to calculate the attenuation of the light.
var inner_cone_angle : float = 0.0
Property Value
Remarks
intensity
The intensity of the light. This is expressed in candelas (lumens per steradian) for point and spot lights, and lux (lumens per m²) for directional lights. When creating a Godot light, this value is converted to a unitless multiplier.
var intensity : float = 1.0
Property Value
Remarks
light_type
The type of the light. The values accepted by Godot are "point", "spot", and "directional", which correspond to Godot's OmniLight3D, SpotLight3D, and DirectionalLight3D respectively.
var light_type : String = ""
Property Value
Remarks
outer_cone_angle
The outer angle of the cone in a spotlight. Must be greater than or equal to the inner angle.
At this angle, the light drops off to zero brightness. Between the inner and outer cone angles, there is a transition from full brightness to zero brightness. If this angle is a half turn, then the spotlight emits in all directions. When creating a Godot SpotLight3D, the outer cone angle is used as the angle of the spotlight.
var outer_cone_angle : float = 0.785398
Property Value
Remarks
range
The range of the light, beyond which the light has no effect. glTF lights with no range defined behave like physical lights (which have infinite range). When creating a Godot light, the range is clamped to 4096.
var range : float = inf
Property Value
Remarks
Methods
from_dictionary(Dictionary)
Qualifiers: static
Creates a new GLTFLight instance by parsing the given Dictionary.
GLTFLight from_dictionary(Dictionary dictionary)
Parameters
dictionary
Dictionary
from_node(Light3D)
Qualifiers: static
Create a new GLTFLight instance from the given Godot Light3D node.
GLTFLight from_node(Light3D light_node)
Parameters
light_node
Light3D
get_additional_data(StringName)
Variant get_additional_data(StringName extension_name)
Parameters
extension_name
StringName
set_additional_data(StringName, Variant)
void set_additional_data(StringName extension_name, Variant additional_data)
Parameters
extension_name
StringNameadditional_data
Variant
to_dictionary
Qualifiers: const
Serializes this GLTFLight instance into a Dictionary.
Dictionary to_dictionary
to_node
Qualifiers: const
Converts this GLTFLight instance into a Godot Light3D node.
Light3D to_node