Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/modules/gltf/doc_classes/GLTFLight.xml
10279 views
1
<?xml version="1.0" encoding="UTF-8" ?>
2
<class name="GLTFLight" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
3
<brief_description>
4
Represents a glTF light.
5
</brief_description>
6
<description>
7
Represents a light as defined by the [code]KHR_lights_punctual[/code] glTF extension.
8
</description>
9
<tutorials>
10
<link title="Runtime file loading and saving">$DOCS_URL/tutorials/io/runtime_file_loading_and_saving.html</link>
11
<link title="KHR_lights_punctual glTF extension spec">https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_lights_punctual</link>
12
</tutorials>
13
<methods>
14
<method name="from_dictionary" qualifiers="static">
15
<return type="GLTFLight" />
16
<param index="0" name="dictionary" type="Dictionary" />
17
<description>
18
Creates a new GLTFLight instance by parsing the given [Dictionary].
19
</description>
20
</method>
21
<method name="from_node" qualifiers="static">
22
<return type="GLTFLight" />
23
<param index="0" name="light_node" type="Light3D" />
24
<description>
25
Create a new GLTFLight instance from the given Godot [Light3D] node.
26
</description>
27
</method>
28
<method name="get_additional_data">
29
<return type="Variant" />
30
<param index="0" name="extension_name" type="StringName" />
31
<description>
32
</description>
33
</method>
34
<method name="set_additional_data">
35
<return type="void" />
36
<param index="0" name="extension_name" type="StringName" />
37
<param index="1" name="additional_data" type="Variant" />
38
<description>
39
</description>
40
</method>
41
<method name="to_dictionary" qualifiers="const">
42
<return type="Dictionary" />
43
<description>
44
Serializes this GLTFLight instance into a [Dictionary].
45
</description>
46
</method>
47
<method name="to_node" qualifiers="const">
48
<return type="Light3D" />
49
<description>
50
Converts this GLTFLight instance into a Godot [Light3D] node.
51
</description>
52
</method>
53
</methods>
54
<members>
55
<member name="color" type="Color" setter="set_color" getter="get_color" default="Color(1, 1, 1, 1)" keywords="colour">
56
The [Color] of the light in linear space. Defaults to white. A black color causes the light to have no effect.
57
This value is linear to match glTF, but will be converted to nonlinear sRGB when creating a Godot [Light3D] node upon import, or converted to linear when exporting a Godot [Light3D] to glTF.
58
</member>
59
<member name="inner_cone_angle" type="float" setter="set_inner_cone_angle" getter="get_inner_cone_angle" default="0.0">
60
The inner angle of the cone in a spotlight. Must be less than or equal to the outer cone angle.
61
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.
62
</member>
63
<member name="intensity" type="float" setter="set_intensity" getter="get_intensity" default="1.0">
64
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.
65
</member>
66
<member name="light_type" type="String" setter="set_light_type" getter="get_light_type" default="&quot;&quot;">
67
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.
68
</member>
69
<member name="outer_cone_angle" type="float" setter="set_outer_cone_angle" getter="get_outer_cone_angle" default="0.7853982">
70
The outer angle of the cone in a spotlight. Must be greater than or equal to the inner angle.
71
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.
72
</member>
73
<member name="range" type="float" setter="set_range" getter="get_range" default="inf">
74
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 [code]4096.0[/code].
75
</member>
76
</members>
77
</class>
78
79