class_light.rst 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the Light.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_Light:
  5. Light
  6. =====
  7. **Inherits:** :ref:`VisualInstance<class_visualinstance>` **<** :ref:`Spatial<class_spatial>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  8. **Inherited By:** :ref:`SpotLight<class_spotlight>`, :ref:`OmniLight<class_omnilight>`, :ref:`DirectionalLight<class_directionallight>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Provides a base class for different kinds of light nodes.
  13. Member Functions
  14. ----------------
  15. +----------------------------+----------------------------------------------------------------------------------------------------------------------------+
  16. | :ref:`Color<class_color>` | :ref:`get_color<class_Light_get_color>` **(** **)** const |
  17. +----------------------------+----------------------------------------------------------------------------------------------------------------------------+
  18. | :ref:`int<class_int>` | :ref:`get_cull_mask<class_Light_get_cull_mask>` **(** **)** const |
  19. +----------------------------+----------------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`float<class_float>` | :ref:`get_param<class_Light_get_param>` **(** :ref:`int<class_int>` param **)** const |
  21. +----------------------------+----------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`Color<class_color>` | :ref:`get_shadow_color<class_Light_get_shadow_color>` **(** **)** const |
  23. +----------------------------+----------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`bool<class_bool>` | :ref:`get_shadow_reverse_cull_face<class_Light_get_shadow_reverse_cull_face>` **(** **)** const |
  25. +----------------------------+----------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`bool<class_bool>` | :ref:`has_shadow<class_Light_has_shadow>` **(** **)** const |
  27. +----------------------------+----------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`bool<class_bool>` | :ref:`is_editor_only<class_Light_is_editor_only>` **(** **)** const |
  29. +----------------------------+----------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`bool<class_bool>` | :ref:`is_negative<class_Light_is_negative>` **(** **)** const |
  31. +----------------------------+----------------------------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`set_color<class_Light_set_color>` **(** :ref:`Color<class_color>` color **)** |
  33. +----------------------------+----------------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`set_cull_mask<class_Light_set_cull_mask>` **(** :ref:`int<class_int>` cull_mask **)** |
  35. +----------------------------+----------------------------------------------------------------------------------------------------------------------------+
  36. | void | :ref:`set_editor_only<class_Light_set_editor_only>` **(** :ref:`bool<class_bool>` editor_only **)** |
  37. +----------------------------+----------------------------------------------------------------------------------------------------------------------------+
  38. | void | :ref:`set_negative<class_Light_set_negative>` **(** :ref:`bool<class_bool>` enabled **)** |
  39. +----------------------------+----------------------------------------------------------------------------------------------------------------------------+
  40. | void | :ref:`set_param<class_Light_set_param>` **(** :ref:`int<class_int>` param, :ref:`float<class_float>` value **)** |
  41. +----------------------------+----------------------------------------------------------------------------------------------------------------------------+
  42. | void | :ref:`set_shadow<class_Light_set_shadow>` **(** :ref:`bool<class_bool>` enabled **)** |
  43. +----------------------------+----------------------------------------------------------------------------------------------------------------------------+
  44. | void | :ref:`set_shadow_color<class_Light_set_shadow_color>` **(** :ref:`Color<class_color>` shadow_color **)** |
  45. +----------------------------+----------------------------------------------------------------------------------------------------------------------------+
  46. | void | :ref:`set_shadow_reverse_cull_face<class_Light_set_shadow_reverse_cull_face>` **(** :ref:`bool<class_bool>` enable **)** |
  47. +----------------------------+----------------------------------------------------------------------------------------------------------------------------+
  48. Member Variables
  49. ----------------
  50. - :ref:`bool<class_bool>` **editor_only**
  51. - :ref:`Color<class_color>` **light_color**
  52. - :ref:`int<class_int>` **light_cull_mask**
  53. - :ref:`float<class_float>` **light_energy**
  54. - :ref:`bool<class_bool>` **light_negative**
  55. - :ref:`float<class_float>` **light_specular**
  56. - :ref:`float<class_float>` **shadow_bias**
  57. - :ref:`Color<class_color>` **shadow_color**
  58. - :ref:`float<class_float>` **shadow_contact**
  59. - :ref:`bool<class_bool>` **shadow_enabled**
  60. - :ref:`bool<class_bool>` **shadow_reverse_cull_face**
  61. Numeric Constants
  62. -----------------
  63. - **PARAM_ENERGY** = **0**
  64. - **PARAM_SPECULAR** = **1**
  65. - **PARAM_RANGE** = **2**
  66. - **PARAM_ATTENUATION** = **3**
  67. - **PARAM_SPOT_ANGLE** = **4**
  68. - **PARAM_SPOT_ATTENUATION** = **5**
  69. - **PARAM_CONTACT_SHADOW_SIZE** = **6**
  70. - **PARAM_SHADOW_MAX_DISTANCE** = **7**
  71. - **PARAM_SHADOW_SPLIT_1_OFFSET** = **8**
  72. - **PARAM_SHADOW_SPLIT_2_OFFSET** = **9**
  73. - **PARAM_SHADOW_SPLIT_3_OFFSET** = **10**
  74. - **PARAM_SHADOW_NORMAL_BIAS** = **11**
  75. - **PARAM_SHADOW_BIAS** = **12**
  76. - **PARAM_MAX** = **14**
  77. Description
  78. -----------
  79. 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.
  80. Member Function Description
  81. ---------------------------
  82. .. _class_Light_get_color:
  83. - :ref:`Color<class_color>` **get_color** **(** **)** const
  84. .. _class_Light_get_cull_mask:
  85. - :ref:`int<class_int>` **get_cull_mask** **(** **)** const
  86. .. _class_Light_get_param:
  87. - :ref:`float<class_float>` **get_param** **(** :ref:`int<class_int>` param **)** const
  88. .. _class_Light_get_shadow_color:
  89. - :ref:`Color<class_color>` **get_shadow_color** **(** **)** const
  90. .. _class_Light_get_shadow_reverse_cull_face:
  91. - :ref:`bool<class_bool>` **get_shadow_reverse_cull_face** **(** **)** const
  92. .. _class_Light_has_shadow:
  93. - :ref:`bool<class_bool>` **has_shadow** **(** **)** const
  94. .. _class_Light_is_editor_only:
  95. - :ref:`bool<class_bool>` **is_editor_only** **(** **)** const
  96. .. _class_Light_is_negative:
  97. - :ref:`bool<class_bool>` **is_negative** **(** **)** const
  98. .. _class_Light_set_color:
  99. - void **set_color** **(** :ref:`Color<class_color>` color **)**
  100. .. _class_Light_set_cull_mask:
  101. - void **set_cull_mask** **(** :ref:`int<class_int>` cull_mask **)**
  102. .. _class_Light_set_editor_only:
  103. - void **set_editor_only** **(** :ref:`bool<class_bool>` editor_only **)**
  104. .. _class_Light_set_negative:
  105. - void **set_negative** **(** :ref:`bool<class_bool>` enabled **)**
  106. .. _class_Light_set_param:
  107. - void **set_param** **(** :ref:`int<class_int>` param, :ref:`float<class_float>` value **)**
  108. .. _class_Light_set_shadow:
  109. - void **set_shadow** **(** :ref:`bool<class_bool>` enabled **)**
  110. .. _class_Light_set_shadow_color:
  111. - void **set_shadow_color** **(** :ref:`Color<class_color>` shadow_color **)**
  112. .. _class_Light_set_shadow_reverse_cull_face:
  113. - void **set_shadow_reverse_cull_face** **(** :ref:`bool<class_bool>` enable **)**