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