class_spotlight.rst 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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.5/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/SpotLight.xml.
  6. .. _class_SpotLight:
  7. SpotLight
  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. A spotlight, such as a reflector spotlight or a lantern.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. A Spotlight is a type of :ref:`Light<class_Light>` node that emits lights in a specific direction, in the shape of a cone. The light is attenuated through the distance. This attenuation can be configured by changing the energy, radius and attenuation parameters of :ref:`Light<class_Light>`.
  15. \ **Note:** By default, only 32 SpotLights 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:`3D lights and shadows <../tutorials/3d/lights_and_shadows>`
  20. - `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
  21. .. rst-class:: classref-reftable-group
  22. Properties
  23. ----------
  24. .. table::
  25. :widths: auto
  26. +---------------------------+--------------------------------------------------------------------------------+----------+
  27. | :ref:`float<class_float>` | :ref:`spot_angle<class_SpotLight_property_spot_angle>` | ``45.0`` |
  28. +---------------------------+--------------------------------------------------------------------------------+----------+
  29. | :ref:`float<class_float>` | :ref:`spot_angle_attenuation<class_SpotLight_property_spot_angle_attenuation>` | ``1.0`` |
  30. +---------------------------+--------------------------------------------------------------------------------+----------+
  31. | :ref:`float<class_float>` | :ref:`spot_attenuation<class_SpotLight_property_spot_attenuation>` | ``1.0`` |
  32. +---------------------------+--------------------------------------------------------------------------------+----------+
  33. | :ref:`float<class_float>` | :ref:`spot_range<class_SpotLight_property_spot_range>` | ``5.0`` |
  34. +---------------------------+--------------------------------------------------------------------------------+----------+
  35. .. rst-class:: classref-section-separator
  36. ----
  37. .. rst-class:: classref-descriptions-group
  38. Property Descriptions
  39. ---------------------
  40. .. _class_SpotLight_property_spot_angle:
  41. .. rst-class:: classref-property
  42. :ref:`float<class_float>` **spot_angle** = ``45.0``
  43. .. rst-class:: classref-property-setget
  44. - void **set_param** **(** :ref:`float<class_float>` value **)**
  45. - :ref:`float<class_float>` **get_param** **(** **)**
  46. The spotlight's angle in degrees.
  47. \ **Note:** :ref:`spot_angle<class_SpotLight_property_spot_angle>` is not affected by :ref:`Spatial.scale<class_Spatial_property_scale>` (the light's scale or its parent's scale).
  48. .. rst-class:: classref-item-separator
  49. ----
  50. .. _class_SpotLight_property_spot_angle_attenuation:
  51. .. rst-class:: classref-property
  52. :ref:`float<class_float>` **spot_angle_attenuation** = ``1.0``
  53. .. rst-class:: classref-property-setget
  54. - void **set_param** **(** :ref:`float<class_float>` value **)**
  55. - :ref:`float<class_float>` **get_param** **(** **)**
  56. The spotlight's angular attenuation curve.
  57. .. rst-class:: classref-item-separator
  58. ----
  59. .. _class_SpotLight_property_spot_attenuation:
  60. .. rst-class:: classref-property
  61. :ref:`float<class_float>` **spot_attenuation** = ``1.0``
  62. .. rst-class:: classref-property-setget
  63. - void **set_param** **(** :ref:`float<class_float>` value **)**
  64. - :ref:`float<class_float>` **get_param** **(** **)**
  65. The spotlight's light energy attenuation curve.
  66. .. rst-class:: classref-item-separator
  67. ----
  68. .. _class_SpotLight_property_spot_range:
  69. .. rst-class:: classref-property
  70. :ref:`float<class_float>` **spot_range** = ``5.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 maximal range that can be reached by the spotlight. Note that the effectively lit area may appear to be smaller depending on the :ref:`spot_attenuation<class_SpotLight_property_spot_attenuation>` in use. No matter the :ref:`spot_attenuation<class_SpotLight_property_spot_attenuation>` in use, the light will never reach anything outside this range.
  75. \ **Note:** :ref:`spot_range<class_SpotLight_property_spot_range>` is not affected by :ref:`Spatial.scale<class_Spatial_property_scale>` (the light's scale or its parent's scale).
  76. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  77. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  78. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  79. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`