:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/3.6/modules/gltf/doc_classes/GLTFLight.xml. .. _class_GLTFLight: GLTFLight ========= **Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` Represents a GLTF light. .. rst-class:: classref-introduction-group 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. .. rst-class:: classref-introduction-group Tutorials --------- - `KHR_lights_punctual GLTF extension spec `__ .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +-----------------------------+--------------------------------------------------------------------+-------------------------+ | :ref:`Color` | :ref:`color` | ``Color( 1, 1, 1, 1 )`` | +-----------------------------+--------------------------------------------------------------------+-------------------------+ | :ref:`float` | :ref:`inner_cone_angle` | ``0.0`` | +-----------------------------+--------------------------------------------------------------------+-------------------------+ | :ref:`float` | :ref:`intensity` | ``1.0`` | +-----------------------------+--------------------------------------------------------------------+-------------------------+ | :ref:`float` | :ref:`outer_cone_angle` | ``0.785398`` | +-----------------------------+--------------------------------------------------------------------+-------------------------+ | :ref:`float` | :ref:`range` | ``inf`` | +-----------------------------+--------------------------------------------------------------------+-------------------------+ | :ref:`String` | :ref:`type` | ``""`` | +-----------------------------+--------------------------------------------------------------------+-------------------------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-------------------------------------+--------------------------------------------------------------------------------+ | :ref:`Dictionary` | :ref:`to_dictionary` **(** **)** |const| | +-------------------------------------+--------------------------------------------------------------------------------+ | :ref:`Light` | :ref:`to_node` **(** **)** |const| | +-------------------------------------+--------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_GLTFLight_property_color: .. rst-class:: classref-property :ref:`Color` **color** = ``Color( 1, 1, 1, 1 )`` .. rst-class:: classref-property-setget - void **set_color** **(** :ref:`Color` value **)** - :ref:`Color` **get_color** **(** **)** The :ref:`Color` of the light. Defaults to white. A black color causes the light to have no effect. .. rst-class:: classref-item-separator ---- .. _class_GLTFLight_property_inner_cone_angle: .. rst-class:: classref-property :ref:`float` **inner_cone_angle** = ``0.0`` .. rst-class:: classref-property-setget - void **set_inner_cone_angle** **(** :ref:`float` value **)** - :ref:`float` **get_inner_cone_angle** **(** **)** 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 Godot :ref:`SpotLight`, the ratio between the inner and outer cone angles is used to calculate the attenuation of the light. .. rst-class:: classref-item-separator ---- .. _class_GLTFLight_property_intensity: .. rst-class:: classref-property :ref:`float` **intensity** = ``1.0`` .. rst-class:: classref-property-setget - void **set_intensity** **(** :ref:`float` value **)** - :ref:`float` **get_intensity** **(** **)** 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. .. rst-class:: classref-item-separator ---- .. _class_GLTFLight_property_outer_cone_angle: .. rst-class:: classref-property :ref:`float` **outer_cone_angle** = ``0.785398`` .. rst-class:: classref-property-setget - void **set_outer_cone_angle** **(** :ref:`float` value **)** - :ref:`float` **get_outer_cone_angle** **(** **)** 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 Godot :ref:`SpotLight`, the outer cone angle is used as the angle of the spotlight. .. rst-class:: classref-item-separator ---- .. _class_GLTFLight_property_range: .. rst-class:: classref-property :ref:`float` **range** = ``inf`` .. rst-class:: classref-property-setget - void **set_range** **(** :ref:`float` value **)** - :ref:`float` **get_range** **(** **)** 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 4096. .. rst-class:: classref-item-separator ---- .. _class_GLTFLight_property_type: .. rst-class:: classref-property :ref:`String` **type** = ``""`` .. rst-class:: classref-property-setget - void **set_type** **(** :ref:`String` value **)** - :ref:`String` **get_type** **(** **)** The type of the light. The values accepted by Godot are "point", "spot", and "directional", which correspond to Godot's :ref:`OmniLight`, :ref:`SpotLight`, and :ref:`DirectionalLight` respectively. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_GLTFLight_method_to_dictionary: .. rst-class:: classref-method :ref:`Dictionary` **to_dictionary** **(** **)** |const| Serializes this GLTFLight instance into a :ref:`Dictionary`. .. rst-class:: classref-item-separator ---- .. _class_GLTFLight_method_to_node: .. rst-class:: classref-method :ref:`Light` **to_node** **(** **)** |const| Converts this GLTFLight instance into a Godot :ref:`Light` node. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`