class_physicalskymaterial.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/PhysicalSkyMaterial.xml.
  6. .. _class_PhysicalSkyMaterial:
  7. PhysicalSkyMaterial
  8. ===================
  9. **Inherits:** :ref:`Material<class_Material>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. A material that defines a sky for a :ref:`Sky<class_Sky>` resource by a set of physical properties.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. The **PhysicalSkyMaterial** uses the Preetham analytic daylight model to draw a sky based on physical properties. This results in a substantially more realistic sky than the :ref:`ProceduralSkyMaterial<class_ProceduralSkyMaterial>`, but it is slightly slower and less flexible.
  15. The **PhysicalSkyMaterial** only supports one sun. The color, energy, and direction of the sun are taken from the first :ref:`DirectionalLight3D<class_DirectionalLight3D>` in the scene tree.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  22. | :ref:`float<class_float>` | :ref:`energy_multiplier<class_PhysicalSkyMaterial_property_energy_multiplier>` | ``1.0`` |
  23. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  24. | :ref:`Color<class_Color>` | :ref:`ground_color<class_PhysicalSkyMaterial_property_ground_color>` | ``Color(0.1, 0.07, 0.034, 1)`` |
  25. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  26. | :ref:`float<class_float>` | :ref:`mie_coefficient<class_PhysicalSkyMaterial_property_mie_coefficient>` | ``0.005`` |
  27. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  28. | :ref:`Color<class_Color>` | :ref:`mie_color<class_PhysicalSkyMaterial_property_mie_color>` | ``Color(0.69, 0.729, 0.812, 1)`` |
  29. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  30. | :ref:`float<class_float>` | :ref:`mie_eccentricity<class_PhysicalSkyMaterial_property_mie_eccentricity>` | ``0.8`` |
  31. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  32. | :ref:`Texture2D<class_Texture2D>` | :ref:`night_sky<class_PhysicalSkyMaterial_property_night_sky>` | |
  33. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  34. | :ref:`float<class_float>` | :ref:`rayleigh_coefficient<class_PhysicalSkyMaterial_property_rayleigh_coefficient>` | ``2.0`` |
  35. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  36. | :ref:`Color<class_Color>` | :ref:`rayleigh_color<class_PhysicalSkyMaterial_property_rayleigh_color>` | ``Color(0.3, 0.405, 0.6, 1)`` |
  37. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  38. | :ref:`float<class_float>` | :ref:`sun_disk_scale<class_PhysicalSkyMaterial_property_sun_disk_scale>` | ``1.0`` |
  39. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  40. | :ref:`float<class_float>` | :ref:`turbidity<class_PhysicalSkyMaterial_property_turbidity>` | ``10.0`` |
  41. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  42. | :ref:`bool<class_bool>` | :ref:`use_debanding<class_PhysicalSkyMaterial_property_use_debanding>` | ``true`` |
  43. +-----------------------------------+--------------------------------------------------------------------------------------+----------------------------------+
  44. .. rst-class:: classref-section-separator
  45. ----
  46. .. rst-class:: classref-descriptions-group
  47. Property Descriptions
  48. ---------------------
  49. .. _class_PhysicalSkyMaterial_property_energy_multiplier:
  50. .. rst-class:: classref-property
  51. :ref:`float<class_float>` **energy_multiplier** = ``1.0`` :ref:`🔗<class_PhysicalSkyMaterial_property_energy_multiplier>`
  52. .. rst-class:: classref-property-setget
  53. - |void| **set_energy_multiplier**\ (\ value\: :ref:`float<class_float>`\ )
  54. - :ref:`float<class_float>` **get_energy_multiplier**\ (\ )
  55. The sky's overall brightness multiplier. Higher values result in a brighter sky.
  56. .. rst-class:: classref-item-separator
  57. ----
  58. .. _class_PhysicalSkyMaterial_property_ground_color:
  59. .. rst-class:: classref-property
  60. :ref:`Color<class_Color>` **ground_color** = ``Color(0.1, 0.07, 0.034, 1)`` :ref:`🔗<class_PhysicalSkyMaterial_property_ground_color>`
  61. .. rst-class:: classref-property-setget
  62. - |void| **set_ground_color**\ (\ value\: :ref:`Color<class_Color>`\ )
  63. - :ref:`Color<class_Color>` **get_ground_color**\ (\ )
  64. Modulates the :ref:`Color<class_Color>` on the bottom half of the sky to represent the ground.
  65. .. rst-class:: classref-item-separator
  66. ----
  67. .. _class_PhysicalSkyMaterial_property_mie_coefficient:
  68. .. rst-class:: classref-property
  69. :ref:`float<class_float>` **mie_coefficient** = ``0.005`` :ref:`🔗<class_PhysicalSkyMaterial_property_mie_coefficient>`
  70. .. rst-class:: classref-property-setget
  71. - |void| **set_mie_coefficient**\ (\ value\: :ref:`float<class_float>`\ )
  72. - :ref:`float<class_float>` **get_mie_coefficient**\ (\ )
  73. Controls the strength of `Mie scattering <https://en.wikipedia.org/wiki/Mie_scattering>`__ for the sky. Mie scattering results from light colliding with larger particles (like water). On earth, Mie scattering results in a whitish color around the sun and horizon.
  74. .. rst-class:: classref-item-separator
  75. ----
  76. .. _class_PhysicalSkyMaterial_property_mie_color:
  77. .. rst-class:: classref-property
  78. :ref:`Color<class_Color>` **mie_color** = ``Color(0.69, 0.729, 0.812, 1)`` :ref:`🔗<class_PhysicalSkyMaterial_property_mie_color>`
  79. .. rst-class:: classref-property-setget
  80. - |void| **set_mie_color**\ (\ value\: :ref:`Color<class_Color>`\ )
  81. - :ref:`Color<class_Color>` **get_mie_color**\ (\ )
  82. Controls the :ref:`Color<class_Color>` of the `Mie scattering <https://en.wikipedia.org/wiki/Mie_scattering>`__ effect. While not physically accurate, this allows for the creation of alien-looking planets.
  83. .. rst-class:: classref-item-separator
  84. ----
  85. .. _class_PhysicalSkyMaterial_property_mie_eccentricity:
  86. .. rst-class:: classref-property
  87. :ref:`float<class_float>` **mie_eccentricity** = ``0.8`` :ref:`🔗<class_PhysicalSkyMaterial_property_mie_eccentricity>`
  88. .. rst-class:: classref-property-setget
  89. - |void| **set_mie_eccentricity**\ (\ value\: :ref:`float<class_float>`\ )
  90. - :ref:`float<class_float>` **get_mie_eccentricity**\ (\ )
  91. Controls the direction of the `Mie scattering <https://en.wikipedia.org/wiki/Mie_scattering>`__. A value of ``1`` means that when light hits a particle it's passing through straight forward. A value of ``-1`` means that all light is scatter backwards.
  92. .. rst-class:: classref-item-separator
  93. ----
  94. .. _class_PhysicalSkyMaterial_property_night_sky:
  95. .. rst-class:: classref-property
  96. :ref:`Texture2D<class_Texture2D>` **night_sky** :ref:`🔗<class_PhysicalSkyMaterial_property_night_sky>`
  97. .. rst-class:: classref-property-setget
  98. - |void| **set_night_sky**\ (\ value\: :ref:`Texture2D<class_Texture2D>`\ )
  99. - :ref:`Texture2D<class_Texture2D>` **get_night_sky**\ (\ )
  100. :ref:`Texture2D<class_Texture2D>` for the night sky. This is added to the sky, so if it is bright enough, it may be visible during the day.
  101. .. rst-class:: classref-item-separator
  102. ----
  103. .. _class_PhysicalSkyMaterial_property_rayleigh_coefficient:
  104. .. rst-class:: classref-property
  105. :ref:`float<class_float>` **rayleigh_coefficient** = ``2.0`` :ref:`🔗<class_PhysicalSkyMaterial_property_rayleigh_coefficient>`
  106. .. rst-class:: classref-property-setget
  107. - |void| **set_rayleigh_coefficient**\ (\ value\: :ref:`float<class_float>`\ )
  108. - :ref:`float<class_float>` **get_rayleigh_coefficient**\ (\ )
  109. Controls the strength of the `Rayleigh scattering <https://en.wikipedia.org/wiki/Rayleigh_scattering>`__. Rayleigh scattering results from light colliding with small particles. It is responsible for the blue color of the sky.
  110. .. rst-class:: classref-item-separator
  111. ----
  112. .. _class_PhysicalSkyMaterial_property_rayleigh_color:
  113. .. rst-class:: classref-property
  114. :ref:`Color<class_Color>` **rayleigh_color** = ``Color(0.3, 0.405, 0.6, 1)`` :ref:`🔗<class_PhysicalSkyMaterial_property_rayleigh_color>`
  115. .. rst-class:: classref-property-setget
  116. - |void| **set_rayleigh_color**\ (\ value\: :ref:`Color<class_Color>`\ )
  117. - :ref:`Color<class_Color>` **get_rayleigh_color**\ (\ )
  118. Controls the :ref:`Color<class_Color>` of the `Rayleigh scattering <https://en.wikipedia.org/wiki/Rayleigh_scattering>`__. While not physically accurate, this allows for the creation of alien-looking planets. For example, setting this to a red :ref:`Color<class_Color>` results in a Mars-looking atmosphere with a corresponding blue sunset.
  119. .. rst-class:: classref-item-separator
  120. ----
  121. .. _class_PhysicalSkyMaterial_property_sun_disk_scale:
  122. .. rst-class:: classref-property
  123. :ref:`float<class_float>` **sun_disk_scale** = ``1.0`` :ref:`🔗<class_PhysicalSkyMaterial_property_sun_disk_scale>`
  124. .. rst-class:: classref-property-setget
  125. - |void| **set_sun_disk_scale**\ (\ value\: :ref:`float<class_float>`\ )
  126. - :ref:`float<class_float>` **get_sun_disk_scale**\ (\ )
  127. Sets the size of the sun disk. Default value is based on Sol's perceived size from Earth.
  128. .. rst-class:: classref-item-separator
  129. ----
  130. .. _class_PhysicalSkyMaterial_property_turbidity:
  131. .. rst-class:: classref-property
  132. :ref:`float<class_float>` **turbidity** = ``10.0`` :ref:`🔗<class_PhysicalSkyMaterial_property_turbidity>`
  133. .. rst-class:: classref-property-setget
  134. - |void| **set_turbidity**\ (\ value\: :ref:`float<class_float>`\ )
  135. - :ref:`float<class_float>` **get_turbidity**\ (\ )
  136. Sets the thickness of the atmosphere. High turbidity creates a foggy-looking atmosphere, while a low turbidity results in a clearer atmosphere.
  137. .. rst-class:: classref-item-separator
  138. ----
  139. .. _class_PhysicalSkyMaterial_property_use_debanding:
  140. .. rst-class:: classref-property
  141. :ref:`bool<class_bool>` **use_debanding** = ``true`` :ref:`🔗<class_PhysicalSkyMaterial_property_use_debanding>`
  142. .. rst-class:: classref-property-setget
  143. - |void| **set_use_debanding**\ (\ value\: :ref:`bool<class_bool>`\ )
  144. - :ref:`bool<class_bool>` **get_use_debanding**\ (\ )
  145. If ``true``, enables debanding. Debanding adds a small amount of noise which helps reduce banding that appears from the smooth changes in color in the sky.
  146. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  147. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  148. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  149. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  150. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  151. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  152. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  153. .. |void| replace:: :abbr:`void (No return value.)`