2
0

class_omnilight.rst 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/OmniLight.xml.
  6. .. _class_OmniLight:
  7. OmniLight
  8. =========
  9. **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>`
  10. Omnidirectional light, such as a light bulb or a candle.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. 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.
  15. \ **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.
  16. .. rst-class:: classref-introduction-group
  17. Tutorials
  18. ---------
  19. - :doc:`../tutorials/3d/lights_and_shadows`
  20. .. rst-class:: classref-reftable-group
  21. Properties
  22. ----------
  23. .. table::
  24. :widths: auto
  25. +--------------------------------------------------+------------------------------------------------------------------------+---------+
  26. | :ref:`float<class_float>` | :ref:`omni_attenuation<class_OmniLight_property_omni_attenuation>` | ``1.0`` |
  27. +--------------------------------------------------+------------------------------------------------------------------------+---------+
  28. | :ref:`float<class_float>` | :ref:`omni_range<class_OmniLight_property_omni_range>` | ``5.0`` |
  29. +--------------------------------------------------+------------------------------------------------------------------------+---------+
  30. | :ref:`ShadowDetail<enum_OmniLight_ShadowDetail>` | :ref:`omni_shadow_detail<class_OmniLight_property_omni_shadow_detail>` | ``1`` |
  31. +--------------------------------------------------+------------------------------------------------------------------------+---------+
  32. | :ref:`ShadowMode<enum_OmniLight_ShadowMode>` | :ref:`omni_shadow_mode<class_OmniLight_property_omni_shadow_mode>` | ``1`` |
  33. +--------------------------------------------------+------------------------------------------------------------------------+---------+
  34. .. rst-class:: classref-section-separator
  35. ----
  36. .. rst-class:: classref-descriptions-group
  37. Enumerations
  38. ------------
  39. .. _enum_OmniLight_ShadowMode:
  40. .. rst-class:: classref-enumeration
  41. enum **ShadowMode**:
  42. .. _class_OmniLight_constant_SHADOW_DUAL_PARABOLOID:
  43. .. rst-class:: classref-enumeration-constant
  44. :ref:`ShadowMode<enum_OmniLight_ShadowMode>` **SHADOW_DUAL_PARABOLOID** = ``0``
  45. Shadows are rendered to a dual-paraboloid texture. Faster than :ref:`SHADOW_CUBE<class_OmniLight_constant_SHADOW_CUBE>`, but lower-quality.
  46. .. _class_OmniLight_constant_SHADOW_CUBE:
  47. .. rst-class:: classref-enumeration-constant
  48. :ref:`ShadowMode<enum_OmniLight_ShadowMode>` **SHADOW_CUBE** = ``1``
  49. Shadows are rendered to a cubemap. Slower than :ref:`SHADOW_DUAL_PARABOLOID<class_OmniLight_constant_SHADOW_DUAL_PARABOLOID>`, but higher-quality. Only supported on GPUs that feature support for depth cubemaps.
  50. .. rst-class:: classref-item-separator
  51. ----
  52. .. _enum_OmniLight_ShadowDetail:
  53. .. rst-class:: classref-enumeration
  54. enum **ShadowDetail**:
  55. .. _class_OmniLight_constant_SHADOW_DETAIL_VERTICAL:
  56. .. rst-class:: classref-enumeration-constant
  57. :ref:`ShadowDetail<enum_OmniLight_ShadowDetail>` **SHADOW_DETAIL_VERTICAL** = ``0``
  58. Use more detail vertically when computing the shadow.
  59. .. _class_OmniLight_constant_SHADOW_DETAIL_HORIZONTAL:
  60. .. rst-class:: classref-enumeration-constant
  61. :ref:`ShadowDetail<enum_OmniLight_ShadowDetail>` **SHADOW_DETAIL_HORIZONTAL** = ``1``
  62. Use more detail horizontally when computing the shadow.
  63. .. rst-class:: classref-section-separator
  64. ----
  65. .. rst-class:: classref-descriptions-group
  66. Property Descriptions
  67. ---------------------
  68. .. _class_OmniLight_property_omni_attenuation:
  69. .. rst-class:: classref-property
  70. :ref:`float<class_float>` **omni_attenuation** = ``1.0``
  71. .. rst-class:: classref-property-setget
  72. - void **set_param** **(** :ref:`float<class_float>` value **)**
  73. - :ref:`float<class_float>` **get_param** **(** **)**
  74. The light's attenuation (drop-off) curve. A number of presets are available in the **Inspector** by right-clicking the curve.
  75. .. rst-class:: classref-item-separator
  76. ----
  77. .. _class_OmniLight_property_omni_range:
  78. .. rst-class:: classref-property
  79. :ref:`float<class_float>` **omni_range** = ``5.0``
  80. .. rst-class:: classref-property-setget
  81. - void **set_param** **(** :ref:`float<class_float>` value **)**
  82. - :ref:`float<class_float>` **get_param** **(** **)**
  83. 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.
  84. \ **Note:** :ref:`omni_range<class_OmniLight_property_omni_range>` is not affected by :ref:`Spatial.scale<class_Spatial_property_scale>` (the light's scale or its parent's scale).
  85. .. rst-class:: classref-item-separator
  86. ----
  87. .. _class_OmniLight_property_omni_shadow_detail:
  88. .. rst-class:: classref-property
  89. :ref:`ShadowDetail<enum_OmniLight_ShadowDetail>` **omni_shadow_detail** = ``1``
  90. .. rst-class:: classref-property-setget
  91. - void **set_shadow_detail** **(** :ref:`ShadowDetail<enum_OmniLight_ShadowDetail>` value **)**
  92. - :ref:`ShadowDetail<enum_OmniLight_ShadowDetail>` **get_shadow_detail** **(** **)**
  93. See :ref:`ShadowDetail<enum_OmniLight_ShadowDetail>`.
  94. .. rst-class:: classref-item-separator
  95. ----
  96. .. _class_OmniLight_property_omni_shadow_mode:
  97. .. rst-class:: classref-property
  98. :ref:`ShadowMode<enum_OmniLight_ShadowMode>` **omni_shadow_mode** = ``1``
  99. .. rst-class:: classref-property-setget
  100. - void **set_shadow_mode** **(** :ref:`ShadowMode<enum_OmniLight_ShadowMode>` value **)**
  101. - :ref:`ShadowMode<enum_OmniLight_ShadowMode>` **get_shadow_mode** **(** **)**
  102. The shadow rendering mode to use for this **OmniLight**. See :ref:`ShadowMode<enum_OmniLight_ShadowMode>`.
  103. \ **Note:** In GLES2, :ref:`SHADOW_CUBE<class_OmniLight_constant_SHADOW_CUBE>` is only supported on GPUs that feature support for depth cubemaps. Old GPUs such as the Radeon HD 4000 series don't support cubemap shadows and will fall back to dual paraboloid shadows as a result.
  104. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  105. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  106. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  107. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`