123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357 |
- :github_url: hide
- .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
- .. DO NOT EDIT THIS FILE, but the Light.xml source instead.
- .. The source is found in doc/classes or modules/<name>/doc_classes.
- .. _class_Light:
- Light
- =====
- **Inherits:** :ref:`VisualInstance<class_VisualInstance>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
- **Inherited By:** :ref:`DirectionalLight<class_DirectionalLight>`, :ref:`OmniLight<class_OmniLight>`, :ref:`SpotLight<class_SpotLight>`
- **Category:** Core
- Brief Description
- -----------------
- Provides a base class for different kinds of light nodes.
- Properties
- ----------
- +--------------------------------------+--------------------------------------------------------------------------------+---------------------+
- | :ref:`bool<class_bool>` | :ref:`editor_only<class_Light_property_editor_only>` | false |
- +--------------------------------------+--------------------------------------------------------------------------------+---------------------+
- | :ref:`BakeMode<enum_Light_BakeMode>` | :ref:`light_bake_mode<class_Light_property_light_bake_mode>` | 1 |
- +--------------------------------------+--------------------------------------------------------------------------------+---------------------+
- | :ref:`Color<class_Color>` | :ref:`light_color<class_Light_property_light_color>` | Color( 1, 1, 1, 1 ) |
- +--------------------------------------+--------------------------------------------------------------------------------+---------------------+
- | :ref:`int<class_int>` | :ref:`light_cull_mask<class_Light_property_light_cull_mask>` | 4294967295 |
- +--------------------------------------+--------------------------------------------------------------------------------+---------------------+
- | :ref:`float<class_float>` | :ref:`light_energy<class_Light_property_light_energy>` | 1.0 |
- +--------------------------------------+--------------------------------------------------------------------------------+---------------------+
- | :ref:`float<class_float>` | :ref:`light_indirect_energy<class_Light_property_light_indirect_energy>` | 1.0 |
- +--------------------------------------+--------------------------------------------------------------------------------+---------------------+
- | :ref:`bool<class_bool>` | :ref:`light_negative<class_Light_property_light_negative>` | false |
- +--------------------------------------+--------------------------------------------------------------------------------+---------------------+
- | :ref:`float<class_float>` | :ref:`light_specular<class_Light_property_light_specular>` | 0.5 |
- +--------------------------------------+--------------------------------------------------------------------------------+---------------------+
- | :ref:`float<class_float>` | :ref:`shadow_bias<class_Light_property_shadow_bias>` | 0.15 |
- +--------------------------------------+--------------------------------------------------------------------------------+---------------------+
- | :ref:`Color<class_Color>` | :ref:`shadow_color<class_Light_property_shadow_color>` | Color( 0, 0, 0, 1 ) |
- +--------------------------------------+--------------------------------------------------------------------------------+---------------------+
- | :ref:`float<class_float>` | :ref:`shadow_contact<class_Light_property_shadow_contact>` | 0.0 |
- +--------------------------------------+--------------------------------------------------------------------------------+---------------------+
- | :ref:`bool<class_bool>` | :ref:`shadow_enabled<class_Light_property_shadow_enabled>` | false |
- +--------------------------------------+--------------------------------------------------------------------------------+---------------------+
- | :ref:`bool<class_bool>` | :ref:`shadow_reverse_cull_face<class_Light_property_shadow_reverse_cull_face>` | false |
- +--------------------------------------+--------------------------------------------------------------------------------+---------------------+
- Methods
- -------
- +---------------------------+----------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`get_param<class_Light_method_get_param>` **(** :ref:`Param<enum_Light_Param>` param **)** const |
- +---------------------------+----------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_param<class_Light_method_set_param>` **(** :ref:`Param<enum_Light_Param>` param, :ref:`float<class_float>` value **)** |
- +---------------------------+----------------------------------------------------------------------------------------------------------------------------------+
- Enumerations
- ------------
- .. _enum_Light_Param:
- .. _class_Light_constant_PARAM_ENERGY:
- .. _class_Light_constant_PARAM_INDIRECT_ENERGY:
- .. _class_Light_constant_PARAM_SPECULAR:
- .. _class_Light_constant_PARAM_RANGE:
- .. _class_Light_constant_PARAM_ATTENUATION:
- .. _class_Light_constant_PARAM_SPOT_ANGLE:
- .. _class_Light_constant_PARAM_SPOT_ATTENUATION:
- .. _class_Light_constant_PARAM_CONTACT_SHADOW_SIZE:
- .. _class_Light_constant_PARAM_SHADOW_MAX_DISTANCE:
- .. _class_Light_constant_PARAM_SHADOW_SPLIT_1_OFFSET:
- .. _class_Light_constant_PARAM_SHADOW_SPLIT_2_OFFSET:
- .. _class_Light_constant_PARAM_SHADOW_SPLIT_3_OFFSET:
- .. _class_Light_constant_PARAM_SHADOW_NORMAL_BIAS:
- .. _class_Light_constant_PARAM_SHADOW_BIAS:
- .. _class_Light_constant_PARAM_SHADOW_BIAS_SPLIT_SCALE:
- .. _class_Light_constant_PARAM_MAX:
- enum **Param**:
- - **PARAM_ENERGY** = **0**
- - **PARAM_INDIRECT_ENERGY** = **1**
- - **PARAM_SPECULAR** = **2**
- - **PARAM_RANGE** = **3**
- - **PARAM_ATTENUATION** = **4**
- - **PARAM_SPOT_ANGLE** = **5**
- - **PARAM_SPOT_ATTENUATION** = **6**
- - **PARAM_CONTACT_SHADOW_SIZE** = **7**
- - **PARAM_SHADOW_MAX_DISTANCE** = **8**
- - **PARAM_SHADOW_SPLIT_1_OFFSET** = **9**
- - **PARAM_SHADOW_SPLIT_2_OFFSET** = **10**
- - **PARAM_SHADOW_SPLIT_3_OFFSET** = **11**
- - **PARAM_SHADOW_NORMAL_BIAS** = **12**
- - **PARAM_SHADOW_BIAS** = **13**
- - **PARAM_SHADOW_BIAS_SPLIT_SCALE** = **14**
- - **PARAM_MAX** = **15** --- Represents the size of the :ref:`Param<enum_Light_Param>` enum.
- .. _enum_Light_BakeMode:
- .. _class_Light_constant_BAKE_DISABLED:
- .. _class_Light_constant_BAKE_INDIRECT:
- .. _class_Light_constant_BAKE_ALL:
- enum **BakeMode**:
- - **BAKE_DISABLED** = **0** --- Light is ignored when baking.
- **Note:** Hiding a light does *not* affect baking.
- - **BAKE_INDIRECT** = **1** --- Only indirect lighting will be baked (default).
- - **BAKE_ALL** = **2** --- Both direct and indirect light will be baked.
- **Note:** You should hide the light if you don't want it to appear twice (dynamic and baked).
- Description
- -----------
- Light is the abstract base class for light nodes, so it shouldn't be used directly (it can't be instanced). Other types of light nodes inherit from it. Light contains the common variables and parameters used for lighting.
- Tutorials
- ---------
- - :doc:`../tutorials/3d/lights_and_shadows`
- Property Descriptions
- ---------------------
- .. _class_Light_property_editor_only:
- - :ref:`bool<class_bool>` **editor_only**
- +-----------+------------------------+
- | *Default* | false |
- +-----------+------------------------+
- | *Setter* | set_editor_only(value) |
- +-----------+------------------------+
- | *Getter* | is_editor_only() |
- +-----------+------------------------+
- If ``true``, the light only appears in the editor and will not be visible at runtime.
- .. _class_Light_property_light_bake_mode:
- - :ref:`BakeMode<enum_Light_BakeMode>` **light_bake_mode**
- +-----------+----------------------+
- | *Default* | 1 |
- +-----------+----------------------+
- | *Setter* | set_bake_mode(value) |
- +-----------+----------------------+
- | *Getter* | get_bake_mode() |
- +-----------+----------------------+
- The light's bake mode. See :ref:`BakeMode<enum_Light_BakeMode>`.
- .. _class_Light_property_light_color:
- - :ref:`Color<class_Color>` **light_color**
- +-----------+---------------------+
- | *Default* | Color( 1, 1, 1, 1 ) |
- +-----------+---------------------+
- | *Setter* | set_color(value) |
- +-----------+---------------------+
- | *Getter* | get_color() |
- +-----------+---------------------+
- The light's color.
- .. _class_Light_property_light_cull_mask:
- - :ref:`int<class_int>` **light_cull_mask**
- +-----------+----------------------+
- | *Default* | 4294967295 |
- +-----------+----------------------+
- | *Setter* | set_cull_mask(value) |
- +-----------+----------------------+
- | *Getter* | get_cull_mask() |
- +-----------+----------------------+
- The light will affect objects in the selected layers.
- .. _class_Light_property_light_energy:
- - :ref:`float<class_float>` **light_energy**
- +-----------+------------------+
- | *Default* | 1.0 |
- +-----------+------------------+
- | *Setter* | set_param(value) |
- +-----------+------------------+
- | *Getter* | get_param() |
- +-----------+------------------+
- The light's strength multiplier.
- .. _class_Light_property_light_indirect_energy:
- - :ref:`float<class_float>` **light_indirect_energy**
- +-----------+------------------+
- | *Default* | 1.0 |
- +-----------+------------------+
- | *Setter* | set_param(value) |
- +-----------+------------------+
- | *Getter* | get_param() |
- +-----------+------------------+
- Secondary multiplier used with indirect light (light bounces). This works on both :ref:`BakedLightmap<class_BakedLightmap>` and :ref:`GIProbe<class_GIProbe>`.
- .. _class_Light_property_light_negative:
- - :ref:`bool<class_bool>` **light_negative**
- +-----------+---------------------+
- | *Default* | false |
- +-----------+---------------------+
- | *Setter* | set_negative(value) |
- +-----------+---------------------+
- | *Getter* | is_negative() |
- +-----------+---------------------+
- If ``true``, the light's effect is reversed, darkening areas and casting bright shadows.
- .. _class_Light_property_light_specular:
- - :ref:`float<class_float>` **light_specular**
- +-----------+------------------+
- | *Default* | 0.5 |
- +-----------+------------------+
- | *Setter* | set_param(value) |
- +-----------+------------------+
- | *Getter* | get_param() |
- +-----------+------------------+
- The intensity of the specular blob in objects affected by the light. At ``0`` the light becomes a pure diffuse light.
- .. _class_Light_property_shadow_bias:
- - :ref:`float<class_float>` **shadow_bias**
- +-----------+------------------+
- | *Default* | 0.15 |
- +-----------+------------------+
- | *Setter* | set_param(value) |
- +-----------+------------------+
- | *Getter* | get_param() |
- +-----------+------------------+
- Used to adjust shadow appearance. Too small a value results in self-shadowing, while too large a value causes shadows to separate from casters. Adjust as needed.
- .. _class_Light_property_shadow_color:
- - :ref:`Color<class_Color>` **shadow_color**
- +-----------+-------------------------+
- | *Default* | Color( 0, 0, 0, 1 ) |
- +-----------+-------------------------+
- | *Setter* | set_shadow_color(value) |
- +-----------+-------------------------+
- | *Getter* | get_shadow_color() |
- +-----------+-------------------------+
- The color of shadows cast by this light.
- .. _class_Light_property_shadow_contact:
- - :ref:`float<class_float>` **shadow_contact**
- +-----------+------------------+
- | *Default* | 0.0 |
- +-----------+------------------+
- | *Setter* | set_param(value) |
- +-----------+------------------+
- | *Getter* | get_param() |
- +-----------+------------------+
- Attempts to reduce :ref:`shadow_bias<class_Light_property_shadow_bias>` gap.
- .. _class_Light_property_shadow_enabled:
- - :ref:`bool<class_bool>` **shadow_enabled**
- +-----------+-------------------+
- | *Default* | false |
- +-----------+-------------------+
- | *Setter* | set_shadow(value) |
- +-----------+-------------------+
- | *Getter* | has_shadow() |
- +-----------+-------------------+
- If ``true``, the light will cast shadows.
- .. _class_Light_property_shadow_reverse_cull_face:
- - :ref:`bool<class_bool>` **shadow_reverse_cull_face**
- +-----------+-------------------------------------+
- | *Default* | false |
- +-----------+-------------------------------------+
- | *Setter* | set_shadow_reverse_cull_face(value) |
- +-----------+-------------------------------------+
- | *Getter* | get_shadow_reverse_cull_face() |
- +-----------+-------------------------------------+
- Method Descriptions
- -------------------
- .. _class_Light_method_get_param:
- - :ref:`float<class_float>` **get_param** **(** :ref:`Param<enum_Light_Param>` param **)** const
- .. _class_Light_method_set_param:
- - void **set_param** **(** :ref:`Param<enum_Light_Param>` param, :ref:`float<class_float>` value **)**
|