GLTFLight
Inherits: Resource < RefCounted < Object
Description
Section titled “Description”Represents a glTF light.
Represents a light as defined by the KHR_lights_punctual glTF extension.
Properties
Section titled “Properties”| Type | Name | Default |
|---|---|---|
| Color | color |
Color(1, 1, 1, 1) |
| float | inner_cone_angle |
0.0 |
| float | intensity |
1.0 |
| String | light_type |
"" |
| float | outer_cone_angle |
0.7853982 |
| float | range |
inf |
Methods
Section titled “Methods”| Returns | Method |
|---|---|
| GLTFLight | from_dictionary(dictionary: Dictionary) static |
| GLTFLight | from_node(light_node: Light3D) static |
| Variant | get_additional_data(extension_name: StringName) |
| void | set_additional_data(extension_name: StringName, additional_data: Variant) |
| Dictionary | to_dictionary() const |
| Light3D | to_node() const |
Property descriptions
Section titled “Property descriptions”color
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 Orblit Light3D node upon import, or converted to linear when exporting a Orblit Light3D to glTF.
inner_cone_angle
float inner_cone_angle = 0.0
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 Orblit SpotLight3D, the ratio between the inner and outer cone angles is used to calculate the attenuation of the light.
intensity
float intensity = 1.0
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 Orblit light, this value is converted to a unitless multiplier.
light_type
String light_type = ""
The type of the light. The values accepted by Orblit are “point”, “spot”, and “directional”, which correspond to Orblit’s OmniLight3D, SpotLight3D, and DirectionalLight3D respectively.
outer_cone_angle
float outer_cone_angle = 0.7853982
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 Orblit SpotLight3D, the outer cone angle is used as the angle of the spotlight.
range
float range = inf
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 Orblit light, the range is clamped to 4096.0.
Method descriptions
Section titled “Method descriptions”from_dictionary
GLTFLight from_dictionary(dictionary: Dictionary) static
Creates a new GLTFLight instance by parsing the given Dictionary.
from_node
GLTFLight from_node(light_node: Light3D) static
Create a new GLTFLight instance from the given Orblit Light3D node.
get_additional_data
Variant get_additional_data(extension_name: StringName)
set_additional_data
void set_additional_data(extension_name: StringName, additional_data: Variant)
to_dictionary
Dictionary to_dictionary() const
Serializes this GLTFLight instance into a Dictionary.
to_node
Light3D to_node() const
Converts this GLTFLight instance into a Orblit Light3D node.
