class_light.rst 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_Light:
  4. Light
  5. =====
  6. **Inherits:** :ref:`VisualInstance<class_visualinstance>` **<** :ref:`Spatial<class_spatial>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  7. **Inherited By:** :ref:`SpotLight<class_spotlight>`, :ref:`OmniLight<class_omnilight>`, :ref:`DirectionalLight<class_directionallight>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Provides a base class for different kinds of light nodes.
  12. Member Functions
  13. ----------------
  14. +--------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
  15. | :ref:`int<class_int>` | :ref:`get_bake_mode<class_Light_get_bake_mode>` **(** **)** const |
  16. +--------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`Color<class_color>` | :ref:`get_color<class_Light_get_color>` **(** :ref:`int<class_int>` color **)** const |
  18. +--------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`int<class_int>` | :ref:`get_operator<class_Light_get_operator>` **(** **)** const |
  20. +--------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`float<class_float>` | :ref:`get_parameter<class_Light_get_parameter>` **(** :ref:`int<class_int>` variable **)** const |
  22. +--------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`Texture<class_texture>` | :ref:`get_projector<class_Light_get_projector>` **(** **)** const |
  24. +--------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`bool<class_bool>` | :ref:`has_project_shadows<class_Light_has_project_shadows>` **(** **)** const |
  26. +--------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`bool<class_bool>` | :ref:`is_editor_only<class_Light_is_editor_only>` **(** **)** const |
  28. +--------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`bool<class_bool>` | :ref:`is_enabled<class_Light_is_enabled>` **(** **)** const |
  30. +--------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`set_bake_mode<class_Light_set_bake_mode>` **(** :ref:`int<class_int>` bake_mode **)** |
  32. +--------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`set_color<class_Light_set_color>` **(** :ref:`int<class_int>` color, :ref:`Color<class_color>` value **)** |
  34. +--------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`set_editor_only<class_Light_set_editor_only>` **(** :ref:`bool<class_bool>` editor_only **)** |
  36. +--------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`set_enabled<class_Light_set_enabled>` **(** :ref:`bool<class_bool>` enabled **)** |
  38. +--------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`set_operator<class_Light_set_operator>` **(** :ref:`int<class_int>` operator **)** |
  40. +--------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`set_parameter<class_Light_set_parameter>` **(** :ref:`int<class_int>` variable, :ref:`float<class_float>` value **)** |
  42. +--------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
  43. | void | :ref:`set_project_shadows<class_Light_set_project_shadows>` **(** :ref:`bool<class_bool>` enable **)** |
  44. +--------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
  45. | void | :ref:`set_projector<class_Light_set_projector>` **(** :ref:`Texture<class_texture>` projector **)** |
  46. +--------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
  47. Numeric Constants
  48. -----------------
  49. - **PARAM_RADIUS** = **2**
  50. - **PARAM_ENERGY** = **3**
  51. - **PARAM_ATTENUATION** = **4**
  52. - **PARAM_SPOT_ANGLE** = **1**
  53. - **PARAM_SPOT_ATTENUATION** = **0**
  54. - **PARAM_SHADOW_DARKENING** = **5**
  55. - **PARAM_SHADOW_Z_OFFSET** = **6**
  56. - **COLOR_DIFFUSE** = **0**
  57. - **COLOR_SPECULAR** = **1**
  58. - **BAKE_MODE_DISABLED** = **0**
  59. - **BAKE_MODE_INDIRECT** = **1**
  60. - **BAKE_MODE_INDIRECT_AND_SHADOWS** = **2**
  61. - **BAKE_MODE_FULL** = **3**
  62. Description
  63. -----------
  64. 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.
  65. Member Function Description
  66. ---------------------------
  67. .. _class_Light_get_bake_mode:
  68. - :ref:`int<class_int>` **get_bake_mode** **(** **)** const
  69. .. _class_Light_get_color:
  70. - :ref:`Color<class_color>` **get_color** **(** :ref:`int<class_int>` color **)** const
  71. .. _class_Light_get_operator:
  72. - :ref:`int<class_int>` **get_operator** **(** **)** const
  73. .. _class_Light_get_parameter:
  74. - :ref:`float<class_float>` **get_parameter** **(** :ref:`int<class_int>` variable **)** const
  75. .. _class_Light_get_projector:
  76. - :ref:`Texture<class_texture>` **get_projector** **(** **)** const
  77. .. _class_Light_has_project_shadows:
  78. - :ref:`bool<class_bool>` **has_project_shadows** **(** **)** const
  79. .. _class_Light_is_editor_only:
  80. - :ref:`bool<class_bool>` **is_editor_only** **(** **)** const
  81. .. _class_Light_is_enabled:
  82. - :ref:`bool<class_bool>` **is_enabled** **(** **)** const
  83. .. _class_Light_set_bake_mode:
  84. - void **set_bake_mode** **(** :ref:`int<class_int>` bake_mode **)**
  85. .. _class_Light_set_color:
  86. - void **set_color** **(** :ref:`int<class_int>` color, :ref:`Color<class_color>` value **)**
  87. .. _class_Light_set_editor_only:
  88. - void **set_editor_only** **(** :ref:`bool<class_bool>` editor_only **)**
  89. .. _class_Light_set_enabled:
  90. - void **set_enabled** **(** :ref:`bool<class_bool>` enabled **)**
  91. .. _class_Light_set_operator:
  92. - void **set_operator** **(** :ref:`int<class_int>` operator **)**
  93. .. _class_Light_set_parameter:
  94. - void **set_parameter** **(** :ref:`int<class_int>` variable, :ref:`float<class_float>` value **)**
  95. .. _class_Light_set_project_shadows:
  96. - void **set_project_shadows** **(** :ref:`bool<class_bool>` enable **)**
  97. .. _class_Light_set_projector:
  98. - void **set_projector** **(** :ref:`Texture<class_texture>` projector **)**