Class reference
GLTFLight
Inherits Resource
Represents a glTF light.
Description
Represents a light as defined by the KHR_lights_punctual glTF extension.
Properties
Color color = Color(1, 1, 1, 1)
Color color = Color(1, 1, 1, 1)The Color of the light in linear space. Defaults to white. A black color causes the light to have no effect. This value is linear to match glTF, but will be converted to nonlinear sRGB when creating a Redot Light3D node upon import, or converted to linear when exporting a Redot Light3D to glTF.
float inner_cone_angle = 0.0
float inner_cone_angle = 0.0The 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 Redot SpotLight3D, the ratio between the inner and outer cone angles is used to calculate the attenuation of the light.
float intensity = 1.0
float intensity = 1.0The 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 Redot light, this value is converted to a unitless multiplier.
String light_type = ""
String light_type = ""The type of the light. The values accepted by Redot are "point", "spot", and "directional", which correspond to Redot's OmniLight3D, SpotLight3D, and DirectionalLight3D respectively.
float outer_cone_angle = 0.7853982
float outer_cone_angle = 0.7853982The 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 Redot SpotLight3D, the outer cone angle is used as the angle of the spotlight.
float range = inf
float range = infThe 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 Redot light, the range is clamped to 4096.0.
Methods
GLTFLight from_dictionary(Dictionary dictionary) static
GLTFLight from_dictionary(Dictionary dictionary) staticCreates a new GLTFLight instance by parsing the given Dictionary.
GLTFLight from_node(Light3D light_node) static
GLTFLight from_node(Light3D light_node) staticCreate a new GLTFLight instance from the given Redot Light3D node.
Variant get_additional_data(StringName extension_name)
Variant get_additional_data(StringName extension_name)void set_additional_data(StringName extension_name, Variant additional_data)
StringName extension_name, Variant additional_data)Dictionary to_dictionary() const
Dictionary to_dictionary() constSerializes this GLTFLight instance into a Dictionary.
Light3D to_node() const
Light3D to_node() constConverts this GLTFLight instance into a Redot Light3D node.