class_omnilight.rst 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the OmniLight.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_OmniLight:
  6. OmniLight
  7. =========
  8. **Inherits:** :ref:`Light<class_Light>` **<** :ref:`VisualInstance<class_VisualInstance>` **<** :ref:`CullInstance<class_CullInstance>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. Omnidirectional light, such as a light bulb or a candle.
  10. Description
  11. -----------
  12. An Omnidirectional light is a type of :ref:`Light<class_Light>` that emits light in all directions. The light is attenuated by distance and this attenuation can be configured by changing its energy, radius, and attenuation parameters.
  13. **Note:** By default, only 32 OmniLights may affect a single mesh *resource* at once. Consider splitting your level into several meshes to decrease the likelihood that more than 32 lights will affect the same mesh resource. Splitting the level mesh will also improve frustum culling effectiveness, leading to greater performance. If you need to use more lights per mesh, you can increase :ref:`ProjectSettings.rendering/limits/rendering/max_lights_per_object<class_ProjectSettings_property_rendering/limits/rendering/max_lights_per_object>` at the cost of shader compilation times.
  14. Tutorials
  15. ---------
  16. - :doc:`../tutorials/3d/lights_and_shadows`
  17. Properties
  18. ----------
  19. +--------------------------------------------------+------------------------------------------------------------------------+---------+
  20. | :ref:`float<class_float>` | :ref:`omni_attenuation<class_OmniLight_property_omni_attenuation>` | ``1.0`` |
  21. +--------------------------------------------------+------------------------------------------------------------------------+---------+
  22. | :ref:`float<class_float>` | :ref:`omni_range<class_OmniLight_property_omni_range>` | ``5.0`` |
  23. +--------------------------------------------------+------------------------------------------------------------------------+---------+
  24. | :ref:`ShadowDetail<enum_OmniLight_ShadowDetail>` | :ref:`omni_shadow_detail<class_OmniLight_property_omni_shadow_detail>` | ``1`` |
  25. +--------------------------------------------------+------------------------------------------------------------------------+---------+
  26. | :ref:`ShadowMode<enum_OmniLight_ShadowMode>` | :ref:`omni_shadow_mode<class_OmniLight_property_omni_shadow_mode>` | ``1`` |
  27. +--------------------------------------------------+------------------------------------------------------------------------+---------+
  28. Enumerations
  29. ------------
  30. .. _enum_OmniLight_ShadowMode:
  31. .. _class_OmniLight_constant_SHADOW_DUAL_PARABOLOID:
  32. .. _class_OmniLight_constant_SHADOW_CUBE:
  33. enum **ShadowMode**:
  34. - **SHADOW_DUAL_PARABOLOID** = **0** --- Shadows are rendered to a dual-paraboloid texture. Faster than :ref:`SHADOW_CUBE<class_OmniLight_constant_SHADOW_CUBE>`, but lower-quality.
  35. - **SHADOW_CUBE** = **1** --- Shadows are rendered to a cubemap. Slower than :ref:`SHADOW_DUAL_PARABOLOID<class_OmniLight_constant_SHADOW_DUAL_PARABOLOID>`, but higher-quality.
  36. ----
  37. .. _enum_OmniLight_ShadowDetail:
  38. .. _class_OmniLight_constant_SHADOW_DETAIL_VERTICAL:
  39. .. _class_OmniLight_constant_SHADOW_DETAIL_HORIZONTAL:
  40. enum **ShadowDetail**:
  41. - **SHADOW_DETAIL_VERTICAL** = **0** --- Use more detail vertically when computing the shadow.
  42. - **SHADOW_DETAIL_HORIZONTAL** = **1** --- Use more detail horizontally when computing the shadow.
  43. Property Descriptions
  44. ---------------------
  45. .. _class_OmniLight_property_omni_attenuation:
  46. - :ref:`float<class_float>` **omni_attenuation**
  47. +-----------+------------------+
  48. | *Default* | ``1.0`` |
  49. +-----------+------------------+
  50. | *Setter* | set_param(value) |
  51. +-----------+------------------+
  52. | *Getter* | get_param() |
  53. +-----------+------------------+
  54. The light's attenuation (drop-off) curve. A number of presets are available in the **Inspector** by right-clicking the curve.
  55. ----
  56. .. _class_OmniLight_property_omni_range:
  57. - :ref:`float<class_float>` **omni_range**
  58. +-----------+------------------+
  59. | *Default* | ``5.0`` |
  60. +-----------+------------------+
  61. | *Setter* | set_param(value) |
  62. +-----------+------------------+
  63. | *Getter* | get_param() |
  64. +-----------+------------------+
  65. The light's radius. Note that the effectively lit area may appear to be smaller depending on the :ref:`omni_attenuation<class_OmniLight_property_omni_attenuation>` in use. No matter the :ref:`omni_attenuation<class_OmniLight_property_omni_attenuation>` in use, the light will never reach anything outside this radius.
  66. ----
  67. .. _class_OmniLight_property_omni_shadow_detail:
  68. - :ref:`ShadowDetail<enum_OmniLight_ShadowDetail>` **omni_shadow_detail**
  69. +-----------+--------------------------+
  70. | *Default* | ``1`` |
  71. +-----------+--------------------------+
  72. | *Setter* | set_shadow_detail(value) |
  73. +-----------+--------------------------+
  74. | *Getter* | get_shadow_detail() |
  75. +-----------+--------------------------+
  76. See :ref:`ShadowDetail<enum_OmniLight_ShadowDetail>`.
  77. ----
  78. .. _class_OmniLight_property_omni_shadow_mode:
  79. - :ref:`ShadowMode<enum_OmniLight_ShadowMode>` **omni_shadow_mode**
  80. +-----------+------------------------+
  81. | *Default* | ``1`` |
  82. +-----------+------------------------+
  83. | *Setter* | set_shadow_mode(value) |
  84. +-----------+------------------------+
  85. | *Getter* | get_shadow_mode() |
  86. +-----------+------------------------+
  87. See :ref:`ShadowMode<enum_OmniLight_ShadowMode>`.
  88. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  89. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  90. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`