GLTFLight¶
Inherits: Resource < Reference < Object
Represents a GLTF light.
Description¶
Represents a light as defined by the KHR_lights_punctual
GLTF extension.
Note: This class is only compiled in editor builds. Run-time glTF loading and saving is not available in exported projects. References to GLTFLight within a script will cause an error in an exported project.
Tutorials¶
Properties¶
|
||
|
||
|
||
|
||
|
||
|
Methods¶
to_dictionary ( ) const |
|
to_node ( ) const |
Property Descriptions¶
Color color = Color( 1, 1, 1, 1 )
The Color of the light. Defaults to white. A black color causes the light to have no effect.
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 Redot SpotLight, the ratio between the inner and outer cone angles is used to calculate the attenuation of the light.
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 Redot light, this value is converted to a unitless multiplier.
float outer_cone_angle = 0.785398
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 Redot SpotLight, the outer cone angle is used as the angle of the spotlight.
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 Redot light, the range is clamped to 4096.
String type = ""
The type of the light. The values accepted by Redot are "point", "spot", and "directional", which correspond to Redot's OmniLight, SpotLight, and DirectionalLight respectively.
Method Descriptions¶
Dictionary to_dictionary ( ) const
Serializes this GLTFLight instance into a Dictionary.
Light to_node ( ) const
Converts this GLTFLight instance into a Redot Light node.